Exemplo n.º 1
0
def test_empty():
    g = Board(board=[], disc_color='RED', player_id='Alice')
    assert g.rows() == 0
    assert g.columns() == 0
    assert g.free_space() == 0
    assert g.possible_moves() == []
    assert g.disc_color == 'RED'
    assert g.player_id == 'Alice'
Exemplo n.º 2
0
def test_simple_board():
    b = [['EMPTY', 'EMPTY'], ['EMPTY', 'EMPTY'], ['EMPTY', 'EMPTY']]
    g = Board(board=b, disc_color='RED', player_id='Alice')
    assert g.rows() == len(b)
    assert g.columns() == len(b[0])
    assert g.free_space() == len(b) * len(b[0])
    assert g.possible_moves() == [0, 1]
    assert g.shape() == (len(b), len(b[0]))