Logo Maze Crawlers.
A maze crawler is an autonomous program which navigates its way through a maze. For the purposes of this challenge the maze is a bitmap loaded from the W: drive. The maze starts on a red shape and ends on a green one. The sides of the maze are black. The crawler must not drive onto a black pixel.
Your challenge is to program crawlers which can tackle different kinds of maze by the shortest route possible.
Basic Maze CrawlerThis program demonstrates the basic commands needed to solve a maze in Logo on a bitmap. Setup
to setup randwalk
to randwalk |
setup clears the screen, draws the bitmap at (-250, -150) and then positions the turtle inside the red blob. Logo has a bitload command for loading bitmaps and a gifload command for loading gifs (in more recent versions). randwalk uses a pair of nested do.until loops. The outside loop stops when the turtle lands on a green pixel. The inner loop stops when the turtle lands on a black pixel. At this point the turtle backs away from the black wall and then heads off in a random direction. Colours are read using the pixel command. This is a very poor program. The practice maze W:logogame/prac1.bmp has a tunnel which is at most 1000 pixels long but randwalk can take tens of thousands of pixels to solve it. randwalk will however solve any 2-D maze, eventually. At the start. |
A little later. |
Success after 65000 pixels. |
Training Mazes Type 1These have no branches, dead ends or loops. W:logogame\prac1.gif W:logogame\prac2.gif W:logogame\prac3.gif |
Training Mazes Type 2These have branches and dead ends but no loops. W:logogame\prac4.gif Training Mazes Type 3These have branches, dead ends and loops. W:logogame\prac5.gif |