Beispiel #1
0
def test_index_of_best_move():
    r = Records(8, [0, 0], Board(8))
    r.best_move = [0, 0]
    r.legal_moves_avail = [[0, 0], [0, 1]]
    r.turns_avail = False
    assert (r.index_of_best_move() is None)
    r.turns_avail = True
    assert (r.index_of_best_move() == 0)
Beispiel #2
0
def test_ideal_move():
    r = Records(8, [0, 0], Board(8))
    r.turns_avail = False
    assert (r.ideal_move() is None)
    r.turns_avail = True
    r.legal_moves_avail = [[1, 6], [2, 4], [2, 6], [3, 7]]
    r.total_flips_avail = [[[2, 5, 'white'], [3, 4, 'black']],
                           [[3, 4, 'white']], [[3, 5, 'white']],
                           [[3, 6, 'white'], [3, 5, 'black'], [3, 4, 'black']]]
    assert (r.ideal_move() == [3, 7])
Beispiel #3
0
def test_can_play():
    r = Records(8, [0, 0], Board(8))
    r.legal_moves_avail = []
    assert (r.can_play() is False)
    r.legal_moves_avail = [[1, 2, "white"]]
    assert (r.can_play() is True)