- The format of the the files (here and here)
- The maze 0,0 is bottom-left.
- Using a graph algo must had better performance but it won't shine F# features like unions, active patterns, partial functions, etc.
- Steps and grid are printed for better visualization of the logic
It only contains 4 lines:
- Size of the maze, ie.:
5x4
- Start cell indexes and head direction, ie.:
0,1,n
,0,1,e
- End cell index, ie.:
4,2
- Bomb positions indexes, ie.:
1,1;3,1;3,3
All indexes are 0-based
Only one line:
r
indicates rotationm
indicates move one tile in the current orientation
There are two scripts run.sh
and run.ps1
to run it in a bash terminal or PowerShell respectively.
Both will run a few scenarios using small.txt maze.
It will run the moves:
There is also one last run that will use small-NoEdgeStart.txt maze and noEdgeStart-win.txt to show how it can run with a start that is not an edge of the maze.