Exemplo n.º 1
0
    def test_is_game_over_column(self):

        tab = np.array(
            [[1,5,1,5],
             [1,6,2,6],
             [3,7,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [2,7,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,3,7],
             [3,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,5,2,6],
             [3,7,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,6,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,3,7],
             [4,7,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,1,6],
             [3,7,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,2,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,3,7],
             [4,8,3,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,5],
             [3,7,3,7],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,3,6],
             [4,8,4,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,5,1,5],
             [2,6,2,6],
             [3,7,3,7],
             [4,8,4,7]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())
Exemplo n.º 2
0
    def test_is_game_over_lines(self):
        tab = np.array(
            [[0,0,0,0],
             [0,0,0,0],
             [0,0,0,0],
             [0,0,0,0]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[2,2,2,2],
             [2,2,2,2],
             [2,2,2,2],
             [2,2,2,2]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,1,2],
             [3,4,3,4],
             [1,2,1,2],
             [3,4,3,4]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertTrue(grid.is_game_over())

        tab = np.array(
            [[1,1,3,4],
             [5,6,7,8],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,2,4],
             [5,6,7,8],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,3],
             [5,6,7,8],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,5,7,8],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,6,8],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,7],
             [1,2,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,1,3,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,2,2,4],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,2,3,3],
             [5,6,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,2,3,4],
             [5,5,7,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,2,3,4],
             [5,6,6,8]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())

        tab = np.array(
            [[1,2,3,4],
             [5,6,7,8],
             [1,2,3,4],
             [5,6,7,7]]
        )
        grid = GameGrid(0, 0, tab)
        self.assertFalse(grid.is_game_over())