def __init__(self, fen=default_fen, validate=True): """ Initialize the game board to the supplied FEN state (or the default starting state if none is supplied), and determine whether to check the validity of moves returned by `get_moves()`. """ self.board = Board() self.state = State(' ', ' ', ' ', ' ', ' ') self.move_history = [] self.fen_history = [] self.validate = validate self.set_fen(fen=fen)
def __init__(self): """ Initialize the game board to the supplied FEN state (or the default starting state if none is supplied), and determine whether to check the validity of moves returned by `get_moves()`. """ default_fen = 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' fen = default_fen validate = True self.board = Board() self.state = State(' ', ' ', ' ', ' ', ' ') self.move_history = [] self.fen_history = [] self.validate = validate self.set_fen(fen=fen)
def setUp(self): # implicitly tests set_position (called from __init__) self.board = Board('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR')