stockfish for godot
Diffstat (limited to 'Main.gd')
-rw-r--r--Main.gd8
1 files changed, 6 insertions, 2 deletions
diff --git a/Main.gd b/Main.gd
index 2c764d5..bf64f0e 100644
--- a/Main.gd
+++ b/Main.gd
@@ -7,5 +7,9 @@ func _ready() -> void:
var loader := StockfishLoader.new()
fish = loader.load_stockfish()
fish.game = Chess.new()
- print("GO FISH")
- fish.go()
+ while not fish.game.game_over():
+ fish.go(5)
+ var bestmove = yield(fish, "bestmove")
+ prints("bestmove", "is", fish.game.move(bestmove).san)
+ fish._position()
+ print(fish.game.pgn(), "\n", fish.game.fen())