From c15182cface0b96387f41138877e01940024c661 Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 24 May 2021 12:03:29 -0500 Subject: [PATCH] maybe it works??? --- mastosnake.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mastosnake.py diff --git a/mastosnake.py b/mastosnake.py new file mode 100644 index 0000000..fd55b6f --- /dev/null +++ b/mastosnake.py @@ -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