[Tutor] (no subject)

Teresa Stanton tms43 at clearwire.net
Fri May 18 18:06:08 CEST 2007

Hi all:

Remember when I was having problems moving my .gif around my Tkinter maze?
Well, I was going about it all wrong (as some pointed out).  What REALLY
works is a graph.  I used a dictionary, the keys are main coordinates that
are a path that the .gif follows using a greedy algorithm that finds all the
paths to a determined location.  The definition of the keys are all the
possible directions the .gif can go.  Not all paths are covered on purpose.
In any case, here is the updated code, for those who asked me to post it.
I'm hoping to have it completed next week, without the gif of my dog (lol)
and a bad guy or two to follow the gif that will be used in the maze. 

The next thing I have to do is bind an event to the arrow keys that will
update the current x and y position.. I haven't quite worked that out yet.
Right now the gif moves through the maze based on the path.  Now the event
(an keyboard arrow) should tell it to go to that direction at the next turn.
The function that defines the move is called move_gif().  I could use some
ideas because I keep getting stuck on the details. How does the event effect
the current course through the maze? Does it somehow update the current call
to find_all_paths?  
Or some sort of Helper function that interrupts the current path at a vertex
giving it a new path?  That one seems most likely, but I'm still stuck on
how to stop at the vertex and move to the new location.  Any help would be


-------------- next part --------------
A non-text attachment was scrubbed...
Name: DustY.gif
Type: image/gif
Size: 6733 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20070518/fe3d66f6/attachment.gif 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mazeRev.pyw
Url: http://mail.python.org/pipermail/tutor/attachments/20070518/fe3d66f6/attachment.pot 

More information about the Tutor mailing list