def test_generate_complete(self): grid = Grid(3) grid.init_generate_grid() # self.assertEqual(len(grid.grid), 36) grid.simple_show() grid.show_detail() grid.check_eliminate() for state in grid.direct_states: print(state, grid.direct_states[state])
def test_probably(self): grid = Grid(2) grid.init_generate_grid() grid.simple_show() grid.check_eliminate() for state in grid.probably_eliminate: state_list = grid.probably_eliminate[state] for cell in state_list: print(cell.direct_type, cell.ref_id, cell.get_pre(grid), cell.indexes, cell.get_next(grid))
def test_get_alternative_monster(self): grid = Grid() grid.init_generate_grid() grid.simple_show() # grid.show() result = grid.get_complex_swap_choice() for vo in result: print(vo) if len(result) == 0: print('There is no way to eliminate it.')
def test_swap(self): grid = Grid() grid.init_generate_grid() grid.simple_show() result = grid.swap_by_strategy(StrategyType.HIGH_ORDER_FIRST) if len(result) == 0: log.warning('no swap') return for i in result: log.info('swap %s' % i) grid.swap_and_eliminate(result) grid.show()