[Tutor] 15 puzzle

alan.gauld@bt.com alan.gauld@bt.com
Wed, 9 May 2001 13:16:14 +0100


Remco wrote:
> > Something like:
> > 
> > baselist = newList = []
>
> Oops. Assign by reference, remember?

Oops indeed, good catch.

> Use random.shuffle, i.e.
>
> import random
> buttons = range(15)
> random.shuffle(buttons)

One of the things I love about Python is that I keep discoovering 
new neat features. :-)

One of the things that I hate about Python is I usually discover those 
features *after* I've already reinvented the wheel :-(

Alan G.