[Tutor] war cards
Alan Gauld
alan.gauld at btinternet.com
Mon Dec 24 18:21:02 CET 2007
"max baseman" <dos.fool at gmail.com> wrote
> it i got stuck on one bit, how do i make it so that their is one of
> each card and i can split them?
You can define the cards as a tuple of values and insert them into a
list.
You can use random.choice() to select a card fro the list.
By applying that repeatedly you can split the list across multiple
players hands(also lists)
Is that what you mean?
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list