def test_best_plan(self): grid = Grid() grid.init_generate_grid() grid.show_detail() result = grid.swap_by_strategy(StrategyType.HIGH_ORDER_FIRST) if len(result) == 0: log.error('no swap') for i in result: log.info('swap %s' % i)
def test_check(self): grid = Grid(1) grid.init_generate_grid() grid.show_detail() print('数量统计', grid.type_count) grid.check_eliminate() for state in grid.direct_states: print(state, grid.direct_states[state])
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_generate(self): grid = Grid() grid.init_generate_grid() self.assertEqual(len(grid.grid), 16) for cell in grid.grid: log.debug(str(cell)) log.debug(grid.type_count) grid.show_detail()
def test_show(self): grid = Grid() grid.init_generate_grid() grid.show_detail() print('数量统计', grid.type_count)