summaryrefslogtreecommitdiff
path: root/swiftstory
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 17:09:15 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 23:15:21 +0100
commit292120aeb5611d0b9c2b54f54c89cd9cb96f2a4b (patch)
tree631b803d30ccf9bb7b4c84dadc9a207dd091c76a /swiftstory
parentf99639e19cb8d955556bc6c96f504fbb638f16ea (diff)
Feed the picks directly to the board, without storing them first
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory')
-rw-r--r--swiftstory/game.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/swiftstory/game.py b/swiftstory/game.py
index 4a7f009..f6dca14 100644
--- a/swiftstory/game.py
+++ b/swiftstory/game.py
@@ -16,8 +16,6 @@ class GameState(Enum):
class Game:
def __init__(self, white_desc, black_desc):
- white_pick = list(enumerate(white_desc))
- black_pick = list(enumerate(black_desc))
self.state = GameState.WAITING_NEW_JUDGE
@@ -26,8 +24,8 @@ class Game:
self.judge: Optional[Player] = None
self.board = Board()
- self.board.white_pick = white_pick
- self.board.black_pick = black_pick
+ self.board.white_pick = list(enumerate(white_desc))
+ self.board.black_pick = list(enumerate(black_desc))
random.shuffle(self.board.white_pick)
random.shuffle(self.board.black_pick)