Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/grid.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-11-27 20:22:07 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-11-27 20:22:07 (GMT)
commitcb321483f98402320d29a3484edd7db879d4cf4e (patch)
tree7ad67927a4fdb2335dfb5b9b2b67f125eda86975 /grid.py
parentc9be9633812c6cdb37c8a3b3fc3e3381cc1b88c1 (diff)
added restart
Diffstat (limited to 'grid.py')
-rw-r--r--grid.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/grid.py b/grid.py
index fb842fd..2c1653e 100644
--- a/grid.py
+++ b/grid.py
@@ -68,10 +68,16 @@ class Grid:
# shuffle the deck
def shuffle(self):
+ # hide all the cards
+ for c in self.deck:
+ self.deck[c].hide_card()
+ # randomize the deck
for n in range(0,532):
i = random.randrange(108)
j = random.randrange(108)
self.swap_cards(i,j)
+ # reset the index to the beginning of the deck after a shuffle
+ self.index = 0
return
def swap_cards(self,i,j):