basic maze problem with turtle
Joshua Landau
joshua at landau.ws
Mon Oct 14 18:58:04 EDT 2013
On 13 October 2013 23:18, <baujacob at gmail.com> wrote:
> import turtle
> userTurtle = turtle.Turtle()
> draw = turtle.Turtle()
> scr = turtle.Screen()
>
> def drawMaze():
> draw.pencolor("gold")
[lots of lines]
> print(userTurtle.pos())
>
> scr.onkeypress(m1, "Up")
> scr.onkeypress(m2, "Left")
> scr.onkeypress(m3, "Right")
> scr.onkeypress(m4, "Down")
>
> scr.listen()
>
> drawMaze()
> mazeGame()
You might realise that you don't actually have a "maze" in the sense
that you need something a *computer* can understand.
You need some data structure to hold the maze which you have drawn.
More information about the Python-list
mailing list