示例#1
0
    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)
示例#2
0
    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])
示例#3
0
    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])
示例#4
0
    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()
示例#5
0
    def test_show(self):
        grid = Grid()
        grid.init_generate_grid()
        grid.show_detail()

        print('数量统计', grid.type_count)