Posted 08 April 2013 - 03:58 PM
I working on a program that will allow a turtle to find its way out of a 2 dimensional maze.
So far I've made a movement and coordinate API particular to how I want to have the program run.
Anyway, here's my dilemma: I want the turtle to be able to store points (x,y) in a database, and have 4 booleans correspond to those points.
For example:
Point A is at 4,5. To the left of point A there is a block. In front of point A is a block. To the right of point A there is no block, and behind point A there is also no block.
If the turtle gets to point A, it will recognize the fact and know which ways it can go.
Now lets say the turtle is moving forward and reaches a wall. How can I have it log this point in the database as Point B with its coordinates? And, after it's logged as point B, how can I add the 4 booleans to the database aswell?
Can anyone point me in the right direction here?
So far I've made a movement and coordinate API particular to how I want to have the program run.
Anyway, here's my dilemma: I want the turtle to be able to store points (x,y) in a database, and have 4 booleans correspond to those points.
For example:
Point A is at 4,5. To the left of point A there is a block. In front of point A is a block. To the right of point A there is no block, and behind point A there is also no block.
If the turtle gets to point A, it will recognize the fact and know which ways it can go.
Now lets say the turtle is moving forward and reaches a wall. How can I have it log this point in the database as Point B with its coordinates? And, after it's logged as point B, how can I add the 4 booleans to the database aswell?
Can anyone point me in the right direction here?