summaryrefslogtreecommitdiff
path: root/host/simu/model/table_eurobot2011.py
diff options
context:
space:
mode:
Diffstat (limited to 'host/simu/model/table_eurobot2011.py')
-rw-r--r--host/simu/model/table_eurobot2011.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/host/simu/model/table_eurobot2011.py b/host/simu/model/table_eurobot2011.py
index f4bb63b7..f200028e 100644
--- a/host/simu/model/table_eurobot2011.py
+++ b/host/simu/model/table_eurobot2011.py
@@ -31,8 +31,11 @@ class Table (simu.model.table.Table):
def __init__ (self, cards = None):
simu.model.table.Table.__init__ (self)
# Draw cards.
- if cards is None:
- cards = [ randrange (20) for i in xrange (3) ]
+ cards = [ ]
+ while len (cards) != 3:
+ card = randrange (20)
+ if card not in cards:
+ cards.append (card)
self.cards = cards
def pos (card):
king_pos = card // 4