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 green
and the bottom color is purple
. If the green
color touches the black
color which is the maze line, then turn right. If the purple
color touches the black
color, then turn left. A red
color is bind to the head of the dog, which is used to detect the head black
color. If the head touches the black
color, 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)