maybe it works???

This commit is contained in:
randomuser 2021-05-24 12:03:29 -05:00
parent 305f28e801
commit c15182cfac
1 changed files with 29 additions and 0 deletions

29
mastosnake.py Normal file
View File

@ -0,0 +1,29 @@
class Mastosnake:
def __init__(self, tok, game):
self.tok = tok
self.game = game
def returnStatus(self):
statusstring = ""
for j in range(self.game.boarddimensions[0] - 1, -1 -1):
for i in range(0, self.game.boarddimensions[1]):
if (i, j) in self.game.snake:
if (i, j) == self.game.snake:
statusstring += "X"
else:
statusstring += "x"
elif (i, j) == self.apple:
statusstring += "a"
else:
statusstring += " "
statusstring += "\n"
dataskel = {
'status': statusstring,
'poll': {
'options': [],
'expires_in': 60,
'multiple': False
}
}
for _, _, i in self.game.moveset():
dataskel['poll']['options'].append(i)
return dataskel