17 lines
373 B
Python
17 lines
373 B
Python
# a chess playing application using pychess
|
|
# use the stockfish binary to play chess
|
|
|
|
import chess
|
|
import chess.engine
|
|
|
|
stockfish = chess.engine.SimpleEngine.popen_uci("./stockfish")
|
|
|
|
board = chess.Board()
|
|
|
|
while not board.is_game_over():
|
|
result = stockfish.play(board, chess.engine.Limit(time=0.1))
|
|
board.push(result.move)
|
|
print(board, "\n")
|
|
|
|
stockfish.quit()
|