Commit 3dffdc24 authored by David Wrobel's avatar David Wrobel
Browse files

Update Icewalker.py

parent 9c660e39
...@@ -7,11 +7,9 @@ class IceWalker(): ...@@ -7,11 +7,9 @@ class IceWalker():
self.played = [] # PILE pour la gestion des courps self.played = [] # PILE pour la gestion des courps
def undo(self): def undo(self):
if self.played != []: if self.played != []:
anti_coup = {'N' : 'S', 'E' : 'W', 'S' : 'N', 'W' : 'E'}
coup = self.played.pop() coup = self.played.pop()
self.grid.move_player_at_coord(coup[0], anti_coup[coup[1]]) self.grid.move_player_at_coord(coup[0], coup[1])
def play(self, name = 'David'): def play(self, name = 'David'):
...@@ -43,4 +41,4 @@ class IceWalker(): ...@@ -43,4 +41,4 @@ class IceWalker():
if bContinue: if bContinue:
print(self.grid) print(self.grid)
print('Bravoooooooooo !!!') print('Bravoooooooooo !!!')
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment