5 self._shutable = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
12 self._diced = [random.randint(1, 6), random.randint(1, 6)]
13 for rods in [ self._diced,
14 [ abs(self._diced[0] - self._diced[1]) ],
15 [ self._diced[0] + self._diced[1] ] ]:
16 if self._can_be_shut(rods):
17 self._options.append(rods)
22 def get_options(self):
26 if self._is_valid_option(rods):
29 self._shutable.remove(rod)
34 return len(self._shutable) == 0 or \
35 ( self._diced and len(self._options) == 0 )
40 def _can_be_shut(self, rods):
41 shutable = self._shutable.copy()
49 def _is_valid_option(self, rods):
50 for option in self._options:
51 if set(option) == set(rods):