Home    Worksheets    Subroutines    Picaxe Maths   

Task:
Maze

For this task you must make write a single program that gets from Start  to the centre of the Maze, by whatever route is available.
It needs to measure how far it goes before hitting each wall,
    -  so that it can decide which wall it has hit.
It needs to straighten on the front bumpers, to make sure it stays in line with the maze.
It needs to reverse a bit after hitting each wall, to have room to turn.

Starting at the "Start" position on the Maze, make the buggy go to the "Finish" cell and when it hits the end wall(M) it should stop and Flash its lights. 

If it hits wall A instead of the end wall (M),
  - it should spin 90°and go towards Wall B.  
If it gets to B it should spin 90° and go towards L
If it gets to L it should spin 90°and go towards J
If it gets to J it should stop and Flash its lights.

If it hits wall A instead of M, it should spin 90°and go towards Wall B.  

If it hits wall C instead of B, it should spin 180° and go towards E
If it gets to E it should spin 90°and go towards N
If it gets to N it should spin 90°and go towards I
If it gets to I it should stop and Flash its lights.
 



If it hits wall A instead of M, it should spin 90°and go towards Wall B.  
If it gets to B it should spin 90° and go towards L
If it hits wall F instead of L, it should spin 180°and go towards O
If it gets to O it should spin 90°and go towards E
If it gets to E it should spin 90°and go towards N
If it gets to N it should spin 90°and go towards I
If it gets to I it should stop and Flash its lights.

If it hits wall A instead of M, it should spin 90°and go towards Wall B.  
If it gets to B it should spin 90° and go towards L
If it gets to L it should spin 90°and go towards J
If it hits wall I instead of J, it should spin 90°and go towards O
If it gets to O it should spin 90°and go towards E
If it gets to E it should spin 90°and go towards N
If it gets to N it should spin 90°and go towards I
If it gets to I it should stop and Flash its lights. 


Content JFi Version 9/5/2007