The day of your buggle starts badly. Out of luck, it got trapped into a maze. Help it finding its path out of there.
The exit is represented by a baggle and you need to pick this baggle in order to exit the maze.
Since the maze is so small, we can write the dumbest possible algorithm to do so. It relies on randomness and proves quite inefficient.
While the buggle didn't find the path to the escape, it must proceed the
following way: pick a random integer between 0 and 2 by using the
provided random3()
method
and make one of the following actions: moving forward if possible, turn left or turn right.
You don't believe that it could work? Well, give it a try, you will see... Don't forget to pick up the baggle once you've reached it.