Skip to content

Commit

Permalink
main logic for how to solve maze(pseudo code)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shea committed Feb 7, 2012
1 parent 8c23e41 commit 6c003a2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions mainlogic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Main movement logic:


turnRight(){
turn 90degrees right in place;
drawChar('R');
}

goForward(){
move forward a foot or whatever;
drawChar('F');
}

while( front != target) {
if (rightIsClear()){
turnRight();
if (front == target) {
exit;
}
goForward();
}

else {
if (frontIsClear()){
goForward();
}
else {
turnRight();
}
}
}
drawChar('X');
play a victorious sound!

0 comments on commit 6c003a2

Please sign in to comment.