On 11/15/2011 8:40 AM, Elwin Estle wrote:
I am attempting to write a text based spider solitaire game.

What are the rules of your version of Spider? The only spiders I know have 10 dealt piles and 1 draw pile.

I think you have greatly complicated things by using classes. Consider:

deck = random.shuffle(range(13)*8) # list of 108 card "indexes" in random order.
values = "A23456789JQK" # display values corresponding to indexes
piles = [deck[x:x+10] for x in range(0,108,10)]

Anytime you want to display the value of a card use values[cardIndex]
for example to display the last card in each pile:

for pile in piles:
  print values[pile[-1]],

What will your actual display look llike?

Will you completely reprint it after each move, or alter it in place?

How will you get the moves from the player?

--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to