Skip to content

Commit

Permalink
fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MEgooneh committed Sep 24, 2023
1 parent 17102fe commit 623e2bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def is_game_end(self):
def check_votes(self):
# [TODO] : debugging here
votes = self.votes[-1]
if max(votes.values()) > 1 :
if max(votes) > 1 :
votes_sorted = sorted(votes.items(), key=lambda x:x[1])
self.kill(self.alive_players[votes_sorted[-1]])
self.kill(self.alive_players[list(votes_sorted.keys())[-1]])
if self.is_game_end(): # to check if game is over by votes
self.save_game()
return
Expand All @@ -195,7 +195,7 @@ def run_day(self) :
self.logger.warning(f"{Player} skipped the voting")
self.log_submit({'event':'vote_results' , 'content' : votes})
self.log_submit({'event':'vote_end'})
self.votes.append(list(enumerate(votes)))
self.votes.append(dict(enumerate(votes)))
self.check_votes()
for Player in self.alive_players :
res = send_message(render.game_intro(Player), render.game_report(self, Player), render.notetaking_command())
Expand Down

0 comments on commit 623e2bd

Please sign in to comment.