Marius-brt / Simple-pathfinding

Simple pathfinding in C language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple C pathfinding

Simple pathfinding using backtracking. Not always the shortest path but a good compromise between speed calculation and short path.

Example of path

x -> start position
o -> goal
# -> obstacle
. -> empty

x . . # . . . .
# . . . . . . .
. . . # . . . .
. . . # . # . .
. . . . . o . .

You can add rows, columns and change the position of the differents characters.

Result of the example

* -> path

x * * # . . . .
# . * . . . . .
. . * # . . . .
. . * # . # . .
. . * * * o . .

Compile and execute the script with the command.

gcc *.c && ./a.out

[!] Doesn't work on windows (cause I use unistd lib). Please execute with WSL or in VM if you are on windows.

About

Simple pathfinding in C language


Languages

Language:C 100.0%