From b6cbc5cb55b3047a1f5084142cce83fea358d7ea Mon Sep 17 00:00:00 2001 From: Delorme Richard Date: Tue, 30 Oct 2018 08:08:32 +0100 Subject: [PATCH] Version 1.2 Check uci input command Correct a bug in perft Correct bench & perft commands --- src/dumb.d | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dumb.d b/src/dumb.d index 127300f..5c11ce5 100644 --- a/src/dumb.d +++ b/src/dumb.d @@ -63,7 +63,7 @@ class Uci { } void uci() const { - send("id name dumb 1.1"); + send("id name dumb 1.2"); send("id author Richard Delorme"); send("option name Ponder type check default false"); send("option name Hash type spin default 64 min 1 max 65536"); @@ -155,7 +155,7 @@ class Uci { ms.generate(board); - if (!div && depth == 1) return moves.length; + if (!div && depth == 1) return ms.length; while ((m = ms.next.move) != 0) { board.update(m); @@ -250,8 +250,11 @@ class Uci { else if (findSkip(line, "go")) go(line); else if ((findSkip(line, "stop") || findSkip(line, "ponderhit")) && isPondering) bestmove(); else if (findSkip(line, "quit")) break; - else if (findSkip(line, "perft")) perft(to!int(line), true); - else if (findSkip(line, "bench")) perft(to!int(line), true); + else if (findSkip(line, "debug")) {} + else if (findSkip(line, "register")) {} + else if (findSkip(line, "perft ")) perft(to!int(line), true); + else if (findSkip(line, "bench ")) bench(to!int(line)); + else send("error unknown command: '", line, "'"); } } }