Article View: gnu.chess
Article #1421Re: GHU Chess as a move validator ?
From: Simon Waters
Date: Wed, 18 Jun 2003 20:15
Date: Wed, 18 Jun 2003 20:15
90 lines
3895 bytes
3895 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bastiaan Naber wrote: > > I would like to know > if I could turn GNU Chess into a move validator for 2 human players. > I would create an interface with php. Is there any document that I > can use on how to do this ? I searched the web but I could not find > anything. I found pychess but that is a python module and I don't > think it will be easy to include that in my website. Yes, you could, start with a recent copy though as the reporting of illegal moves was implemented in 5.04, previously it didn't work fully in Xboard mode. Read the Engine interface protocol spec at www.tim-mann.org (or in the xboard source tar ball). You'll probably want xboard mode (xboard) and pondering off (easy) (to save CPU). Use "force" to tell the engine to just read the moves in and echo them out if legal. But something like.... $ gnuchess --xboard Chess Adjusting HashSize to 1024 slots force e5 Illegal move: e5 e4 1. e4 e4 Illegal move: e4 e5 1. e5 Ng3 Illegal move: Ng3 Nf3 2. Nf3 exit I think if you check the archive you'll find a couple of sites using GNU Chess either as opponent or move validator. You need game history to validate moves accurately (castling, ep, draws by repetition and 50 move rule), so a system that loads the game in from scratch each time might be best. E.g. Each game is kept in a PGN file.... One instance of GNU Chess is running, the command is something like gnuchess xboard easy force pgnload 1.pgn e4 1. e4 pgnsave 1.pgn pgnload 4.pgn Nf3 12. Nf3 pgnsave 4.pgn You might want to rework a command like pgnsave to load game history and move in one command or some such, but check out the protocol specification first. If there are minor changes you need to make life easier shout. I am planning to add a command line "easy" and one or two extra settings to the command line. I think draw detection isn't automatic in force mode (3rd repetition), but that should be easy to fix (hint: we store position hash values in the move history when loading games). Done right you might even get several engines working as validators? You could offer features via "bk" and "hint" commands, although GNU needs to be thinking for hint to work, but it is your CPU to burn ;-) There may be better ways ! -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+8MhlGFXfHI9FVgYRAliZAJ9jyRYh2oFgG7kT4cStrAfTo3Jo2gCfZN22 FEoan5Qu/x7711spbZ/d4Bw= =Ylog -----END PGP SIGNATURE-----
Technical Details
Message-ID:
<bcqh9h$nae$1$8302bc10@news.demon.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mailReferences:
<pan.2003.06.18.13.06.03.5695@NOSPAMmailandnews.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d71d,5cf07134cbd9ca90 X-Google-Attributes: gid10d71d,public X-Google-ArrivalTime: 2003-06-18 13:15:48 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Waters <Simon@wretched.demon.co.uk> Newsgroups: gnu.chess Subject: Re: GHU Chess as a move validator ? Date: Wed, 18 Jun 2003 21:15:38 +0100 Organization: Eighth Layer Limited Lines: 91 Message-ID: <bcqh9h$nae$1$8302bc10@news.demon.co.uk> References: <pan.2003.06.18.13.06.03.5695@NOSPAMmailandnews.com> NNTP-Posting-Host: wretched.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.demon.co.uk 1055967347 23886 193.237.109.203 (18 Jun 2003 20:15:47 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 18 Jun 2003 20:15:47 +0000 (UTC) In-Reply-To: <pan.2003.06.18.13.06.03.5695@NOSPAMmailandnews.com> X-Enigmail-Supports: pgp-inline, pgp-mime X-Enigmail-Version: 0.71.0.0 X-Accept-Language: en-GB, en-US, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130