diff --git a/Chess/nimfish/nimfishpkg/position.nim b/Chess/nimfish/nimfishpkg/position.nim index ef22aac..d2704ad 100644 --- a/Chess/nimfish/nimfishpkg/position.nim +++ b/Chess/nimfish/nimfishpkg/position.nim @@ -65,6 +65,9 @@ type mailbox*: array[Square(0)..Square(63), Piece] +proc toFEN*(self: Position): string + + func inCheck*(self: Position): bool {.inline.} = ## Returns if the current side to move is in check return self.checkers != 0 diff --git a/Chess/nimfish/nimfishpkg/uci.nim b/Chess/nimfish/nimfishpkg/uci.nim index 09a1258..bdc7fb2 100644 --- a/Chess/nimfish/nimfishpkg/uci.nim +++ b/Chess/nimfish/nimfishpkg/uci.nim @@ -357,8 +357,9 @@ proc startUCISession* = of NewGame: session.board = newDefaultChessboard() of Go: - var thread: Thread[tuple[session: UCISession, command: UCICommand]] - createThread(thread, bestMove, (session, cmd)) + var thread = new Thread[tuple[session: UCISession, command: UCICommand]] + createThread(thread[], bestMove, (session, cmd)) + GcRef(thread) of Stop: session.currentSearch.load().stop() of SetOption: