diff options
-rw-r--r-- | TODO | 40 | ||||
-rw-r--r-- | oo.py | 29 |
2 files changed, 69 insertions, 0 deletions
@@ -0,0 +1,40 @@ + Python +======== + +* Receieve menu input while text is scrolling, + rather than having to interrupt with spacebar first. + +* Make a way to save and load games. + +* Make extra hard puzzle generation fast. + +* After porting ooStudy into Go, + collect data through python. Particularly: + + - Consider fully-inverted puzzles as equivalent. + + - Consider translated toroidal puzzles as equivalent. + + - How many different n by m puzzles are there? + + - What correlations are there between puzzle piece composition + and the number of possible solutions? + + + Go +======== + +* Port ooStudy into Go. + Implementation should have a bare-bones ooPuzzle with: + + - ooPuzzle.__init__ + + - ooPuzzle.set_pieces_from_game_id + + - ooPuzzle.set_pieces_from_edges + + Start with the toroidal implementation, + then do the normal boundary, + then implement no boundary -- that is, + the boundary is not logically parsed at all. + @@ -876,6 +876,35 @@ class ooPlay: elif self.xpos < self.max_xpos: self.xpos += 1 +class ooStudy(): + """Studies oo puzzles of a particular size. + + This class is not intended to be used. It is far too slow. + Instead, it is intended to be ported to a faster language. + """ + + def __init__(self, X, Y, toroidal=False): + self.X = X + self.Y = Y + self.toroidal = toroidal + self.puzzles = [] + + def __call__(self): + """Study each possible game id.""" + X = self.X + Y = self.Y + if self.toroidal: upper_bound = 2**( 2*X*Y ) + else: upper_bound = 2**( (X-1)*Y + X*(Y-1) ) + for game_id in range(upper_bound): + new_puzzle = ooPuzzle(X, Y, + game_id=game_id, toroidal=self.toroidal) + for puzzle in self.puzzles: + if puzzle.pieces == new_puzzle.pieces: + puzzle.equivalent_ids.append(game_id) + return + new_puzzle.equivalent_ids = [] + self.puzzles.append(new_puzzle) + def main(): curses.wrapper(ooPlay) |