예제 #1
0
def test_winning_condition_detected_for_secondary_diagonal_from_mid():
    nc, nr = 4, 4
    game = GameBoard(nc, nr)
    game.board = [[2, 2, 2, 1], [2, 2, 1, 0], [2, 1, 1, 1], [1, 1, 0, 0]]
    assert game.check_win(2, 3)
예제 #2
0
def test_no_win_detected():
    nc, nr = 4, 4
    game = GameBoard(nc, nr)
    game.board = [[2, 2, 2, 0], [2, 2, 1, 0], [2, 1, 1, 1], [1, 1, 1, 0]]
    assert not game.check_win(4, 3)
예제 #3
0
def test_winning_condition_detected_for_main_diagonal_from_bottom():
    nc, nr = 4, 4
    game = GameBoard(nc, nr)
    game.board = [[2, 2, 2, 0], [1, 2, 0, 0], [1, 1, 2, 0], [1, 1, 1, 2]]
    assert game.check_win(1, 1)