The problem is to solve the maze automatically without any mouse or keyboard actions.
https://scratch.mit.edu/projects/644610721/embed
The main idea is to bind two colors blocks at the **top **and the **bottom **of the dog which will get out of the maze. The top color is greenand the bottom color is purple. If the greencolor touches the blackcolor which is the maze line, then turn right. If the purplecolor touches the blackcolor, then turn left. A redcolor is bind to the head of the dog, which is used to detect the head blackcolor. If the head touches the blackcolor, then turn back.
Turn right is the default option, and turn left is also feasible. Sometimes turning left may speed up the solving speed but highly dependent the map.



Top comments (0)