An application to control the movements of a Mars rover. Surface considered is 100m x 100m, movable areas are numbered 1 through to 100. The rover:
- starts its journey facing south.
- can turn in the directions of left and right moving in metres
- can take a maximum of 5 commands at any time.
- starts in number 1
- after each set of commands reports back its current position and direction it is facing.
e.g.
- 50m
- Left
- 23m
- Left
- 4m
The above set of commands would cause the rover to report back position 4624 north. Please note that the rover cannot go out of this area so will halt all commands when it has reached its perimeter.
1 2 3 … 100 101 102 103 … 200 201 202 203 … 300 … … … … … … … 10000
Todo:
- The subsequent set of commands should be executed from the location/square the rover was last present.
- UI?