Maze
to black setxy -200 -70 setpencolor[0 0 0] seth 90 repeat 100[fd 400 lt 90 fd 1 lt 90 fd 400 rt 90 fd 1 rt 90] end
to hall :len setpencolor[255 255 0] repeat :len[fd 10 lt 90 fd 1 lt 90 fd 10 rt 90 fd 1 rt 90] end
to maze black setxy -190 -60 hall 90 seth 180 hall 190 seth 270 hall 60 seth 0 hall 60 seth 90 hall 50 seth 180 fd 10 seth 90 fd 10 seth 0 hall 100 seth 0 fd 10 seth 90 fd 10 seth 270 hall 60 seth 0 fd 10 seth 270 fd 10 seth 180 hall 155 seth 270 hall 25 seth 0 hall 185 end
to guy setpencolor[255 0 0] repeat 10[fd 3 rt 36] wait 3 setpencolor[255 255 0] repeat 10[fd 3 rt 36] end
to lguy :x repeat :x[ pu setx xcor-3 pd guy] end
to rguy :x repeat :x[ pu setx xcor+3 pd guy] end
to dguy :d repeat :d[ pu sety ycor-3 pd guy] end
to uguy :d repeat :d[ pu sety ycor+3 pd guy] end
to moveguy pu setxy -190 -55 pd uguy 55 pu sety ycor+3 rguy 123 pu setx xcor+1 dguy 36 pu sety ycor-1 lguy 36 pu setx xcor-2 uguy 29 pu sety ycor+2 lguy 63 dguy 36 pu sety ycor-2 rguy 99 pu setx xcor+1 dguy 13 lguy 120 moveguy end
Here are the user defined commands used to create the animated maze: black - creates a large black background area hall - creates yellow halls maze - creates the maze guy - draws, waits, and erases the little circle lguy - moves guy to the left rguy - moves guy to the right dguy - moves guy down uguy - moves guy up moveguy - navigates guy through the maze --------------------------- The sample maze is made up of ten lines or halls. You will create a more interesting maze made up of at least 15 lines or halls.