X-Git-Url: http://git.treefish.org/~alex/shutbox.git/blobdiff_plain/25f4f9302ebf442544346d123eab4d8c8ed26044..53107cd2371c49d4de4b41b61151f440f1b92a79:/src/game.py?ds=inline diff --git a/src/game.py b/src/game.py index 5e2fe70..203f56a 100644 --- a/src/game.py +++ b/src/game.py @@ -2,7 +2,7 @@ import random class Game: def __init__(self): - self._shutable = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + self._shutable = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] self._diced = None self._options = [] self._score = 0 @@ -10,15 +10,19 @@ class Game: def dice(self): if not self._diced: self._diced = [random.randint(1, 6), random.randint(1, 6)] + self._diced.sort() for rods in [ self._diced, [ abs(self._diced[0] - self._diced[1]) ], [ self._diced[0] + self._diced[1] ] ]: if self._can_be_shut(rods): self._options.append(rods) - def get_dice(self): + def get_diced(self): return self._diced + def get_shutable(self): + return self._shutable + def get_options(self): return self._options