Fix bug
This commit is contained in:
parent
8f7d3e9714
commit
3ff55f281e
12
tron/game.py
12
tron/game.py
|
@ -109,10 +109,10 @@ class Game:
|
||||||
(pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.map())
|
(pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.map())
|
||||||
except:
|
except:
|
||||||
# An error occured during the evaluation of pp.player strategy
|
# An error occured during the evaluation of pp.player strategy
|
||||||
if id == 1:
|
if id == 0:
|
||||||
self.winner = 2
|
|
||||||
elif id == 2:
|
|
||||||
self.winner = 1
|
self.winner = 1
|
||||||
|
elif id == 1:
|
||||||
|
self.winner = 0
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,10 +134,10 @@ class Game:
|
||||||
pp.player.manage_event(event)
|
pp.player.manage_event(event)
|
||||||
except:
|
except:
|
||||||
# An error occured during the evaluation of pp.player strategy
|
# An error occured during the evaluation of pp.player strategy
|
||||||
if id == 1:
|
if id == 0:
|
||||||
self.winner = 2
|
|
||||||
elif id == 2:
|
|
||||||
self.winner = 1
|
self.winner = 1
|
||||||
|
elif id == 1:
|
||||||
|
self.winner = 0
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for (id, pp) in enumerate(self.pps):
|
for (id, pp) in enumerate(self.pps):
|
||||||
|
|
Loading…
Reference in New Issue