Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/deck.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-03-25 20:38:13 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-25 20:38:13 (GMT)
commit941fd331dcd9b3e6061ed52300cc95d5ce9668af (patch)
treeec1359b90739260d47dde3a8fcc5f932b02f2970 /deck.py
parent48818d13e335b7494b7866eef7717156fdc09ff3 (diff)
fixed method name inconsistancy
Diffstat (limited to 'deck.py')
-rw-r--r--deck.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/deck.py b/deck.py
index 182f468..4f5b320 100644
--- a/deck.py
+++ b/deck.py
@@ -93,8 +93,8 @@ class Deck:
''' Shuffle the deck (Knuth algorithm). '''
decksize = self.count()
# Hide all the cards and make sure they are back to orientation 0
- for c in self.cards:
- c.reset()
+ for card in self.cards:
+ card.reset()
# Randomize the card order.
for n in range(decksize):
i = randrange(decksize - n)
@@ -133,8 +133,8 @@ class Deck:
def clear(self):
''' Remove any highlight from the cards. '''
- for i in self.cards:
- i.reset()
+ for card in self.cards:
+ card.reset()
def swap_cards(self,i,j):
''' Swap the position of two cards in the deck. '''
@@ -145,16 +145,16 @@ class Deck:
def spr_to_card(self, spr):
''' Given a sprite, find the corresponding card in the deck. '''
- for c in self.cards:
- if c.spr == spr:
- return c
+ for card in self.cards:
+ if card.spr == spr:
+ return card
return None
def index_to_card(self, i):
''' Given a card index, find the corresponding card in the deck. '''
- for c in self.cards:
- if c.index == i:
- return c
+ for card in self.cards:
+ if card.index == i:
+ return card
return None
def deal_next_card(self):
@@ -178,9 +178,9 @@ class Deck:
def hide(self):
''' Hide the deck. '''
- for c in self.cards:
- if c is not None:
- c.hide_card()
+ for card in self.cards:
+ if card is not None:
+ card.hide()
def count(self):
''' Return the length of the deck. '''