diff options
author | ozgursarier | 2019-11-03 22:11:28 +0300 |
---|---|---|
committer | ozgursarier | 2019-11-03 22:11:28 +0300 |
commit | f5211cf3f0d9c5da77fa83cd73f2001f7026b2ad (patch) | |
tree | dcc2644dc845a10708150ab5ffccd67c1296efa9 | |
parent | d59d51e4c567b8be7b05280e2062a5149d84fa6c (diff) | |
download | aur-f5211cf3f0d9c5da77fa83cd73f2001f7026b2ad.tar.gz |
data binary extracted
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 24 | ||||
-rw-r--r-- | copyright | 45 | ||||
-rw-r--r-- | crafty-data.tar.bz2 | bin | 36432 -> 0 bytes | |||
-rw-r--r-- | crafty.6 | 121 | ||||
-rw-r--r-- | crafty.doc.v18.html | 2138 | ||||
-rw-r--r-- | crafty.faq | 244 | ||||
-rw-r--r-- | crafty.rc | 36 | ||||
-rw-r--r-- | readme | 95 | ||||
-rw-r--r-- | tournament.howto | 187 |
10 files changed, 2898 insertions, 10 deletions
@@ -1,5 +1,3 @@ -# Generated by mksrcinfo v8 -# Sat Mar 25 19:36:03 UTC 2017 pkgbase = crafty pkgdesc = A free, open-source computer chess program developed by Dr. Robert M. (Bob) Hyatt pkgver = 25.2 @@ -12,7 +10,13 @@ pkgbase = crafty source = http://www.craftychess.com/downloads/book/book.bin source = http://www.craftychess.com/downloads/book/start.pgn.gz source = http://www.craftychess.com/downloads/book/startc.pgn.gz - source = crafty-data.tar.bz2 + source = copyright + source = crafty.6 + source = crafty.doc.v18.html + source = crafty.faq + source = crafty.rc + source = readme + source = tournament.howto source = security-203541.patch source = paths.patch source = Makefile.patch @@ -20,7 +24,13 @@ pkgbase = crafty md5sums = f8f93189c64324b1959a489da822438e md5sums = 880279c223dc34164837a351faafe2f0 md5sums = 7a53d5f09d2baa5e7f0df4ee81961cfb - md5sums = 18cb719601b36825113274335ee0e3f1 + md5sums = 438cec9f32fb79f58822f97cf64e7afb + md5sums = 8f9c577aa6e99bb3e5ada83d1868a8ad + md5sums = 584ef65843016328d67a7c9df4007e87 + md5sums = f744727e291b6dec7e7c69bb3586b6dd + md5sums = 1f8f06ace9f9703297c4adae867e8d34 + md5sums = d345e23aea028ead565d608002b2e353 + md5sums = 1e911ca0812ef14f21e40821dda5c1cd md5sums = 02c7ab07c0ff8f77738a055772f4406d md5sums = 9db34746e90ceb116d162a5fa727f7e0 md5sums = 178436e4fdacdecd58d0bbdeb9aba924 @@ -15,7 +15,13 @@ source=("http://www.craftychess.com/downloads/source/$pkgname-$pkgver.zip" "http://www.craftychess.com/downloads/book/book.`[[ "$_build_book" = '0' ]] && echo bin || echo pgn.gz`" "http://www.craftychess.com/downloads/book/start.pgn.gz" "http://www.craftychess.com/downloads/book/startc.pgn.gz" - "crafty-data.tar.bz2" + "copyright" + "crafty.6" + "crafty.doc.v18.html" + "crafty.faq" + "crafty.rc" + "readme" + "tournament.howto" "security-203541.patch" "paths.patch" "Makefile.patch") @@ -23,7 +29,13 @@ md5sums=('d8ad87d9b0fc39a437595203d7b302fc' "`[[ "$_build_book" = '0' ]] && echo f8f93189c64324b1959a489da822438e || echo 05efad71289b2d328da5110df4a19f85`" '880279c223dc34164837a351faafe2f0' '7a53d5f09d2baa5e7f0df4ee81961cfb' - '18cb719601b36825113274335ee0e3f1' + '438cec9f32fb79f58822f97cf64e7afb' + '8f9c577aa6e99bb3e5ada83d1868a8ad' + '584ef65843016328d67a7c9df4007e87' + 'f744727e291b6dec7e7c69bb3586b6dd' + '1f8f06ace9f9703297c4adae867e8d34' + 'd345e23aea028ead565d608002b2e353' + '1e911ca0812ef14f21e40821dda5c1cd' '02c7ab07c0ff8f77738a055772f4406d' '9db34746e90ceb116d162a5fa727f7e0' '178436e4fdacdecd58d0bbdeb9aba924') @@ -61,11 +73,11 @@ build() { package() { cd "$srcdir" install -Dpm 0755 crafty "$pkgdir/usr/bin/crafty" - install -Dpm 0644 crafty-data/crafty.6 "$pkgdir/usr/share/man/man6/crafty.6.gz" + install -Dpm 0644 crafty.6 "$pkgdir/usr/share/man/man6/crafty.6.gz" install -dm 0755 "$pkgdir/usr/share/crafty/syzygy/" install -pm 0666 book.bin "$pkgdir/usr/share/crafty/book.bin" install -pm 0644 bookc.bin books.bin crafty.hlp "$pkgdir/usr/share/crafty/" - install -Dpm 0644 crafty-data/crafty.rc "$pkgdir/etc/crafty.rc" - install -Dpm 0644 crafty-data/copyright "$pkgdir/usr/share/licenses/crafty/copyright" - install -dpm 0644 crafty-data/{crafty.doc.v18.html,crafty.faq,readme,tournament.howto "$pkgdir/usr/share/doc/crafty/" + install -Dpm 0644 crafty.rc "$pkgdir/etc/crafty.rc" + install -Dpm 0644 copyright "$pkgdir/usr/share/licenses/crafty/copyright" + install -dpm 0644 {crafty.doc.v18.html,crafty.faq,readme,tournament.howto} "$pkgdir/usr/share/doc/crafty/" } diff --git a/copyright b/copyright new file mode 100644 index 000000000000..77b5c8434e35 --- /dev/null +++ b/copyright @@ -0,0 +1,45 @@ +Crafty, copyright 1996-2010 by Robert M. Hyatt, Ph.D., Associate Professor +of Computer and Information Sciences, University of Alabama at Birmingham. + +Crafty is a team project consisting of the following members. These are +the people involved in the continuing development of this program, there +are no particular members responsible for any specific aspect of Crafty. + + Michael Byrne, Pen Argyle, PA. + Robert Hyatt, University of Alabama at Birmingham. + Tracy Riegle, Hershey, PA. + Peter Skinner, Edmonton, AB Canada. + Ted Langreck . + +All rights reserved. No part of this program may be reproduced in any +form or by any means, for other than your personal use, without the +express written permission of the authors. This program may not be used +in whole, nor in part, to enter any computer chess competition without +written permission from the authors. Such permission will include the +requirement that the program be entered under the name "Crafty" so that +the program's ancestry will be known. + +Copies of the source must contain the original copyright notice intact. + +Any changes made to this software must also be made public to comply with +the original intent of this software distribution project. These +restrictions apply whether the distribution is being done for free or as +part or all of a commercial product. The authors retain sole ownership +and copyright on this program except for 'personal use' explained below. + +Personal use includes any use you make of the program yourself, either by +playing games with it yourself, or allowing others to play it on your +machine, and requires that if others use the program, it must be clearly +identified as "Crafty" to anyone playing it (on a chess server as one +example). Personal use does not allow anyone to enter this into a chess +tournament where other program authors are invited to participate. IE you +can do your own local tournament, with Crafty + other programs, since this +is for your personal enjoyment. But you may not enter Crafty into an +event where it will be in competition with other programs/programmers +without permission as stated previously. + +Crafty is the "son" (direct descendent) of Cray Blitz. it is designed +totally around the bit-board data structure for reasons of speed of ex- +ecution, ease of adding new knowledge, and a *significantly* cleaner +overall design. it is written totally in ANSI C with some few UNIX system +calls required for I/O, etc. diff --git a/crafty-data.tar.bz2 b/crafty-data.tar.bz2 Binary files differdeleted file mode 100644 index e8733bfc4cde..000000000000 --- a/crafty-data.tar.bz2 +++ /dev/null diff --git a/crafty.6 b/crafty.6 new file mode 100644 index 000000000000..72b80be87b7f --- /dev/null +++ b/crafty.6 @@ -0,0 +1,121 @@ +.TH crafty 6 "July 23, 2013" "23.4" "Games" +.SH NAME +crafty \- a chess playing/analysis program +.SH SYNOPSIS +.B crafty +.SH DESCRIPTION +.B crafty +is a chess playing and analysis program modeled after Cray Blitz. +It supports opening books and endgame databases. +While you +.B can +run it on a text console you will probably prefer a graphical +interface. In that case use +.B xcrafty +which uses +.BR xboard (6). + +.B crafty +is a state-of-the-art computer chess program, and +uses all of the search algorithms you have probably read +about, negascout search, killer/history move ordering, +quiescence move ordering and +pruning, hash (transposition/refutation) tables as well as +evaluation caches, selective extensions, recursive null-move +search, and a host of other features that have been used and +are still being used in most computer chess programs. If +it's not in +.BR crafty , +either it is on the "to do" list, or it +has been tried, found wanting, and discarded. + +.BR crafty 's +strength is directly dependant upon processor speed, hash table size, +size and content of it's opening book, and it's use of an endgame database. +Versions of +.B crafty +running on ICC and FICS have ratings around 2500-2700. + +This +.B crafty +package +comes with a basic opening book and a small endgame database +(all the 3 piece tablebase files). You can get a more complete +opening book (created from 650000+ games) and a huge +endgame database (about 5 GByte) from +.BR crafty 's +site at +.fi +.IR ftp://ftp.cis.uab.edu/pub/hyatt +or +.IR http://www.cis.uab.edu/hyatt/crafty . + +A more extensive documentation is available in +.fi +.IR /usr/share/doc/packages/crafty . + +.SH FILES +.TP +.I ~/.craftyrc +.BR crafty 's +startup file. Contains commands executed by +.B crafty +automatically during startup. +.TP +.I ~/.crafty/book.bin +.BR crafty 's +opening book. +.TP +.I ~/.crafty/book.lrn +Things learned, in human readable form. +.TP +.I ~/.crafty/books.bin +Controls +.BR crafty 's +opening strategy. +.TP +.I ~/.crafty/position.bin +Learned positional information. +.TP +.I ~/.crafty/position.lrn +Learned positional information in human readable form. +.TP +.I ~/.crafty/game.* +Your played games. +.TP +.I ~/.crafty/log.* +Complete +.B crafty +output produced during the game. +.TP +.I /etc/crafty.rc +.BR crafty 's +global startup file. Contains commands executed by +.B crafty +automatically during startup. It is overriden by ~/.craftyrc. +.TP +.I /usr/share/crafty +Location of the default opening books. +.TP +.I /usr/share/crafty/TB +Endgame tablebases. Get more from +.BR crafty 's +site. :-) +.SH BUGS +If you use +.B crafty +as a +.BR xboard (6) +client and exit +.BR xboard (6) +using your window managers close button, +.B crafty +might not finish at all and run forever. +.fi +Well, this might actually be considered a +.BR xboard (6) +bug. +.SH SEE ALSO +.nf +xboard(6) +.fi diff --git a/crafty.doc.v18.html b/crafty.doc.v18.html new file mode 100644 index 000000000000..6c02981a9c2d --- /dev/null +++ b/crafty.doc.v18.html @@ -0,0 +1,2138 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> <head> +<title> Crafty Command Documentation (version 18) +</title> +</head> + +<body> +<h1> Crafty Command Documentation +</h1> + +<!--- Note that I have put "Crafty" into <cite></cite>. This is +logical, as a computer program with source code provided is not less +than a book. On the other hand, maybe the document looks a bit garish +as a result? A matter of taste. ---JM. ---> + +<cite>Crafty</cite> is nothing more than a long-time hobby of mine, +dating back to <cite>Blitz</cite> and later <cite>Cray Blitz</cite>. +People ask me how I keep doing this, and that is the one question that +generally leaves me at a loss for words. + + <p>Perhaps the most common question I'm asked is "is this version of +<cite>Crafty</cite> some dumbed-down version of what you play on ICC +or what you use at a computer chess event?" The answer is a +resounding <strong>*NO*</strong>. The current version is +<em>exactly</em> what is running on ICC under this version number. +Note that a new version can, on occasion, introduce weaknesses or +outright bugs that were not present in previous "gold" versions. As a +result, you should be careful to back up your "favorite" before trying +the latest and greatest. If you aren't satisfied with the new +version, you can then go back to what you believe is a better version. + + <p>If you are looking for the strongest playing computer chess +program available, you should likely look to <cite>Fritz</cite>, +<cite>Rebel</cite>, <cite>Tiger</cite>, and the other commercial +entries. There you will find strong opponents with polished +interfaces that have been tested in a systematic and careful way. If +you are looking for a program that plays good chess, has a reasonable +set of features for you to use, is available in source form, and one +where the author welcomes feedback, code or suggestions, then you are +at the right place. I welcome comments and suggestions, and also +feedback from ideas you try yourself that seem to work. + + <p><cite>Crafty</cite> is a state-of-the-art computer chess program, +and uses all of the search algorithms you have probably read about, +negascout search, killer/history move ordering, SEE (Static Exchange +Evaluation) quiescence move ordering and pruning, hash +(transposition/refutation) tables as well as evaluation caches, +selective extensions, recursive null-move search, and a host of other +features that have been used and are still being used in most computer +chess programs. If it's not in <cite>Crafty</cite>, either it is on +the "to do" list, or it has been tried, found wanting, and discarded. + + <p>Chess knowledge is growing, and suggestions (or even better, real +code) are welcome. This is the best place to contribute your ideas, +because knowledge can be used to supplant search and make it play +better. The evaluation is probably the easiest place to start +studying <cite>Crafty</cite> because of the comments and simplicity of +using bitmaps, *once* you get "into" them. + + <p>My purpose for doing this is an exercise in computer chess +efficiency. I can't begin to count the number of people I know that +started from scratch to write a chess program. Even larger is the +group that started from scratch, and gave up before finishing, because +of the basic size of the project. + + <p><cite>Crafty</cite> offers everyone a very clean starting point, +if you are fascinated by the bitmap chess board implementation (as I +am). The search and quiescence code is reasonably straightforward, as +is the evaluation. + + <p>It offers a great starting point, so that if you are interested +in trying a new search extension, you can be testing tomorrow, rather +than next year, because you start with a fully functional chess engine +that is not a "toy" application, but is a functional and "dangerous" +chess player. It offers a rapid start, although you can certainly +replace it piece by piece until it is "yours" if you want. It also +offers a fairly complete set of commands and an interface for a GUI as +well as support for chess server play, so that testing and debugging +your new ideas is greatly simplified. + + <p>If you'd like more information, please check out the +<code>read.me</code> document and the <code>crafty.FAQ</code> that are +distributed with <cite>Crafty</cite>. These contain recent news and +specific instructions for commonly asked questions, like "where can I +obtain tablebase files and how do I use them?" + + + +<hr> +<h2>How to play a game.</h2> + +When you execute <strong>crafty</strong>, you will immediately be +greeted by the prompt string <strong>white(1): </strong> and +<cite>Crafty</cite> will wait for commands. This prompt means it is +White on move, and we are at move #1 for White. You can first use any +of the commands from the alphabetic command listing below to tailor +the game to your liking (time control, hash table size, book +randomness, etc.) and then you have two choices. If you want to play +White, just enter your move, and <cite>Crafty</cite> will take it from +there and make a move in response. You will then be prompted by +<strong>white(2):</strong> and it is your move again. If you would +prefer to play Black, just enter either <strong>move</strong> or +<strong>go</strong> at the prompt and <cite>Crafty</cite> will move +for that side rather than accepting a move from you. After it makes +its move for White, you will then see the prompt +<strong>black(1):</strong> indicating it is now time for Black's first +move. You can enter a move, or you can once again enter +<strong>move</strong> or <strong>go</strong> and <cite>Crafty</cite> +will again move for the current side, change sides, and prompt you for +what to do next. + + <p>If you find yourself continually using a set of commands to +configure <cite>Crafty</cite> to play as you want, you can put these +commands in a startup file called <code>.craftyrc</code> +(<cite>Unix</cite>) or <code>crafty.rc</code> +(<cite>DOS</cite>/<cite>Windows</cite>). The format for this file is +just like you would type the commands at the keyboard, with the +requirement that the last line of the file must be +<strong>exit</strong> on a line by itself. Using this, each time you +start <cite>Crafty</cite>, it will first execute the commands from +this file before it prompts you for input. + + <p>While <cite>Crafty</cite> is running, you can control what it +displays, but here's a couple of samples to explain what it is saying +and why: + +<pre><tt><strong> + depth time score variation (1) + book moves {d4, c3, Nc3, d3, b3, c4, g3, b4, Be2, Bb5} + book 0.0s 70% d4 + + White(3): d4 + time used: 0.01 +</strong></tt></pre> + +This is the normal output for those cases where <cite>Crafty</cite> is +in book. The book moves line gives the set of book moves that made +the first selection cut (see the book selection explanation given +later), followed by the move actually played, in this case d4. + + <p>If <cite>Crafty</cite> is out of book, then the output looks +somewhat different as given below: + +<pre><tt><strong> + depth time score variation (1) + 4-> 0.81 2.09 6. dxe4 Bxe4 7. Rad8 Qf2 8. Qb5 + 5 1.37 2.41 6. dxe4 Bxe4 7. Ne5 Qf4 8. Bxe4+ Qxe4 9. f5 + 5-> 1.88 2.41 6. dxe4 Bxe4 7. Ne5 Qf4 8. Bxe4+ Qxe4 9. f5 + 6 7.38 -- 6. dxe4 + 6 11.90 1.97 6. dxe4 Bxe4 7. Rab8 Qf2 8. Qc7 Nc5 9. Qe5 + 6 12.92 ++ 6. Ne5 + 6 13.71 2.23 6. Ne5 Qg2 7. Ng6 h5 8. Nh4 Qg4 + 6-> 15.59 2.23 6. Ne5 Qg2 7. Ng6 h5 8. Nh4 Qg4 + time: 15.60 cpu:99% mat:1 n:246565 nps:15927 + ext-> checks:4706 recaps:1336 pawns:0 1rep:301 + nodes full:45951 quiescence:200614 evals:104657 + endgame tablebase-> probes done: 0 successful: 0 +</strong></tt></pre> + +Let's take this stuff one line at a time.<ul> + + <li> Lines that have something like <samp>4-></samp> in the depth + column are printed when that iteration (depth) is completely finished. + + <li> The time and score columns should be obvious as to their + meaning as is the PV, the sequence of moves that led to this score. + One note about the "score" column. As of version 18, + <cite>Crafty</cite> displays the score with + values good for White, + - values good for Black, no matter which side it is playing in the + game. All output now follows this convention, from playing, to + analysis mode, to annotating your games, to whispering/kibitzing on + the chess servers, and so forth. This is unlike other engines, but + once you get used to it, it is much less confusing when you remember + that negative scores are good for Black and bad for White, and + vice-versa. + + <li> The line that has <samp>--</samp> in the score column means that + when we started depth 6, dxe4 turned out to be worse than we thought + (notice score dropped from 2.411 last search to 1.972 for this move + this search.) To resolve this, <cite>Crafty</cite> lowers the lower + search bound (alpha) and re-searches the move to find the score. + + <li> The line with <samp>++</samp> means that this move + (<samp>Ne5</samp>) is better than the best move so far, so + <cite>Crafty</cite> raises the upper search bound (beta) and + re-searches this move to find the new score. + + <li> The first line of statistics gives the total time taken for + this search, the cpu percentage which should stay at 98-100% + unless your machine is heavily loaded or unless <cite>Crafty</cite> + is in an endgame that is having lots of contact with endgame + databases. If this drops below 98%, it means that + <cite>Crafty</cite> is not getting full CPU usage and will be + playing weaker than normal. The mat:1 is simply the true material + score, since <cite>Crafty</cite>'s positional scores are often + larger than a pawn. + + </ul> + + + + +<hr> +<h2>Alphabetic Listing of Commands</h2> + +<dl> + +<!-- This is formatted as a `definition list', quite properly. +However, there is a problem about what tags to wrap around the +`definiendum'. The general style, `dfn', is not quite suitable for +computer commands. The logical choice, `code', does not show up well +in Lynx, nor in the default settings of Mozilla. So I have cheated +slightly, and used `strong'. Further, it all looks better with the +crude expedient of putting an empty paragraph at the end of each +definition. ---JM. ---> + + +<a name="alarm"></a> +<dt> <strong>alarm on</strong>|<strong>off</strong> + +<dd> This command is used to control <cite>Crafty</cite>'s "beep" +after it makes a move. Turning this off will make <cite>Crafty</cite> +"quiet" when it plays, but also makes it easy to miss a move if you +are using <cite>Crafty</cite> to play in a tournament. This is +primarily designed to make <cite>Crafty</cite> tolerable during late +night matches. + + +<p> +<a name="analyze"></a> +<dt> <strong>analyze</strong> + +<dd> This command puts <cite>Crafty</cite> into analyze mode. In this +mode, <cite>Crafty</cite> starts computing for whichever side is on +move, and it continues computing and showing its analysis until a move +is entered. This move is made, <cite>Crafty</cite> changes sides, and +starts thinking and printing analysis all over, but for the other side +now. + + <p>This command is useful to play through a game, because you get +instant feedback when you try a move. If you want to try a different +move from the one you just entered, use the <strong>back</strong> +command to back up one move, or use <strong>back <n></strong> to +back up <n> moves. Note that one move is a single move for the +last player, not a move for both sides. To unmake the most recent 2 +moves (one for Black, one for White) use <strong>back 2</strong>.<p> + + + +<a name="annotate"></a> +<dt> <strong>annotate</strong> | <strong>annotateh</strong> +<var><filename> <colors</var> | <var>name> <moves> +<margin> <time></var> + +<dd> This command is used to annotate (make comments in) a game that +has already been played.<p><dl> + + <dt> <strong>annotate</strong> + <dd> produces a file with the .can extension added to the original +name. This file will contain pure ascii information from the +annotation pass. + + <dt> <strong>annotateh</strong> + <dd> produces an HTML file instead (with the .html extension). This +includes the normal output, plus a nice bitmapped graphical board +display for every position where <cite>Crafty</cite> had 'something to say'. + + <dt> <var><filename></var> + <dd> is the name of the file that has the game moves stored in it. +This should be a PGN-compatible file, although <cite>Crafty</cite> can +read nearly any file with chess moves and convert it to pgn using the +<a href="#read"><strong>read</strong></a> and <a +href="#savegame"><strong>savegame</strong></a> commands to perform the +conversion. + + <dt> <var><colors</var> | <var>name></var> + <dd> indicates which side <cite>Crafty</cite> will annotate. The +valid choices are <strong>w</strong>, <strong>b</strong>, and +<strong>wb</strong>/<strong>bw</strong> for White only, Black only, +and both, respectively. <cite>Crafty</cite> will search and produce +results for the indicated color only, making moves for the other side +silently as they are read in. Alternatively, you can specify the +player's name (useful if you want to annotate several of your own +games in one large pgn file, for example, and you alternated colors so +that you can't pick the right one easily). <cite>Crafty</cite> will +then figure out which side to annotate for in each game. Note that +the name is case-sensitive, but that you only have to enter a string +that is unique in the name field. IE if one name is "Anatoly Karpov" +and the other is "unknown" then specifying Karpov as the name would be +sufficient. If the same 'string' appears in both names, +<cite>Crafty</cite> will complain. + + <dt><var><moves></var> + <dd> indicates the moves that should be annotated. If this is a +single integer, annotation starts at this move number (for the color +given above) and proceeds for the rest of the game. If a range is +given, as (20-33), then only moves 20-33 inclusive are annotated. To +annotate the complete game, you can use 1-999. + + <dt> <var><margin></var> + <dd> gives a score "window" that controls whether +<cite>Crafty</cite> will produce comments (see below). The larger +this number this number, the fewer annotations <cite>Crafty</cite> +will produce. A negative number will result in an annotation for +every move selected. + + <dt> <var><time></var> + <dd> indicates the time limit for each search. Since each move +selected requires two searches, you can take the number of moves, +double this number and multiply by <time> to determine how long +the annotation process will take. This time is in seconds. + + </dl> + + + <p>How it works. Suppose you use the command <strong>annotate game1 +w 1-999 1.000 30</strong>. This asks <cite>Crafty</cite> to read the +file "game1", and annotate the white moves for the entire game. The +margin is 1 pawn and the search time limit is 30 seconds. The output +for the annotate command is found in <filename>.can, in this +case this is game1.can. + + <p><cite>Crafty</cite> first searches the move actually played in +the game to determine the score for it. <cite>Crafty</cite> then +searches the same position, but tries all legal moves. If the score +for the best move found in this search is greater than the score for +the move actually played plus the margin, then a comment is added to +the output file. This output file is quite short, with all the game +moves (plus any PGN tags in the original, for identification purposes) +plus the brief comments. + + <p>An annotation looks like this: <strong>{real_value +(depth:best_value PV moves)}</strong> + + <ul> + + <li> <strong>real_value</strong> is the score for the move actually + played. + + <li> <strong>depth</strong> is the depth <cite>Crafty</cite> + searched to produce the best_value and PV for what it thinks is the + best sequence of moves for both sides. + + </ul> + + <p>If you set <var><margin></var> to 1.000, you are asking +<cite>Crafty</cite> to only annotate moves that either lost a pawn or +more, or moves that failed to win a pawn or more. If you set +<var><margin></var> to .300, you are asking for annotations for +any move that makes the score drop about 1/3 of a pawn below the value +for the best move <cite>Crafty</cite> found. + + <p>If you have other moves you would like to see analyzed during +this annotate process, at the point where the move can be played, +insert it into the PGN file as an analysis comment, surrounded by () +or {} characters. <cite>Crafty</cite> will produce analysis for this +move as well. If more than one move appears inside a single set of +delimiters, only the first will be analyzed. To force +<cite>Crafty</cite> to analyze more than one move, enter them like +this: (move1) (move2) as though they were two separate comments.<p> + + + +<a name="ANSI"></a> +<dt><strong>ANSI on</strong> | <strong>off</strong> + +<dd> This command is used to control whether or not +<cite>Crafty</cite> attempts to display its move in reverse video or +not. For PC's, Linux, and most Unix boxes, this works fine. Should +you find yourself playing <cite>Crafty</cite> via a dumb terminal, +this might hose the terminal and interfere with your ability to see or +input moves. If moves are not displayed in reverse video, it's +probably wise to turn this off to avoid hanging the terminal you are +using.<p> + + + +<a name="black|white"></a> +<dt> <strong>black</strong> | <strong>white</strong> + +<dd> This command simply toggles the side on move. if it is White to +move, and you enter white, nothing happens. If it is White to move +and you enter black, then it becomes Black's turn to move immediately +from the same position. Used only infrequently.<p> + + + +<a name="book"></a> +<dt> <strong>book</strong> + +<dd> (See the <a href="#Opening Book">Opening Book Setup and Usage</a> +section near the end of this document for a full explanation of this +command and its many options.) Note that there are special commands +available (*only* on the command line, *not* in the +<code>crafty.rc</code>/<code>.craftyrc</code> files) to direct +<cite>Crafty</cite> to specific directories for the book files +(<code>bookpath=/a/b/c</code>), the tablebase files +(<code>tbpath=/i/j/k</code>) and the log files +(<code>logpath=/x/y/z</code>). Note that these commands can *only* be +used on the command line, because they must be executed before the +engine is initialized. Putting them in the +<code>crafty.rc</code>/<code>.craftyrc</code> file will produce error +messages without affecting how the files are opened. + + <p>If you need to specify multiple directories (tbpath only) you may +do so by using "<code>tbpath=path1:path2:path3:etc</code>" or else use +the more Unix-like "<code>tbpath=(path1:path2:path3:etc)</code>" +instead. The paths are separated by ":" (colon) characters and +everything is case-sensitive as usual. For +<cite>DOS</cite>/<cite>Windows</cite> users, the separator can be a +semi-colon (;) or a comma (,) to avoid the drive designation +ambiguity.<p> + + + +<a name="cache"></a> +<dt> <strong>cache</strong> [=] <var><N></var> + +<dd> This command is used to alter the cache size used for <a +href="#egtb">endgame database</a> probes. <var><N></var> can be +a simple integer, representing the number of bytes to use or it can be +specified as nK or nM representing n * 1024 bytes or n * 1024 * 1024 +bytes. This should be in multiples of the database "chunk" size, +which might vary. Using the nM form guarantees that you will have a +reasonable number.<p> + + + +<a name="clock"></a> +<dt> <strong>clock</strong> <var><ctime> <otime></var> + +<dd> This command is primarily intended for use when +<cite>Crafty</cite> is playing in a tournament, such as the WMCCC or +WCCC events. If the operator is somewhat slow in entering moves, or +forgets to stop the clock after making a move for <cite>Crafty</cite>, +the chess clock for the game will drift from the values that +<cite>Crafty</cite> maintains internally. <var><ctime></var> is +the time (in minutes or hh:mm format) <cite>Crafty</cite> has left +until the next time control, and <var><otime></var> is the +opponent's remaining clock time. This command can be used at any +time, but will only affect the time per move *after* +<cite>Crafty</cite> makes the current move and starts to think about +what the opponent might do next.<p> + + + +<a name="computer"></a> +<dt> <strong>computer</strong> + +<dd> This command usually comes from <a +href="#xboard">XBoard/WinBoard</a>, but can be used at any time to +tell <cite>Crafty</cite> it is playing a computer. This will prevent +some things from happening, such as a draw score that varies, as well +as adjusting the book selection code to be more selective in what it +plays.<p> + + + +<a name="display"></a> +<dt> <strong>display</strong> + +<dd> This command is used to display the game board. This board is +displayed using the ICS style #1 type of ASCII display, with White +always at the bottom of the screen, Black at the top. Very unusable +to play a game with, but good to verify a position after it has been +set up. + + <p>This command is also used to display the various piece/square +tables, by typing <strong>display</strong> <var><piece></var> +where <var><piece></var> is replaced by <strong>pawn</strong>, +<strong>knight</strong>, <strong>bishop</strong>, +<strong>rook</strong>, <strong>queen</strong> or +<strong>king</strong>. The board is oriented in the same way as the +display board with a one-to-one correspondence between the squares. +Perhaps useful for curiosity, but not for anything else. These values +can not be modified by the user. + + <p>The final version of this command is used to control what kind of +output you will see when <cite>Crafty</cite> runs. Currently the +following options are available. + + <dl> + + <dt> <strong>display time</strong>: + + <dd> this will make <cite>Crafty</cite> display the amount of + time each side takes after making a move. + + + <dt> <strong>display changes</strong>: + + <dd> this will make <cite>Crafty</cite> display the PV each time + it changes during the search, including when a move fails high or + becomes a new best move. + + + <dt> <strong>display variation</strong>: + + <dd> this will make <cite>Crafty</cite> display the PV at the end of each + iteration, but it will only show the best PV for the entire + iteration, not all of the changes. + + + <dt> <strong>display stats</strong>: + + <dd> this enables basic search statistics output including time, + nodes and so forth. + + + <dt> <strong>display extstats</strong>: + + <dd> this enables extended search stats including the hashing + statistics, search extension statistics and so forth. + + + <dt> <strong>display movenum</strong>: + + <dd> causes all PV output to have move numbers embedded in them to + make the PV possibly easier to read. This causes the PV to look + like this: <strong>12. ... Nxe4 13. Bxe4 h6</strong> rather than + simply <strong>Nxe4 Bxe4 h6</strong>. This is very helpful when + playing on a server and whispering or kibitzing analysis. It + will also be useful when <cite>Crafty</cite> is run from within a + database program as the move numbers will sync up with the actual + game. + + + <dt> <strong>display moves</strong>: + + <dd> will display each root move as it is searched, along with + updating the search time at the bottom of the screen, so you can + see what move is currently being analyzed. + + + <dt> <strong>display general</strong>: + + <dd> will display general information messages whenever + <cite>Crafty</cite> wants to tell you something (ie "clearing + hash tables" or other such things like "Mate in n moves." + + </dl> + +If you put a <strong>no</strong> in front of any of these options, +that will disable that particular type of output.<p> + + + +<a name="draw"></a> +<dt> <strong>draw</strong> + +<dd> offers <cite>Crafty</cite> a draw. It generally will look at the +value returned by the last search, and compare it with the value +returned by an internal function DrawScore(). If the search value is +not above this result, then <cite>Crafty</cite> will accept the draw. +If the search value is above the theoretical value for a draw, +<cite>Crafty</cite> will decline the draw. Note that +<cite>Crafty</cite> will offer draws based on internal analysis. When +it offers a draw, you can respond with <strong>"draw"</strong> +although the game does not really end until you exit +<cite>Crafty</cite>.<p> + + + +<a name="drawscore"></a> +<dt> <strong>drawscore</strong> <var>N</var> + +<dd> sets the draw score (or contempt factor) to <var>N</var>. If you +want <cite>Crafty</cite> to avoid draws, set this number to something that is +negative. IE -50 says that a repetition (draw) is the same as being +1/2 pawn down. Setting it to +100 will make it try very hard to draw +because that looks like it is winning a pawn when it does so. Note +that this is dangerous (either way) as a -50 in a king and pawn ending +is very likely dead lost... and a repetition is better.<p> + + + +<a name="echo"></a> +<dt> <strong>echo</strong> <var><text></var> + +<dd> This command is normally used inside a command file that you are +going to use to "feed" <cite>Crafty</cite> some positions for analysis +or whatever. Since <cite>Crafty</cite> depends on the operating +system to echo commands as they are typed, commands read in from a +file are "invisible." This gives you the ability to insert commands +into such a file so that <cite>Crafty</cite> displays a message on the +screen to give you an idea of where it is in processing the file.<p> + + + +<a name="edit"></a> +<dt> <strong>edit</strong> + +<dd> This command has been "cloned" from <cite>GnuChess</cite> to +provide an interface with <a href="#xboard">Xboard</a>. After +entering the <strong>edit</strong> command, you are in "edit.white" +mode, where any piece/square combination you enter will add the +indicated white piece on the given square. Piece/squares are entered +as "qa3", or "bc4" for example. This puts a white queen on a3 and a +white bishop on c4. Once all white pieces are entered, typing a "c" +changes to "edit.black" mode where piece/square combinations now place +black pieces. Typing a "." character exits edit mode. To clear the +board initially, you use the "#" character. + + <p>Here's a sample to set up the original starting position, after +White has played 1. e4, but no other moves have been played. + +<pre><strong> + edit + # + ra1 nb1 bc1 qd1 ke1 bf1 ng1 rh1 + pa2 pb2 pc2 pd2 pe4 pf2 pg2 ph2 + c + ra8 nb8 bc8 qd8 ke8 bf8 ng8 rh8 + pa7 pb7 pc7 pd7 pe7 pf7 pg7 ph7 + . +</strong></pre> + +Note that input is free form, so piece/squares can be entered one per +line or all on one line. Ditto for the #, c, and . special +characters. Note also that there is no way to enter castling status +here. It is far better to use the <a href="#setboard"> +<strong>setboard</strong></a> command which uses a FEN-like syntax and +allows you to set both castling and en passant status.<p> + + + +<a name="egtb"></a> +<dt> <strong>egtb</strong> + +<dd> This command enables the endgame databases. <cite>Crafty</cite> +will use the "tbpath" directory (if provided) to locate and register +all of the databases you have downloaded. It will report the largest +class it found, as in "5 piece tablebase files found" if you +downloaded at least one 5-piece file. If you use this command to +enable databases, you should also consider using the <a +href="commands.html#cache"><strong>cache</strong></a> command to +specify the egtb cache size.<p> + + + +<a name="quit"></a> <dt> <strong>end</strong> | <strong>quit</strong> + +<dd> These commands are used to terminate <cite>Crafty</cite>. Note +that you can resume a game later without having to replay the moves, +by starting <cite>Crafty</cite> using the <strong>crafty c</strong> +command. It will immediately read in the moves for the last game, +although you will have to set the time controls and clock time +remaining yourself.<p> + + + +<a name="evaluation"></a> +<dt> <strong>evaluation</strong> <var>option <value></var> + +<dd> This command is used to modify the evaluation scores. + + <ul> + + + <li> The option <strong>asymmetry</strong> is used to make + <cite>Crafty</cite> evaluate king safety differently for each side. + + <p><strong>evaluation asymmetry 25</strong> will increase the king + safety scores for the opponent only, meaning it will pay less + attention to its own king safety than to that of its opponent. This + will make it play more aggressively. + + <p><strong>evaluation asymmetry -25</strong> will reduce the king + safety scores for the opponent by 25%, making it care more about + its own king safety than that of its opponent. This will make it + play more defensively. + + + <li> The <strong>bscale</strong> option will adjust the scores for blocked + pawns. The default value is 100. Increasing this will tend to make + <cite>Crafty</cite> dislike blocked pawn positions more, which will + lead to more open positions. Note that this only affects moves + _after_ the opening book has been followed, which means that the + position might be blocked before the evaluation term has a chance to + affect the game. + + + <li> The <strong>kscale</strong> option will adjust all king safety + scores based on the 'value' entered. For example, + + <dl> + + <dt> <strong>evaluation kscale 50</strong> + <dd> will reduce all king safety scores to 50% of their normal + value. + + <dt> <strong>evaluation kscale 133</strong> + <dd> will increase all king safety scores to 133% of their normal + values.<dd></dl> + + + <li> The option <strong>tropism</strong> is used to scale king + tropism scores. This will attract pieces toward kings. A value of + 100 means no change. other values are treated as a percentage (like + scale) to increase (> 100) or decrease (<100) the king + tropism scores. + + </ul> + + <p>When you use this command, you will see something like this: + +<pre> + + modified king-safety values: + white: 0 4 16 26 39 45 58 77 87 90 93 96 100 103 106 109 + 112 116 119 122 125 128 128 128 128 128 128 128 128 128 128 128 + + black: 0 5 20 32 48 56 72 96 108 112 116 120 124 128 132 136 + 140 144 148 152 156 160 160 160 160 160 160 160 160 160 160 160 + +</pre> + +Those values represent the king-safety evaluation as the king gets +more and more exposed. This is always based on the fast that "crafty" +will be the side on move when the search starts. In the above, it was +White's move when this was typed, meaning that it appears that +<cite>Crafty</cite> will be playing Black. Notice that White's king +safety numbers are scaled by 20% to make it slightly more cautious +about its own king. If you type <strong>go</strong> in this position, +the scores get reversed as <cite>Crafty</cite>'s scores are always +left alone (with the asymmetry option) and the opponent's scores are +scaled down as indicated. + + <p>You will see similar numbers (but not black and white sets) that +represent the actual scores produced for king tropism. Note that +pieces interact to choose which element of this vector is used, but in +general, the more pieces are close to the king, the larger the element +from this array. + + <ul> + + <li> The <strong>pscale</strong> option is used to scale normal pawn + structure scoring in the same way as the other scaling options. 100 + is the default. Values less than 100 reduce this term, values over + 100 inflate it. + + + <li> The <strong>ppscale</strong> option is used to scale some + passed pawn scoring in the same way as the other scaling options. + 100 is the default. Values less than 100 reduce this term, values + over 100 inflate it. This mainly effects outside passed + pawns/protected passed pawns. The normal pawn scoring computes the + value of a passed pawn. This term is then used to scale those terms + that modify this value further, such as two connected passed pawns + on the 6th, or a passed pawn with the king supporting it in an + endgame. + + </ul><p> + + + +<a name="extensions"></a> +<dt> <strong>extensions</strong> <var><type> <value></var> + +<dd> This command is used to control the extension depth for the +various extensions done in <cite>Crafty</cite>'s search. The +extensions are set as decimal numbers that represent plies (or +fractions of plies) to extend for each particular reason. Most +default to 1.0 and .75, but any value can be used. Note that values +> 1.0 are _very_ dangerous as they can cause the search to become +non-terminating (<cite>Crafty</cite> will stop when it runs out of +time for the move, but it might not be able to get anything useful +from such a search). + + <p>These extensions are presently limited to a maximum of one ply of +extensions at any point in the tree. IE no matter what you set these +values to, they can not exceed one ply at present. + + <dl> + + <dt> <strong>incheck</strong> + + <dd> This is the amount to extend when the side on move makes a move + that leaves the opponent in check. Note that <cite>Crafty</cite> + extends on the ply where the check is played, not on the next ply + where the opposite side is in check. + + <dt> <strong>onerep</strong> + <dd> This is the one-reply-to-check extensions, and is done at the + point where one side is in check and has exactly one legal move to + escape from the check. + + <dt> <strong>pushpp</strong> + <dd> This is the extension used for certain passed pawn pushes in + the endgame. + + <dt> <strong>recapture</strong> + <dd> This is the recapture extension, and is applied when the + current move recaptures an equal-valued piece that made a capture at + the previous ply. IE BxN, PxB. Note that this can only be applied + once for every two plies so that BxN, BxB, NxB, NxN won't look like + three recaptures. + + <dt> <strong>mate</strong> + <dd> This is the mate threat extensions and is applied when a null + move search returns -MATED, which means that doing nothing gets the + side on move mated. The opponent must have some sort of serious mate + threat in such a position. + + </dl><p> + + + +<a name="flag"></a> +<dt> <strong>flag on</strong>|<strong>off</strong> + +<dd> This command is used to force <cite>Crafty</cite> to end a game +where the opponent runs out of time with <a +href="#xboard">WinBoard/XBoard</a> (<strong>on</strong>) or to ignore +this (<strong>off</strong>) if desired.<p> + + + +<a name="force"></a> +<dt> <strong>force</strong> [<var>move</var>] + +<dd> This command is used to force <cite>Crafty</cite> to play a move +that is different from the one chosen and played by the tree search. +If [<var>move</var>] is given, and it is a legal move, +<cite>Crafty</cite> will retract its last move and make this move +instead. It does not change the side on move, but does change the +position of course. If [<var>move </var>]is not given, +<cite>Crafty</cite> will prompt you for a move to make.<p> + + + +<a name="hash"></a> +<dt> <strong>hash=</strong><var>x</var> and +<strong>hashp=</strong><var>x</var> + +<dd> These commands are used to adjust the size of the hash tables in +<cite>Crafty</cite>: <strong>hash</strong> modifies the size of the +transposition/refutation table, while <strong>hashp</strong> modifies +the size of the pawn structure/king safety hash table. The size +<var>x</var> may be entered as one of the following two types of +values: nnnK where nnn is an integer indicating how many Kbytes +<cite>Crafty</cite> should use for this hash table; nnnM where nnn is +an integer indicating how many Mbytes <cite>Crafty</cite> should use. + + <p>The transposition/refutation table is the more critical of the +two, because it directly affects search efficiency, particularly in +the endgame. For this reason this should be maximized. The most +effective size for this hash table is 3/4 of your available memory. +If you don't know how to figure this out, but know that you have 16 +megs for example, they you can say <strong>hash=16M</strong> and +<cite>Crafty</cite> will round that down to 12M, which is 3/4 of a +power of two size. If you study the sizes that are possible, you will +find 3M, 6M, 12M, 24M, 48M, and so forth. Anything up to, but not +including, the next size will be rounded down to the next lower size. +hashp should be set to approximately 1/2 of what is left. For +example, the P6 <cite>Crafty</cite> runs on when playing on ICC often +uses <strong>hash=48M</strong> and <strong>hashp=8M</strong>. The +only thing to watch for is that if you make this too large, +particularly under <cite>Windows</cite>, performance will suffer badly +because of paging I/O overhead. When <cite>Crafty</cite> is searching +in a normal (non-book, non-endgame database) position, the disk light +should *not* be on, indicating lots of I/O. + + <p>There is no danger in making this table too large, although you +have to watch out because if <cite>Crafty</cite> barely fits in +memory, doing something else on the machine can cause +<cite>Crafty</cite> to be swapped out completely or partially, +depending on the operating system you are using. If you are going to +use the machine for anything else while <cite>Crafty</cite> is +running, it is better to "pretend" that the machine only has 1/2 of +the memory it actually does when computing the size of the hash tables +you want to use.<p> + + + +<a name="help"></a> +<dt> <strong>help</strong> + +<dd> This command displays multiple pages of one-line help, one +command per line. If a line ends with [help], then you can use help +followed by the specific command to get detailed help.<p> + + + +<a name="history"></a> +<dt> <strong>history</strong> + +<dd> This command displays the history in a vertical column with one +move for White and one per Black per line. There are other ways to +display the current game moves and also to save them in files that are +explained later.<p> + + +<a name="import"></a> + <dt> <strong>import</strong> <var><filename></var> +[<strong>clear</strong>] + +<dd> This command is used to import any sort of learning data that +<cite>Crafty</cite> supports, which currently includes book learning +data and position learning data. This command reads the appropriate +<var><filename></var> and imports that learned data, just as +though <cite>Crafty</cite> had learned it by playing the games. The +[<strong>clear</strong>] option, if specified, causes all old learned +results to be cleared before the import operation, otherwise the +imported data is simply added to what is already present.<p> + + + +<a name="info"></a> +<dt> <strong>info</strong> + +<dd> This command is used to display information about +<cite>Crafty</cite> and the current game. Such things as the time +control, the time left on the clocks and other information is +shown.<p> + + + +<a name="input"></a> +<dt> <strong>input</strong> <var><filename></var> + +<dd> This command is used to redirect the console input I/O stream +from the keyboard to a file. <cite>Crafty</cite> will then read +commands from this file, rather than from the keyboard, and execute +them just as though they were typed in. Such a command file *must* be +terminated by an <strong>"exit"</strong> command (no quotes) as the +last command in the file. This reverts the input stream back to the +keyboard, and prompts you for another command or move. + + <p>This command might be used to configure <cite>Crafty</cite> for a +specific time control, by putting the appropriate time control +commands in the file, or to customize the hash table sizes as +needed.<p> + + + +<a name="learn"></a> +<dt> <strong>learn</strong> <var>n</var> + +<dd> controls the learning facilities in <cite>Crafty</cite>. +Currently this is a 3-bit boolean switch, bit 1 (001) controls book +learning, bit 2 (010) controls position learning, and bit 3 (100) +controls result learning. <strong>learn=0</strong> disables all +learning, <strong>learn=1</strong> enables book learning only, +<strong>learn=2</strong> enables position learning only, and +<strong>learn=4</strong> enables result learning. Add the values +together to turn on more than one type of learning (default=7 to +enable everything).<p> + + + +<a name="level"></a> +<dt> <strong>level</strong> <var><m> <t> <inc></var> + +<dd> This command was taken directly from <cite>GnuChess</cite> so +that the <cite>Xboard</cite>/<cite>WinBoard</cite> interface would +interface with <cite>Crafty</cite>. There are other better ways to +set the time, but this one is well-known. The three parameters are +<var><m></var> (number of moves in the game) +<var><t></var> initial time on the clock. After +<var><m></var> moves are made, this amount of time is added to +the clock again. <var><inc></var> is the Fischer-Clock +increment that is added back to each clock after a move is made. It +may be zero for a non-increment game. + +<p> Examples: + + <pre> + + <strong>level 0 5 0</strong> (ICS 5 0 game) + <strong>level 0 5 3</strong> (ICS 5 3 game) + <strong>level 0 15 30</strong> (ICS 15 30 game) + +</pre><p> + + +<a name="list"></a> + +<dt> <strong>list GM</strong> | <strong>IM</strong> | +<strong>C</strong> | <strong>AK</strong> | <strong>S +</strong><var>name</var> +[<strong>+</strong><var>name</var> ...] +<strong>-</strong><var>name</var> [<strong>-</strong><var>name</var> +<strong>...</strong>] + +<dd> This command is used to maintain the internal "lists" +<cite>Crafty</cite> uses to auto-tune itself when playing on a chess +server. There are three lists, <strong>GM</strong>, +<strong>IM</strong> and <strong>C</strong>. If <cite>Crafty</cite>'s +opponent is in any of these lists, <cite>Crafty</cite> adjusts +internal controls that affect how/when it resigns or offers draws, and +how randomly it will choose moves from the opening book. For example, +<cite>Crafty</cite> resigns much sooner against a GM, because it +assumes he knows how to win a rook-up ending, regardless of how much +time is left. By the same token, when playing against computers, +<cite>Crafty</cite> will always assume that a draw is 0.000, so that +it doesn't wreck its position trying to avoid repeating a position. + + <p>The <strong>AK</strong> list will automatically kibitz +scores/PV's if the opponent is in this list. The <strong>S</strong> +list will turn on special scoring for opponents in this list. The +only current member is "mercilous". + + <p>The syntax +name1 +name2 simply adds these players to the +specified list. To remove a name, use -name1 -name2. You can use one +command per name to remove or add, or you can use one command to add +and remove multiple names. Note that all names must be entered in +lowercase characters, using any uppercase characters will break the +matching algorithm.<dd><p> + + + +<a name="log"></a> +<dt> <strong>log off</strong> | <strong>on</strong> | +<var><n></var> + +<dd> This command is used to disable logging. The default is +<strong>log on</strong>, which causes <cite>Crafty</cite> to produce a +new log.nnn file for each game played. If you are running +<cite>Crafty</cite> on a server, you might use <strong>log +off</strong>, which disables creating these files as well as the +game.nnn files used to restart a game after you exit +<cite>Crafty</cite> and come back later. If you use the form +<strong>log</strong> <var>n</var> <cite>Crafty</cite> will simply +display the last <var>n</var> lines of the log on the screen. If you +use <strong>log</strong> <var>n file</var> <cite>Crafty</cite> will +copy the last n lines of the log to <var>file</var> which could be +your hard drive, or a floppy. + + <p>Note that if you run with <strong>log off</strong>, you will be +unable to find out what <cite>Crafty</cite> was thinking about since +there is no other record of the game. You will always see a game.001 +because as <cite>Crafty</cite> plays a game, this contains all the +real moves played so far so that you can back up if needed. you will +also see a log.001 file, but it will be empty.<p> + + +<a name="ls"></a> +<dt> <strong>ls</strong> <var><filename></var> + +<dd> will list all the files that match the +<var><filename></var> wildcard (the wildcards depend on the +system you are using, but generally *, ? will work fine). you can +also supply path information in the filename if you want to list the +contents of a different directory. Just use the same syntax you would +if you were using "ls" under <cite>Unix</cite> or "dir" under +<cite>Windows</cite>.<p> + + + +<a name="mode"></a> +<dt> <strong>mode tournament</strong> | <strong>normal</strong> + +<dd> This command is primarily used to put <cite>Crafty</cite> into +"tournament" mode, which is intended for use when <cite>Crafty</cite> +is playing in computer chess events. It accomplishes two things: (1) +makes all draws return a score of 0.000, and (2) makes +<cite>Crafty</cite> issue a message after each move showing the +internal chess clock time, and requesting that that operator check and +adjust as needed using the <a href="#clock"><strong>clock</strong></a> +command. This primarily makes <cite>Crafty</cite> comply with +computer chess rules that say the operator can't do anything not +specifically requested by the program.<p> + + + +<a name="name"></a> +<dt> <strong>name</strong> <var><name></var> + +<dd> This command is an ICS-play specific command. +<cite>Xboard</cite>/<cite>WinBoard</cite> uses this to inform +<cite>Crafty</cite> of the opponent's name. <cite>Crafty</cite> uses +the <var><name></var>, and looks it up in its GM/IM/C lists, and +if found, adjusts itself accordingly. This is not used by the PGN +code and this will not cause the players <var><name></var> to +show up in the PGN tag section.<p> + + + +<a name="new"></a> +<dt> <strong>new</strong> + +<dd> This command wipes everything out and starts a brand new game. +It closes the old log-file and game-file, and opens the next +sequential numbered file. It also resets the game to the beginning +and prepares to start a brand new game. This was added for Xboard, +but it turns out that Xboard does not use this, rather it starts +<cite>Crafty</cite> fresh for each new game by first terminating the +old copy then starting a new one. Not nearly as efficient as using +<strong>new</strong> but likely safer it a program can't be sure of +resetting everything back to the initial state.<p> + + + +<a name="noise"></a> +<dt> <strong>noise</strong> <var><n></var> + +<dd> This command sets the "noise" level in <cite>Crafty</cite>. +Basically, until <var><n></var> nodes have been searched, +<cite>Crafty</cite> will be silent and not display analysis. + + <p>This is useful in two ways. First, in end-games, 20+ ply +searches are not uncommon, and the search analysis for the first few +plies arrives so quickly that it is distracting. Second, when +observing games (new interface only) on ICS servers, this can be used +to avoid having <cite>Crafty</cite> generate too many analysis kibitzes. A value +of 100000 will basically shut off any output for the first second or +so (on a P6/200). Similarly, 1000000 will eliminate any output for +about the first 10 seconds. When watching and kibitzing games like +the World Championship games on ICC, I generally use 5000000, which is +almost one minute of silence so that the first PV it kibitzes is a +pretty deep search. + + <p><strong>noise 0</strong> will cause *all* analysis to be +displayed, which on a fast machine causes no problems. On a slower +machine, or over a slow phone connection, this might cause a big +communication backlog. The default is roughly one second on a P6/200 +(100000) but can be modified by this command.<p> + + +<a name="operator"></a> +<dt> <strong>operator</strong> <var><n></var> + +<dd> Another command intended for use when <cite>Crafty</cite> is +playing in a tournament, operated by a human. This tells +<cite>Crafty</cite> to "hide" <var><n></var> minutes of time and +not use them. This time is basically allocated to the operator to +make up for the time it takes to type in moves and/or correct +mistakes. At the WMCCC events, the normal value we use is 5. Playing +on a server, this is not needed, as it is not needed if you are +playing <cite>Crafty</cite> yourself.<p> + + +<a name="perf"></a> +<dt> <strong>perf</strong> + +<dd> This command is primarily used in optimizing <cite>Crafty</cite>, +or to test the speed of the move generator and +<code>MakeMove()</code>/<code>UnMakeMove()</code> on different +platforms. It produces two results, the moves it can generate per +second, and the moves is can generate and make/unmake per second. +While this is not a perfect performance indicator, it does give an +"approximation" for how fast <cite>Crafty</cite> might run. In +general, the higher the numbers, the better the program will play, +although machines are certainly different. It's not uncommon to find +a machine that searches slower than another, but has a higher "perf" +value.<p> + + +<a name="perft"></a> +<dt> <strong>perft</strong> <var><depth></var> + +<dd> This command is generally used to confirm that the move generator +and bitmap operators are working properly. It simply takes the +current position, and generates/makes/unmakes moves and counts them. +Many programs use this from a "standard" position to make sure that +their move generator does not miss generating odd moves like +enpassant/promotions and also to confirm that the make/unmake code +correctly updates the board so that the totals remain constant across +different machines and programs, since there is no alpha/beta or +evaluation things done. if <var><depth></var> is greater than 5 +or 6, it will take a *long* time, since this is basically a minimax +tree traversal that will visit *every* node within the +<var><depth></var> search horizon.<p> + + +<a name="pgn"></a> +<dt> <strong>pgn</strong> <var><tag> <value></var> + +<dd> This command is used to set the usual PGN tags to meaningful +values. The recognized tags are <strong>Event</strong>, +<strong>Site</strong>, <strong>Round</strong>, <strong>Date</strong>, +<strong>White</strong>, <strong>WhiteElo</strong>, +<strong>Black</strong>, <strong>BlackElo</strong>, and +<strong>Result</strong>, and the tags *are* case sensitive. The +<var><value></var> can be any valid input and blanks and special +characters are allowed. Note that the date is clearly specified in +the PGN standard and must be yyyy.mm.dd with no variance. Valid +results are <strong>1-0</strong> (White won), <strong>0-1</strong> +(Black won), <strong>1/2-1/2</strong> (drawn) and <strong>*</strong> +(unknown). Some examples: + +<pre><strong> + pgn Event 14th World MicroComputer Chess Championship + pgn Date 1996.10.8 + pgn Site Jakarta, Indonesia + pgn Round 1 + pgn White Crafty + pgn WhiteElo 2400 + pgn Black assassin + pgn BlackElo 2400 + pgn Result 1-0 +</strong></pre> + +Setting these values will result in a proper PGN file when using the +<a href="#savegame"><strong>savegame</strong></a> command. Note that if you +use the <a href="#read"><strong>read</strong></a> command to input a PGN game, +these values will be extracted from that game if they are given.<p> + + + +<a name="ponder"></a> +<dt> <strong>ponder off</strong> | <strong>on</strong> | +<var><move></var> + +<dd> This command serves two purposes. First, it can be used to +disable (<strong>off</strong>) or enable (<strong>on</strong>) +thinking on the opponent's time (or pondering as it is called in many +programs including <cite>Crafty</cite>.) Turning it off will weaken +<cite>Crafty</cite> since it will not use any machine time while +waiting on the opponent to move. It is sometimes useful, however, +when playing <cite>Crafty</cite> against another computer and the +machines are not equal. If <cite>Crafty</cite> is on a faster +machine, and you attempt to adjust for this by giving the opponent +more time than <cite>Crafty</cite>, it doesn't work quite as expected, +because while the opponent is thinking, so is <cite>Crafty</cite>, +which lets it use the extra opponent time in an unexpected way. In +such a case, it's best to stop pondering in both programs. + + <p>If <var><move></var> is given, it directs +<cite>Crafty</cite> to use that <var><move></var> to ponder, +rather than the one from the previous search. Most commonly this is +used to set the right move to ponder after <cite>Crafty</cite> has +been stopped and then restarted, assuming that it is the opponent's +turn to move when this happens. Otherwise, it is probably better to +not try to influence things, although if you are watching and suddenly +wonder "what would <cite>Crafty</cite> do if the opponent plays move +'X'?", you can answer this by simply typing <strong>ponder X</strong> +and then watching the analysis. You should reset the correct ponder +move after you do this of course.<p> + + +<a name="read"></a> +<dt> <strong>read</strong> | <strong>reada</strong> +[<var><filename></var>] + +<dd> This command will read input, and extract the chess moves and +make them to set up the position at the end of the game. It first +resets the chess board to the initial position (read command only) and +then extracts the PGN tags (if present) from the front of the input. +The rest of the input is parsed for chess moves (comments and similar +things are culled automatically) and the moves are made and added to +the game history. Once this is done, you can back up, go forward, or +play from any point in the game. If you specify a +<var><filename></var> everything is read from the file, +otherwise it is read from the console keyboard. + + <p>The <strong>reada</strong> command reads moves, but appends them +to the current game history/position rather than resetting to the +initial chess position. This lets you read in a game, then use reada +to manually add some more moves to see the resulting position.<p> + + + +<a name="reset"></a> +<dt> <strong>reset</strong> <var><n></var> + +<dd> This command lets you back up in the current game to any move of +your choice. <strong>reset</strong> <var><n></var> backs up the +game to move <var><n></var> with the same side on move. If you +want to first change the side to move, use the <a href="#black|white" +><strong>white</strong>|<strong>black</strong></a> command, then use +the <strong>reset</strong> command to back up to the right move. Note +that you can also go forward as well, just so there are moves in the +current game history.<p> + + + +<a name="resign"></a> +<dt> <strong>resign</strong> <var><n></var> + +<dd> This command sets the resign threshold. When running on ICC I +typically use <strong>resign 9</strong> which will make +<cite>Crafty</cite> resign roughly five moves after the score drops +below -9.000. For IM's I change this to 6, and for GM's I often use +3, so that it will resign quicker and not drag a lost game out +unnecessarily.<p> + + +<a name="savegame"></a> +<dt> <strong>savegame</strong> <var><filename></var> + +<dd> This command is used to save the current game in a PGN-compliant +file with the PGN tags included. Note that the default TAG values +might not be what you want if you do not either use the <a +href="#pgn"><strong>pgn</strong></a> command to set them or else input +a valid PGN file with the tags already filled in. + + <p>Be aware that this command doesn't check the filename for +legality since anything goes in UNIX. In DOS, you might produce a bad +filename with either too many characters, too many periods, or +whatever, so be careful with the name you choose. Note also that this +file will be overwritten if it already exists, so be sure to choose a +name that is not the name of a file that has something you consider +important in it.<p> + + + +<a name="savepos"></a> +<dt> <strong>savepos</strong> <var><filename></var> + +<dd> This command writes a single line into +<var><filename></var> in FEN-like notation. This lets you save +a position, and then come back later to re-examine it. You would use +the <a href=#input><strong>input</strong> +<var><filename></var></a> command to input this file and set the +position up.<p> + + + +<a name="search"></a> +<dt> <strong>search</strong> <var><move></var> + +<dd> This command allows you to specify one particular move for the +side on move, and then when you tell <cite>Crafty</cite> to search +this position, this is the only move that will be searched. This is +used internally by the annotate command, but can be used to +investigate one specific move. If the move is not the best move, a +normal search won't show you why it is bad, but this will. It is also +quite a bit faster since the other moves in the position are not +searched at all.<p> + + + +<a name="settc"></a> +<dt> <strong>settc</strong> <var><moves> <ctime> +<otime></var> + +<dd> This command is primarily used in tournaments, and is an +error-recovery command. If the machine crashes and corrupts the game +history file, frequently the operator will have to simply set the +position using the <a href=#setboard"><strong>setboard</strong></a> +command, and then use the <strong>settc</strong> command to restore +the time control values. + + <dl> + + <dt> <var><moves></var> + <dd> is moves until the next time control (from <cite>Crafty</cite>'s +perspective, be careful and don't look at the opponent's moves to time +control by accident.)<dd> + + <dt> <var><ctime></var> + <dd> is minutes left on <cite>Crafty</cite>'s clock, +<var><otime></var> is minutes left on the opponent's clock. + + </dl><p> + + + +<a name="setboard"></a> +<dt> <strong>setboard</strong> <var><FEN input></var> + +<dd> This command is used to set a chess position up for analysis and +is the preferred way to do this, rather than using the gnu <a +href=#edit><strong> edit</strong></a> interface. It uses a classic +Forsythe-like notation to encode the position and also has provisions +for castling status and en passant capture status. + + <p>Standard piece codes p, n, b, r, q, k are used to denote the type +of piece on a square, upper/lower case are used to indicate the color +of the piece (uppercase=white pieces, lowercase=black pieces). + + <p>Pieces are entered from the classic chess diagram's orientation +of a8 being the upper-left-hand corner of the board, and this square +is entered first, followed by the remainder of the 8th rank left to +right. To indicate empty squares, use a number between 1 and 8 to +indicate how many adjacent squares are empty. Use a slash (/) to +terminate each rank after all of the pieces for that rank have been +entered. Note that you do not have to account for all 8 squares on a +given rank, although many test suites do this for clarity. + + <p>The input <strong>k2r/ppp////Q/5PPP/7K/ B</strong> +will setup the board position that is given below: + +<pre><tt> + -k * * -r * * * * + -p -p -p * * * * * + * * * * * * * * + * * * * * * * * + * * * * * * * * + q * * * * * * * + * * * * * p p p + * * * * * * * k * +</tt></pre> + +This assumes that k represents a white king and -q represents a black +queen. + + <p>The field after the final "/" should be either b or w to indicate +which side is "on move." After this side-to-move field any of the +following characters can appear to indicate the following: KQ: White +can castle king-side/queen-side/both; kq: same for Black; a1-h8: +indicates the square occupied by a pawn that can be captured en +passant.<p> + + + +<a name="score"></a> +<dt> <strong>score</strong> + +<dd> This command simply gives the positional score for the current +position. This score is from White's perspective, so a + score is +good for White, a - score is good for Black. <cite>Crafty</cite> also +breaks the score down into major categories (from Evaluate()) to +indicate things like pawn structure, piece evaluation, passed pawns, +development, and so forth. Note that some of <cite>Crafty</cite>'s +evaluation is asymmetric, so that if you simply change sides with the +<a +href="#black|white"><strong>white</strong>/<strong>black</strong></a> +command and then enter "score" again, you may get a different value. +This is *not* a bug. :)<p> + + + +<a name="sd"></a> +<dt> <strong>sd</strong> <var><n></var> + +<dd> This command lets you specify a specific search depth limit that +<cite>Crafty</cite> can not exceed. It still pays attention to the +clock, however, so often you will use the <a +href=#st><strong>st</strong></a> command (below) in conjunction with +this if the search is going to take an extended amount of time. +<var><n></var> is the depth (in plies or 1/2 moves) that the +search must reach. Note that if <cite>Crafty</cite> is pondering, it +still honors this limit and will stop a ponder search after this depth +has been completed as well. This is *not* the way to make +<cite>Crafty</cite> play weaker, although this will be covered in a +later section of this document.<p> + + + +<a name="show"></a> +<dt> <strong>show</strong> <var><category></var> + +<dd> This command forces <cite>Crafty</cite> to display additional +information about certain actions it takes. Currently the only +<var><category></var> is <strong>book</strong> which will make +<cite>Crafty</cite> display information about all the book moves it +found in the database. More is given about this information in the +the <a href="#Opening Book">Opening Book Setup and Usage</a> section +later in this file.<p> + + +<a name="smpmt"></a> +<dt> <strong>smpmt=</strong><var>n</var> + +<dd> This command is used to set the number of threads to use on a +machine with more than one processor. For optimal performance, +"<var>n</var>" should be set to the number of processors you have, +although using fewer will reduce the load on your machine. For this +command to work, <cite>Crafty</cite> must have been compiled with SMP +defined. When compiled with SMP enabled, <strong>mt=0</strong> +effectively disables the SMP code completely. + + <p>This command also has two that are closely related: +<strong>smpmin</strong> and <strong>smpmax</strong>. Both accept +single numerical arguments.<dl> + + + <a name="smpmin"></a> + <dt> <strong>smpmin</strong> + + <dd> is used to control the minimum tree depth required at a node + for it to be eligible for parallel searching. IE <strong>smpmin + 2</strong> says don't split unless at least two more plies are left + to search below this node.<dd + + + <a name="smpmax"></a> + <dt> <strong>smpmax</strong> + + <dd> sets the maximum for the same idea; that is, <strong>smpmax + 10</strong> says don't split if more than 10 plies are remaining + below this node. + + </dl><p> + + + +<a name="sn"></a> +<dt> <strong>sn</strong> <var><n></var> + +<dd> This command is similar to the <a +href="#sd"><strong>sd</strong></a> command, but instead of setting a +specific search depth, it sets a number of nodes to search. Once the +search has searched this number of nodes (+ maybe one more second of +searching to check the time) the search will exit.<p> + + + +<a name="st"></a> +<dt> <strong>st</strong> <var><n></var> + +<dd> This command lets you specify a specific search time limit for +<cite>Crafty</cite>. Again, this is not the preferred way to set a +time per move, because this limit is absolute and <cite>Crafty</cite> +will never go over this limit, even if it sees that it is losing or +getting mated. Setting the time control with the usual <a +href="#time"><strong>time</strong></a> or <a +href="#level"><strong>level</strong></a> command is *much* better. +<var><n></var> is given in seconds, although it may also be +entered as mm:ss if preferred.<p> + + + +<a name="swindle"></a> +<dt> <strong>swindle on</strong>|<strong>off</strong> + +<dd> This command gives you control over "swindle mode." When on, and +playing a game, <cite>Crafty</cite> will try to win drawn endings +(according to the tablebases) if it has winning chances (like KR vs +KB, for example). This will put up very stiff "resistance" to +accepting the draw, while with this mode off, it may be very easy to +draw a position once the tablebases say "drawn." This mode is +automatically turned "off" during <a href="#analyze">analysis</a> or +when <a href="#annotate">annotating</a> a game, and is only used when +actually playing a game against an opponent. If there are <a +href="#egtb">no tablebases</a> then this has no effect on the game at +all.<p> + + + +<a name="tags"></a> +<dt> <strong>tags</strong> + +<dd> This command will simply display the current PGN tags (you can +edit them with the various <a href="#pgn"><strong>pgn</strong></a> +commands).<p> + + + +<a name="test"></a> +<dt> <strong>test</strong> <var><filename></var> [<var>n</var>] + +<dd> This command will run a suite of positions (the file must be in +"<cite>Crafty</cite>" format as explained below) and produce a summary +of how many it got right, wrong, etc. It uses the time per move you +set with the (typically) <strong>st</strong> <var><n></var> +command. The optional parameter [<var>n</var>] is the "early exit" +counter. If <cite>Crafty</cite> finds, and holds the solution move +for n iterations, it will terminate the search. I use this to make a +"<cite>Win at Chess</cite>" run take < 15 minutes, even though the +time per position is set to 1 minute, by setting n to 2. After two +correct iterations, <cite>Crafty</cite> goes on to the next problem. +For absolutely correct results, this is not advisable as it could +obviously change its mind later on, but for performance analysis, this +saves a lot of time. + + <p>The test suite contains the following lines: (this is a sample +from my test suite for <cite>Win At Chess</cite>.) + + <pre> + title wac299 + setboard 1n2rr2/1pk3pp/pNn2p2/2N1p3/8/6P1/PP2PPKP/2RR4 w + solution Nca4 + + title wac300 + setboard b2b1r1k/3R1ppp/4qP2/4p1PQ/4P3/5B2/4N1K1/8 w + solution g6 + + end + + </pre> + + <ul> + + <li> The <strong>title</strong> command simply displays this message + in the log file so you can look at the output and figure out which + position it goes with. This is optional, but useful. + + <li> The <strong>setboard</strong> command sets the position as + explained above. + + <li> The <strong>solution</strong> command gives the set of solution + moves (one or more moves that are separated by blanks) and/or a set + of "anti-solution" moves (moves that must not be played to + count the position as correct.) "anti-solution" moves are + simply followed by a "?" character, for example: + + <center><strong> solution Bxa7?</strong></center> + <center> </center> + + <p>The <strong>solution</strong> command supplies a set of key moves, and + then starts the search. If, after the search terminates, one of the + key solution moves was chosen (or none of the anti-solution moves + were chosen) the position is counted as correct. + + <li> The final line should be <strong>end</strong> although + end-of-file or EOF will also be detected in this case.</ul><p> + + + +<a name="time"></a> +<dt> <strong>time + CPU</strong> | <strong>elapsed</strong> | <var><values></var> + +<dd> In the forms <strong>time CPU</strong> and <strong>time +elapsed</strong>, this command controls whether the program uses CPU +time or wall-clock time for timing. For tournament play, it is safer +to use wall-clock timing. For testing it may be more consistent to +use CPU timing if the machine is used for other things concurrently +with the tests being run. + + <p>The form <strong>time</strong> <var><values></var> is used +to set the basic search timing controls. The general form of the +command is as follows: + + <center><strong>time</strong> + <var>nmoves</var> <strong>/</strong> <var>ntime</var> + [<strong>/</strong> <var>nmoves</var> <strong>/</strong> + <var>ntime</var>] + [<strong>/</strong> <var>increment</var>]</center> + +<ul> + +<li> <var>nmoves</var><strong>/</strong><var>ntime</var> represents a +traditional first time control when nmoves is an integer representing +the number of moves and ntime is the total time allowed for these +moves. + +<li> the optional +[<var>nmoves</var><strong>/</strong><var>ntime</var>] is a traditional +secondary time control. + +<li> <var>increment</var> is a feature related to ICS play and +emulates the Fischer clock where <var><increment></var> is added +to the time left after each move is made. + +</ul> + + <p>Instead of an integer, nmoves can be <strong>sd</strong> which +represents a sudden death time control of the remainder of the game +played in ntime. The optional secondary time control can be a +sudden-death time control, as in the following example: + + <center><strong>time 60/30/sd/30</strong>;</center> + +this sets 60 moves in 30 minutes, then game in 30 additional +minutes. An increment can be added if desired. + + <p>One final example is the following: + + <center><strong>time sd/15</strong></center> + +which is a simple game/15 setting. This command can also be used to +perform the same function as the "level" command. For example, to set +up a classic ICS 2 12 game, the following would would work: + + <center><strong>time sd/2/12</strong>.</center> +<p> + + +<a name="trace"></a> +<dt> <strong>trace</strong> <var><n></var> + +<dd> This command is used to make <cite>Crafty</cite> display the tree as it +searches a position. Due to the incredible speed at which this +program can search, however, this is less than useful since it can +swamp any known display driver and make things scroll impossibly fast. + + <p>Also note that this command usually is disabled, because +<cite>Crafty</cite> is generally compiled with the -DFAST flag, which +removes the trace output code from the search to make things slightly +faster. You will have to recompile, without the -DFAST, if you want +to use this. Its utility is limited, except for debugging, anyway.<p> + + +<a name="usage"></a> +<dt> <strong>usage</strong> <var><n></var> + +<dd> is simply a way to modify <cite>Crafty</cite>'s time usage to fit +your tastes. You can "suggest" a time limit with any of the options +discussed previously, but if you use anything other than the <a +href="#st"><strong>st</strong></a> command, <cite>Crafty</cite> will +do its best to use time as you suggest, but it also anticipates that +it will save some time by pondering, etc., and will therefore be more +aggressive at trying to use time. If <var><n></var> is a +positive integer, it is taken as a percentage and <cite>Crafty</cite> +will compute the time limit it thinks is appropriate for the current +clock settings, then increase this limit by this percentage (50 would +make it take 1.5 times longer than normal.) -50 would make it take +1/2 the time it would normally take. + + <p><cite>Crafty</cite> adjusts the usage internally based on time +left, opponent's time left, how quickly or slowly the opponent is +moving, etc. Further modifying things with this is dangerous, but +possible.<p> + + + +<a name="whisper/kibitz"></a> +<dt> <strong>whisper/kibitz</strong> <var><n></var> + +<dd> These commands are used to control what <cite>Crafty</cite> will +whisper or kibitz on a chess server. The options are (1) only +whispers or kibitzes mate announcements; (2) adds time, score, depth +to the previous option, but no PV or moves. (3) adds the PV. (4) +adds book move information to the output. The remaining two options +generate a lot of output and should be used with caution. (5) +displays the PV after each iteration completes. I use this when using +my custom interface to let <cite>Crafty</cite> observe/comment on +games in progress on ICC. Noise can be used to prevent shallow +searches from generating output and keeping "noise" down on the games +being watched. (6) basically will whisper/kibitz nearly everything +you see on the console from a search, each PV when it changes, fail +highs and fail lows, etc. A significant amount of output that should +be carefully weighed before turning it "loose."<p> + + + +<a name="xboard"></a> +<dt> <strong>xboard</strong> + +<dd> This command turns on <cite>Xboard</cite>/<cite>WinBoard</cite> +compatibility mode, and makes <cite>Crafty</cite> behave somewhat like +GnuChess. This is designed to be used *only* when <cite>Crafty</cite> +is interfacing with <cite>Xboard</cite>/<cite>WinBoard</cite>. +<cite>Crafty</cite> will not work with these two GUIs without this +option, and really won't work very well with this option if it is not +connected to one of them.<p> + + +</dl> + +There are other commands that are not documented. They are part of +the xboard protocol and really should not be used by the normal user. +You can find all the commands in option.c should you be interested. + + + + +<hr> +<a name="Opening Book"></a> +<h2>Opening Book Setup and Usage</h2> + +<cite>Crafty</cite> uses two pre-compiled opening books, called +"<code>book.bin</code>" and "<code>books.bin</code>". + + <p>The file <code>book.bin</code> is usually build from a large text +file containing PGN games, often taken from collections of GM games. +Building <code>book.bin</code> is a simple exercise and requires +nothing other than the raw input file you are going to use. Generally +this will be either <code>medium.zip</code> or the set of four files +<code>large</code>[1-4].<code>zip</code>, all of which are stored on +the web site <a +href="http://www.cis.uab.edu/hyatt/crafty">www.cis.uab.edu/hyatt/crafty</a>. + + <p>To create the file <code>book.bin</code>, you need a PGN game +collection that is a *real* PGN-compliant file. Supposing this file +is called "large.pgn" you would use the following command: + +<center><strong>book create large.pgn</strong> <var><m></var> +[<var>n</var>] [<var>wpct</var>]</center> + + <p>The only thing you have to supply is <var><m></var>, +a number indicating how many moves from each game are to be stored in +the book.bin database. I typically use 60, which stores the first 60 +moves from each game. Increasing this number slightly increases the +probability that <cite>Crafty</cite> will stay in book longer, but it also +increases the probability that it will follow a game too far, so that +it begins to reach positions where the move actually played might not +be the best move, letting it fall into a bad hole. Increasing this +also increases the size of the database as well. + + <p>You can decrease the size of the book, and also reduce the number +of ugly moves by specifying [<var>n</var>], which says that unless a +move is played in at least <var>n</var> games, the move is discarded. +This will substantially decrease the size of the book.bin file, and +also eliminate single game moves that often have significant errors or +blunders. + + <p>You can increase the quality of book lines by specifying +<var>wpct</var> which is the "winning percentage". This is specified +as a percentage of lost games, and is used to discard moves that led +to mostly losses. A safe value is 50, which says that if a particular +opening move didn't win at least 50% as many games as it lost, the +move is culled. A value of 100 would mean that moves are culled if +they produced more losses than wins, and is really a strict criterion. + + <p>After creating <code>book.bin</code>, you need to create +<code>books.bin</code>. This is a small version of +<code>book.bin</code>, which is intended to give you more control over +the moves/openings <cite>Crafty</cite> will play. This is usually +built from the file <code>start.pgn</code> on the web site, but you +can modify this file to suit your taste easily. To build +<code>books.bin</code>, you use the following command: + + <center><strong>books create start.pgn 60</strong></center> + + <p>Again, 60 is what I use, but none of my <code>start.pgn</code> +lines go anywhere near that many moves. The main point here is that +in <code>start.pgn</code>, you can append a "!" to any move you want, +and when it is <cite>Crafty</cite>'s turn to move for that color, it +will play from the set of moves with "!" if there are any, ignoring +the rest of the book moves. If you only want it to play 1. e4 as +White, you would just enter the short game: + + <center><strong>[Crafty only plays 1. e4] + 1. e4!</strong></center> + + <p>and you are finished! You can enter as many as you want. If on +the other hand there is a move you don't want <cite>Crafty</cite> to +play, then follow that move with a "?" and it will never play it. +Moves in <code>books.bin</code> that are not flagged with ! or ? don't +have any influence on <cite>Crafty</cite>'s choice at all. + + <p>Here's how the files are used. When searching a position, +<cite>Crafty</cite> first enumerates the set of moves it can find in +the opening database. It then does the same for the +<code>books.bin</code> database, and performs a "merge" operation to +combine the ? and ! flags... The purpose of the +<code>books.bin</code> file is to give you a small database that you +can easily modify, rebuild, and repeat this process over and over. +Since it takes a fraction of a second to completely rebuild this file, +it is very easy to modify this to control what <cite>Crafty</cite> +will play, without having to rebuild the large database. + + <p>One important characteristic of the PGN input is the Result tag +must be specified in most of the lines, because <cite>Crafty</cite> +counts wins, losses and draws for each book move and uses these counts +with some of the book selection options given below. + + + +<h3>How the flags are used.</h3> + +The ! and ? flags should only appear in the small +<code>books.bin</code> file, although there is no reason why they can +not appear in the large file as well. For this discussion, it doesn't +matter since <cite>Crafty</cite> takes the moves from both files and +"merges" the flags, etc., into one entry for each move. + + <p>Quite simply, if any book legal book move has a ! flag, then +<cite>Crafty</cite> will only play moves from the set of moves which +all have the ! flag. If a move has a ? flag, then that move is +immediately removed from the set of possible book moves. If the only +legal book move has a ? flag, it will not be played as a book move and +<cite>Crafty</cite> will simply pretend that it found no book moves +and will execute a normal tree search. Pretty simple. + + +<h3> +How to control the frequency of opening move selection.</h3> + +A new feature in version 15.15 and beyond allows you to append a PGN +comment to any move in a text file used to create +<code>books.bin</code>, of the form <strong>{play</strong> +<var>nn</var><strong>%}</strong>. This will force the move it follows +to be played that percentage of the time, regardless of the normal +book-ordering values based on frequency and so forth. + + <p>Note that <strong>{play 0%}</strong> will not prevent a move from +being played at all, as this will look just like a move with no +percent specified. To avoid playing a move, use the ? flag. + + +<h3> +How does <cite>Crafty</cite> choose book moves?</h3> + +<cite>Crafty</cite>'s book selection algorithm depends on two +user-defined values that can be set at any time during a game: + +<center><strong>book random</strong> <var><n></var></center> + +<center><strong>book width</strong><var> <w></var></center> + + <p>The selection algorithm first finds the set of legal book moves +as above. This set will either be all ! moves, or will have no ! +moves in it. This set is then sorted based on the setting of book +random. Here's the options: + + <p><strong>book random 0</strong>. This is a special case for book +selection. <cite>Crafty</cite> simply takes the set of book moves, +and searches only these moves using a normal alpha/beta search, but +with a shorter than usual time limit. It then plays the move that +produces the best search value. This has one serious disadvantage in +that there is no randomness to this at all. It will always play the +same move in the same position, unless the evaluation is modified, or +the time per move is different enough to let the search find a +different move from the book move set. + + <p><strong>book random 1</strong>. This enables a random form of +book move selection, but you have a lot of control over how moves are +randomly chosen. The moves are ordered, based on 4 parameters: +frequency of play, win/lose ratio, static evaluation and learned +results. Normally these are factored into the value used to sort the +moves, based on default settings that you can modify by using the +command <strong>bookw</strong> <var><option> <N></var>, +where <var><option></var> should be "freq", "ratio", "eval" or +"learn". <var><N></var> should be a number between 0 and 1. + + <p><cite>Crafty</cite> finds the min and max values for each of the +4 parameters, and then maps this into the range 0-1000 for each +parameter. Each parameter is multiplied by the corresponding "weight" +you have assigned, and this is used as a value to sort the moves from +low to high. Note that the first sort value is always the "play +percent" to move them to the top of the list. For moves with equal +"play percent" values, the normal sort-value is used as the +second-level sort variable (if no moves have a play-percent, then this +second-level variable is the only one used, of course.) + + <p>Once <cite>Crafty</cite> has sorted the moves as given above, it +next excludes any book moves which have 0 wins. This culls the odd +lines where a player chose a bad line and lost quickly. With zero +wins, it will never be chosen, although <cite>Crafty</cite> will +happily follow it from the other side. :) This is not anywhere near +perfect, however, because an opening could have 1 win and 19 losses +and that still would stay in the list. + + <p>If a move has a learned value of > 100, this move is elevated +in priority to that of a ! move, since it appears to win material +instantly. If a value is < -100, it is given a ? since it appears +to be a lemon. + + <p>After this, the setting for <strong>book width</strong> +<var><w></var> is used to keep the first +<var><w></var> moves in the list, after the above culling +has been completed. The smaller you make <var><w></var> +the less randomness you get, but the chance of <cite>Crafty</cite> +popping out a really bizarre book move gets smaller as well. + + <p>After sorting, the final step is to fold in any mandatory "play +percent" values. What this step does is that it finds all the moves +in the "playable move set" just computed, which have no +percent-to-play value set. It sums the sort-values for these moves, +then adjusts the sort-values for the other moves so that their +percentages will be honored. + + <p>Once this has been done, <cite>Crafty</cite> simply uses the +"sort value" for each move to compute a total for all moves. It then +generates a random number between 1 and this limit, and chooses the +move that this probability distribution matches. This will certainly +evolve over time as new ideas are developed. + + <p>For my play on ICC, I use <strong>book random 1</strong>, and +<strong>book width 5</strong> normally, although for titled players +this is reduced to <strong>book width 3</strong>. For computers, I +reduce this further to <strong>2</strong>, to try to play reasonable +openings and cull the gambits and things that don't work out. + + +<h3> How does book learning work and how can I share learned +results?</h3> + + <p>1. *All* of <cite>Crafty</cite>'s "learned knowledge" is in the +<code>book.bin</code> file. It keeps the learned value and learned +count right in the book file for speed. You can't modify it, although +<a href="#show"><strong>show book</strong></a> will make +<cite>Crafty</cite> display all the book stuff before it makes a move. + + <p>2. the <code>book.lrn</code> file has two purposes: (a) to +serve as a log for your prying eyes, so you can see what it's learned, +against whom, and what the score was that got its attention in the +first place. The values on the end of each book line, inside the {} +characters are as follows: + +<center>{value, depth, rating_difference}</center> + +<dl> + +<dt> <strong>value</strong> is the value of the "key" search that +comes from the first 10 moves out of book. It's in centipawns, and + +is good - is bad.<dd> + +<dt> <strong>depth</strong> is the depth the search reached at this "key" +position, the deeper the search, the more the value is "trusted."<dd> + +<dt> <strong>rating_difference</strong> is <cite>Crafty</cite>'s +rating - opponent's rating a negative value means pay more attention +to the score since the opponent is better than <cite>Crafty</cite>, a +positive value means to take the score with a grain of salt, because +the opponent was weaker than <cite>Crafty</cite>.<dd></dl> + + + <p>You can delete this file at any time, and it has no effect on +learning. As I mentioned, the learning takes place in +<code>book.bin</code>... this is mainly for you to peek at if you are +interested. However, this is the "portable learning data file" also, +and can be given to others to import into their <cite>Crafty</cite>, +where it will affect the opening book just like their +<cite>Crafty</cite> had played the openings and got the same scores. +There are two ways to use such "lrn" files: + + <p>1. <a href="#import"><strong>import</strong></a> +<strong><filename></strong> will read <filename> and +import the knowledge therein into your book.bin. Since I use the same +learning code as is used when playing games, this information also +gets appended to *your* <code>book.lrn</code> file as well, so that +your <code>book.lrn</code> always reflects *everything* your program +has learned, so long as you don't ever remove this file. It would be +a mistake to use this command on your own book.lrn file, because the +things would get counted twice, which might or might not be a good +thing. + + <p>2. <a href="#import"<strong>import</strong></a> +<strong><filename> clear</strong> will read <filename) and +import the knowledge as above, but first clears *all* learned results +from book.bin. you will want to do this if you import my book.lrn, +*and*, you have contributed to my book.lrn data by sending me yours. +I'll take care of eliminating duplicates if you screw up in what you +send me, but once you send me something, you run the risk of getting +it "back again" later. This is going to be a problem until everyone +gets used to sharing something that is rather "vapid" like this +"learned info" is... + + <p>Other than that, we are now "open for business"... when the urge +strikes you, email me your .lrn file, I'll keep a large master here +and update it on occasion. Probably the best thing to do is to send +me your .lrn and at the same *instant* delete yours. This will +capture anything learned *after* you send me the file, but you'll get +it all right back with the next version of book.lrn that I +distribute. + + <p>After getting this new book.lrn back, here's what you should +do: + + <p>1. rename your old <code>book.lrn</code> to something else. +I'll call it "book.lrn.old" here. + + <p>2. copy my blearn.dat to your machine, but *do not* put it in +the directory with your <code>book.bin</code> and +<code>books.bin</code> file because it will get confusing very quickly +if you do. Put it somewhere else, because you are going to remove it +quickly anyway. I'll call it new.lrn for this example. + + <p>3.<pre><strong> + import new.lrn clear + import book.lrn.old</strong></pre> + +and you are ready to rumble again. The first command clears the +learned values, sucks in my new learn file and updates everything. +the second command re-learns everything you've learned since you sent +me the last book.lrn file. After doing this your book.lrn will have +my .lrn stuff, plus your old.lrn stuff, just waiting to be sent to me +again... + + <p>If this is confusing, I can probably add an automatic command to +do all of this by renaming book.lrn, etc. Hopefully this is not too +error-prone for the time being anyway... + + +<h3> +What is this new Position Learning I've heard about?</h3> + +<cite>Crafty</cite> now has a "permanent" hash table that is kept from +game to game. A position gets into this "hash file" when +<cite>Crafty</cite> executes a search and the search value is +significantly lower than the last search value. + + <p>When this happens, <cite>Crafty</cite> stores the current +information for this position in the permanent hash file, which can +hold up to 65536 positions. Once it fills up, the positions are +replaced on a FIFO basis, always keeping the most recent 64K entries. + + <p>Each time <cite>Crafty</cite> starts a search, the +positions/scores from this file are stuffed into the normal +transposition table, and used during the search just like any other +table entry. Here's how it helps: In a game that was played, the +following moves and scores were found by <cite>Crafty</cite> (playing +White): + + <p>1. Ng5 (+.277) h6 2. Nh7 (+.321) Kg8 3. Qh5 (+.133) Qg7 4. Ng5 +(-2.122) hxg5 + + <p>So, the knight got trapped at h7, and at move 4 +<cite>Crafty</cite> discovered that this is gross and "learns" this +result/position. + + <p>We play the exact same game again: except that two things can +happen here. + + <p>1. It might be that g5 is the *only* square the knight can move +to here, which means this whole thing is forced. The first search +would find 1. Ng5 (-2.122) if the search can reach 8 plies deep, which +happens even in 5 second games. It's learned that Ng5 is bad. It +stores *this* position in the permanent hash file also, and the next +time you try this same trap, it will discover 4-5 moves earlier that +if the knight gets to g5 it is in trouble. Each game will diverge +from the first game 3-4 moves earlier. Simple and effective. + + <p>2. Ng5 might not be forced, and if not, it knows Ng5 loses a +piece for a pawn, so it will promptly play something else, which is +exactly what is desired. + + <p>This is implemented with two (count 'em, two) files. One file +"<code>position.bin</code>" is a binary file that contains the hash +table entries, and it right at one megabyte in size, *max*. (16 bytes +per hash entry X 65536 entries = exactly one meg, but I have 8 extra +bytes for the FIFO queue implementation and to see how many entries +are currently in the file if it is not full. + + <p>The second file is "<code>position.lrn</code>" and is, you +guessed it, a file that can be shared with others, just like book.lrn. +It contains all information needed to reconstruct the position, the +score, the depth, etc. and also included the pgn tags for who was +what color and when the game was played... + + <p>This data can be imported with the new <a +href="#import"><strong>import</strong></a> command (the old book learn +<filename> is no longer around) which will import either +book.lrn type data or position.lrn type data and can tell them apart +without your having to do anything. The [<strong>clear</strong>] +option is still there, should you want to use it, and simply removes +the position.lrn and position.bin files before starting the import +process for position learning. + + <p>This can be turned off, if you like, by checking out the <a +href="#learn"><strong>learn</strong></a> command, which gives you the +ability to turn off book learning (as it presently works), position +learning, and the next book learning stage which will add to the book +in addition to learning which book lines are good and bad. + + +<h3> +What is this new "result" learning?</h3> + +Result learning works just like normal book learning, except +that if <cite>Crafty</cite> is checkmated or resigns, it will step back +through the book line to find the last point where it had +more than one move to choose from. It will flag the move it +chose as "never play again". + + <p>This handles the case where the first ten non-book moves produce +reasonable scores, but the position is one that <cite>Crafty</cite> +simply can't handle very well. If it loses such a game, it will still +vary the next time this opening is played, as otherwise it would +possibly repeat the same opening, and would certainly repeat the +remainder of the game. + + <p>All three learning modes are turned on by default, although any +of them can be disabled with the appropriate command option to <a +href="#learn"><strong>learn</strong></a>. + + +<hr> +<address></address> +<!-- hhmts start --> Last modified: Sat Dec 20 01:41:05 EST 2003 <!-- hhmts end --> +</body> </html> diff --git a/crafty.faq b/crafty.faq new file mode 100644 index 000000000000..e362b036ac43 --- /dev/null +++ b/crafty.faq @@ -0,0 +1,244 @@ +Frequently asked questions (FAQ) on Crafty. +Last modified on 1996.06.17 +Send corrections/additions/comments to: +Anil Mungal (amungal@vnet.ibm.com) + +----- +[1] What is Crafty? +[1.1] What platforms can Crafty run on? +[1.2] What is Crafty's rating/strength? +[1.3] Where can I get Crafty? +[1.4] How do I build Crafty? +[1.5] How do I build Crafty's Book? +[1.6] How can I maximize Crafty's performance? +[1.7] What are "tablebases" and how do I use 'em? +[1.8] How can I get a graphical interface with Crafty? +[1.9] How can I use both Crafty and XBoard to analyze positions/games? +----- +[1] What is Crafty? + +Crafty is a chess program written by Bob Hyatt (hyatt@cis.uab.edu). +It is modeled after Cray Blitz (also written by Bob). + +Crafty has the following features: +- written in C +- can be compiled with the GNU C compiler on various platforms +- has a customizable opening book +- supports tablebases (Steven Edward's endgame database) +- text interface + +Crafty is a work in progress, and is frequently updated/enhanced by Bob. +----- +[1.1] What platforms can Crafty run on? + +The decision to write Crafty so that it compiles with the GNU C compiler +allows it to run on many platforms without the hassle of porting. +(Thanks Bob) + +Currently Crafty runs on: + +- DEC alpha running OSF/1-Digital Unix +- any Cray-1 compatible architecture including XMP, YMP, C90, etc. +- HP workstation running HP_UX operating system (unix) +- PC running DOS, Windows, or OS/2 Warp, using DJGPP port of gcc to compile +- RS/6000 running AIX (unix) +- Sun SparcStation running Solaris (SYSV/R4) Unix +- Sun SparcStation running SunOX (BSD) Unix +- Any architecture running the Linux operating system +- Microsoft Win95/WinNT, when compiled with Microsoft Visual C++ +- Macintosh and other MacOS-compatible computers + +Storage requirements range from 1Mb (small book and no tablebase) to 60Mb +(largest book and no tablebases) to 300Mb (largest book and all tablebases). +----- +[1.2] What is Crafty's rating/strength? + +Crafty's strength is directly dependant upon processor speed, hash table size, +size and content of it's opening book, and it's use of an endgame database. +Versions of Crafty running on ICC and FICS have ratings around 2500-2700. +This does not necessarily mean that Crafty will perform at this level +under tournament conditions. + +Crafty's computational power in nodes/sec has been measured as follows: + + Platform Nodes/sec + -------- --------- + DEC alpha running OSF/1-Digital Unix 75,000 + Cray-1 XMP, YMP, C90, etc. ?????? + HP workstation running HP_UX operating system 35,000 + 80X86 architecture running LINUX (unix) 30,000 (P5/133) + Pentium 100 PC 24,000 + Pentium Pro 200 PC 75,000 + RS/6000 running AIX (unix) ?????? + Sun SparcStation running Solaris (SYSV/R4) Unix 30,000 (Sparc-20) + +According to the Louget Chess test, Crafty has been given the following ratings: + + Platform Hash table Louget rating (comparable to FIDE rating) + ======== ========== ============= +Crafty v9.21 PP200 56 MB 2395 +Crafty v9.21 PP150 56 MB 2365 +Crafty v9.21 P133 14 MB 2305 +Crafty v9.21 P90 7 MB 2235 + +Where the platforms were: +PP200 = Pentium Pro 200 Mhz, 16+256KB internal caches, Aurora Intel motherboard +PP150 = Pentium Pro 150 Mhz, 16+256KB internal caches, Asustek motherboard +P133 = Pentium 133 Mhz, 256 KB pipeline burst synchronous L2 cache +P90 = Pentium 90 Mhz, 256 KB asynchronous cache (Intel Zappa, Triton Chipset) + +For more info on the Louget Chess test, you can contact: +Frederic Louguet (louguet@worldnet.net) +---- +[1.3] Where can I get Crafty? + +You can get Crafty by anonymous FTP at: ftp://news.cis.uab.edu/pub/hyatt + +Here is a description of the files that you will probably see. + +read.me : Read me file that Bob updates +crafty.exe : PC DOS executable. (needs DPMI) +craftyt.exe : PC DOS executable with tablebases support. (needs DPMI) +crafty.faq : this file +crafty.linux : Linux executable +crafty.sun : Sun Sparc-20 executable +crafty.zip : Crafty source code +crafty.tar.Z : Crafty source code +crafty.tar.gz : Crafty source code +cwsdpmi.exe : DPMI provider +large1.zip : Large PGN file used to create an opening book (1/4) +large2.zip : Large PGN file used to create an opening book (2/4) +large3.zip : Large PGN file used to create an opening book (3/4) +large4.zip : Large PGN file used to create an opening book (4/4) +medium.zip : Medium PGN file used to create an opening book +small.zip : Small PGN file used to create an opening book +start.zip : Tiny PGN file used to create an opening book +probs.Z : A test suite of chess problems +wcrafty.exe : Windows executable. +wcraftyt.exe : Windows executable with tablebases support. + +The Macintosh port of Crafty is available from <ftp://ftp.limunltd.com/crafty/>. +The Mac versions are supported from <http://www.limunltd.com/crafty/>. + +----- +[1.4] How do I build Crafty? + +If you wish to build Crafty for yourself, you need a copy of the source +and the GNU C compiler (or the djgpp compiler for DOS) to compile. + + a) Unzip/uncompress the source code. + + b) Follow the instructions in the Makefile. You will probably have to: + - comment/uncomment sections based on your hardware platform. + - edit the directory paths. + - add whatever optimization flags that you want. + + c) type make + +----- +[1.5] How do I build Crafty's Book? + +You need an executable version of Crafty and a PGN file to build it's book. +Choose between large (unzip large1.zip, large2.zip, large3.zip, large4.zip +and append them into one file), medium (unzip medium.zip), or small.zip +(unzip small.zip). +Large produces a 90Mb-60Mb opening database with 100K GM games; medium produces +a 30Mb database, and small will produce a 1Mb database. Note that you will +need at least double this space to create the files, since temporary files +are written to disk, and then later deleted. Use the following commands to +build the book: + + crafty + book create <filename> 60 + quit + +<filename> should be replaced by the PGN filename that is created when you unzip +the book file of your choice. + +Start.zip contains a small file that is used to create books.bin. +books.bin is created as follows: + + crafty + books create start.pgn 60 + quit + +This file contains suggested openings that fit Crafty's "open" style of +play better. You can edit/modify this at will, and it takes a fraction of +a second to re-build after modification, so the big book file can be left +alone. + +Note that the "60" is arbitrary, and is used to cut book lines off at roughly +60 plies. You "can" say 500, so that the entire games will be stored, +but you need even more disk space. You can also reduce this number to 30 +(15 moves for each side) to conserve disk space as needed, since the book +will contain far fewer positions. +----- +[1.6] How can I maximize Crafty's performance? + + a) Compile with different combinations of the following options: + -DCOMPACT_ATTACKS, and -DUSE_SPLIT_SHIFTS. Then check the performance + of Crafty. The best test is to simply let it search to a fixed depth + (say sd=8 for example) from the opening position and pick the compiler + /optimizer options that minimize this time. Pick SD=n so that the search + takes at least 2 minutes. + + b) Increase the size of hash and hashp based on the following + observations: + - hash is more important that hashp. the only guidance is that + you don't want to make hash so large things slow down due to + excessive paging or swapping. + - there's a compile option -DFAST. if you use this, crafty won't + report any hashing statistics, making it harder to decide when + to make things bigger. +----- +[1.7] What are tablebases and how do I use 'em? + +tablebases are endgame databases distributed freely by Steven Edwards +(sje@mv.mv.com). If you are downloading an executable, for dos you'll +want craftyt.exe, and for Win95/WinNT, you'll want wcraftyt.exe. If +you compile your own, -DTABLEBASES will do the trick. + +Once you have an executable that expects tablebases, you typically +put them in a sub-directory TB that should be in the directory where +you normally run crafty. You can change this by editing the Makefile +and changing TBDIR to point to where you want 'em. + +Next, you need the tablebase files. These are available from ftp.onenet.net +and other ftp sites. The files are named like this: KBNK.tbb and KBNK.tbw +for the KBN vs K tablebases. On some ftp machines the "." is replaced by a +"_". after downloading them, rename them to replace the _ by . or crafty +will not recognize them. These files are also available from the primary +Crafty site ftp.cis.uab/edu/pub/hyatt/TB. + +The complete set takes about 260Mb, for all 4-man endings. We are working +on new ones for frequently encountered endings like KRP vs KR. These will +be made available as they are completed. There are 10 5-piece files now +available, KRPKR, KRNKR, KRBKR, KRRKR and KQRKR, where each has a .tbb +and .tbw pair. These files require about 500mb zipped, but will expand +to about 2.3 gigabytes when unzipped. So be prepared for a large disk +space requirement. + +Note that these databases are "mate in n" type databases, so you'll see +some interesting mate announcements from Crafty, with Mate in 30 a very +common occurrence. :) +----- +[1.8] How can I get a graphical interface with Crafty? + +On Unix systems, you can use XBoard with Crafty. On Windows systems, you +can use WinBoard. For more information on XBoard and WinBoard, check out: +http://www.research.digital.com/SRC/personal/Tim_Mann/chess.html +----- +[1.9] How can I use both Crafty and XBoard to analyze positions/games? + +It is now possible to use XBoard and Crafty together to perform +interactive analysis of positions and stored (PGN, etc.) games. + +To do this, you need a recent version of Crafty (12.3 or up) and +xboard/winboard version 3.6.1 or later. + +For instructions, see the winboard/xboard faq, which explains how to use +this powerful and interesting facility. +----- +** End of Crafty FAQ ** + + diff --git a/crafty.rc b/crafty.rc new file mode 100644 index 000000000000..f2bf40e753e8 --- /dev/null +++ b/crafty.rc @@ -0,0 +1,36 @@ +# Example file for craftyrc +# Copy it to $HOME/.craftyrc +# Read /usr/share/doc/packages/crafty/crafty.doc.ascii for more information + +# Increases Crafty's position hash to 256MB +hash=256m + +# Increases Crafty's pawn hash to 64MB +hashp=64m + +# If you want to use your own books create a directory $HOME/.crafty , +# set this path accordingly to "/home/your_user_name/.crafty" +# and copy your own book-files (book.bin, books.bin and bookc.bin) into that directory +bookpath=/usr/share/crafty +show book + +# Tells Crafty to use syzygy Endgame Tables +egtb +tbpath=/usr/share/crafty/TB + +# Disable logging, if you want crafty to log your games, set this to "on" +log=off + +# Allows Crafty to try to win drawn games (according to Endgame Tables) +swindle on + +# Allows Crafty to think on your time +ponder on + +# Increases Crafty's Endgame Table Cache to 32MB +cache=32m + +# Increases Crafty's MaxThreads to total number of CPU cores +mt=4 +exit + diff --git a/readme b/readme new file mode 100644 index 000000000000..ca9909806bb2 --- /dev/null +++ b/readme @@ -0,0 +1,95 @@ +Crafty Chess (version 18) +========================= + +crafty can use a startup file in the users HOME for its configuration, which is +~/.craftyrc. Likewise, it can use a subdirectory in the users HOME to store its +data. This can be ~/.crafty/ but it is configurable. + +So, if your want to customize crafty to your needs you can do the following: + +Copy the file /etc/crafty.rc to ~/.craftyrc and modify it according to the +comments inside the file. The endgame tablebase lookup is enabled. If you don't +like that, just remove the "egtb" line. + +Similarly, a ~/.crafty/ directory can be created. Then copy the opening books +book.bin, bookc.bin and books.bin from /usr/share/crafty/ to ~/.crafty/. + +The opening books and endgame tablebases that come with this package are +fairly basic. To make full use of crafty's capabilities you should get +larger versions from crafty's site (ftp://ftp.cis.uab.edu/pub/hyatt or +http://www.cis.uab.edu/hyatt/crafty/). +Please have a look at the documentation on how to do this. + +What is here? +============= + +The following directories exist: + +book binary book files for Crafty. At the least, + you need a book.bin. Most likely you will want + a books.bin and bookc.bin (the crafty documentation + explains their purpose). +documentation Documentation files. There is a postscript version (.ps), + a pure ASCII version (.ascii) and a groff version that + can be used to produce any sort of output file you want. +executables these are executable files, that should run on + most any processor around. You can often compile the + source yourself and optimize it for your specific hardware + to get a faster executable. +pgn PGN files that can be used to produce a larger or smaller + book.bin. Beware as "enormous.pgn" is just that. :) +source Here you will find all the source files. Note that + version 20.11 is more recent than version 20.8. The + xx.y version is set so that larger y is more current, not + treating it as a decimal number. +TB 3-4-5 piece endgame databases (Nalimov format) +wccc.2005 log files from the 2005 WCCC tournament produced by Crafty + on the 8-cpu Opteron box. +wccc.2006 log files from the 2006 WCCC tournament produced by Crafty + on the 8-cpu Opteron box. + +What do I need to download? +=========================== + +1. You need a copy of the documentation. While crafty is easy to run, and +has some built-in help facilities, the documentation will help you learn how +to use all the features the program has. + +2. You need a copy of Crafty. Source is the best bet, but if you don't feel +comfortable compiling your own executable, look in the executables directory and +grab the version you want. Note that even if you choose to download a ready- +to-run version, downloading the source to go with it is a good idea as that will +get you the "audio" stuff if you want crafty to verbally announce moves, etc. + +3. You need at least a book.bin file from the book directory. If you are going +to play computer vs computer matches, you will want a bookc.bin, and the +books.bin is useful to prevent it from playing ridiculous openings. + +4. You may or may not want to download the 3-4-5 piece endgame tables. They +total to about 7.5 gigabytes of storage, so they require a lot of disk space +as well as download bandwidth. + +Put everything in one directory, except for the endgame tables (if you download +them) which should be put in a sub-directory named "TB" (until you learn how to +put them somewhere else by reading over the crafty.doc information). + +You are set. + +Which version do I download? +============================ + +Currently 20.x is the most recent, and it is certainly the strongest Crafty +version to date. The highest .x number is the most current, and should be the +best, but on occasion this is not the case due to bugs. + +What's next? +============ + +Read through the crafty.doc information. It explains everything from how to +create custom books, to using multiple-CPU machines, and so forth. Then join +the crafty mailing list (crafty-list@cis.uab.edu) and participate in the +discussions there, get your questions answered, and so forth. + +see you there. + + diff --git a/tournament.howto b/tournament.howto new file mode 100644 index 000000000000..cd2f76b2410e --- /dev/null +++ b/tournament.howto @@ -0,0 +1,187 @@ +[tournament] +playing in a manually-operated tournament + +1. Starting Crafty. This is the easiest part of the whole process. +All that's needed is to simply type the command "crafty". + +2. display. This command displays the chess board using the standard +chess server style#1 board display. + +This is most often used to confirm that the board has been set to the +proper position in the event that you can't continue an old game and +have to set up the position from scratch (explained later). Note that +white is always at the bottom, regardless of whether Crafty is playing +black or white. + +3. read. This command is used to read in a list of moves and make them +on the game board prior to using crafty to play that game. There are +two ways this can be used: (a) read. This will prompt you for a +white move, a black move, over and over until you type "exit" to terminate +read mode. The side to move will be set according to the number of moves +entered, so that the next move will be for the correct side. (b) read file. +This command reads, but the input comes from "file" rather than from the +keyboard. Note that superfluous text is ignored, as is line numbers, times, +etc. This will read in a pgn game and cull everything but the moves. + +4. setboard. This command is used to set up a specific board position +when it's impossible to restart a game using the "crafty c" command, and +too many moves have been made, making the read command an unattractive +alternative. This command parses a FEN-like position description (a +Forsythe-like notation) and sets the current board to that position. + +The notation uses a string of alpha characters to represent the chess +position. In this notation, uppercase K Q R B N P represents a white +piece, lowercase k q r b n p represents a black piece. for empty +squares, you can use numbers 1-8 to indicate consecutive empty squares. +A "/" must terminate each rank after defining at most 8 square on that +rank, and the ranks are entered in descending order 8..1. In this +notation, then, the first square you enter is a8, then b8, .., h8, +followed by a "/", then back to a7 and repeating. After all 8 ranks +are entered, you need to indicate whether or not one side can castle +kingside or queenside by inserting at least one space character, followed +by a K (white can castle kingside) Q (white can castle queenside) k (black +can castle kingside) or Q (black can castle queenside). After this, add +one more space, followed by the square of a pawn that just moved two ranks +and is subject to an enpassant capture. Note that if there is no +enpassant capture possible, you do not enter this field. + +For the above board position (display command), here's the setboard +command to set that position up: + +setboard r2q1knr/pp2bppp/4b3/1BPp4/6PP/2N1P3/PP3P2/2RQK1NR/ K + +Note that after entering the last piece on a rank, a number for the +remaining empty squares is *not* needed, so this could be shortened +to: + +setboard r2q1knr/pp2bppp/4b/1BPp/6PP/2N1P/PP3P/2RQK1NR/ K + +One unfortunate effect of this command is that you have just lost the +ability to detect repetitions of prior positions in the game, which can +be a critical issue. It is _always_ better to use the read command to +re-enter the moves if the hardware crashes. If you accidentally type +^C and terminate Crafty, you can type "crafty c" and it will continue +the last game, although you will need to set the time control information, +and anything else that is not in the .craftyrc file. + +5. reset <n>. This command is used to back the game up if a different +move is to be tried, or if an incorrect move was entered by mistake. It +depends on the current side to move, and the command "reset 13" will back +the game up to move 13, where the current side on move is still on move, +and Crafty will be positioned to read in move 13 for that side. Note +that this affects the game, but not the clock or time or level, so that if +you back up more than a move or two, you also need to adjust the clock. + +If you want to first change the side to move, use the "white" or "black" +command to set the side to move, then use the reset command to back up +to the move for that side. + +6. time. This command is used to set the time control. There are +several ways to use it, depending on the type of time control desired. +(a) time sd/n sets the game to sudden-death in n minutes. such as +game/10, game/30. time sd/30 would set game in 30 time control. +(b) time moves/time smoves/stime sets the game to "moves" in "time" +minutes, then "smoves" in "stime" minutes. A common setting is +time 40/120/20/60 for 40 moves in 2 hours, then 20 moves in one hour. +(c) time moves/time/sd/sdtime sets a standard first time control, +followed by a sudden death time control. For example time 60/60/sd/30 +is 60 moves in 60 minutes followed by game in 30 minutes. (d) for any +of these, an optional 5th parameter can be added, which is the famous +"Fischer clock" increment that is added to each players time remaining +after he makes a move. The increment is given in seconds rather than +minutes. Note that the default should be right unless the tournament +modifies the T/C after the tournament starts for some reason. + +7. settc. This command is used to correct time-control info after a +restart. it will prompt you for how much time is left on both crafty's +and the opponent's clock, and for how many more moves until crafty makes +the next time control. Again, usually not needed, but there for serious +circumstances. After restarting, type "clock" to display this info and +if it's wrong in any way, this settc command is the quickest way to fix +it up. + +Common problems and how to solve them: + +1. Is crafty searching or pondering? I was not watching the screen, +and the window size is small enough that all I see is analysis scrolling +up the screen. This is easy. Look at the bottom line on the screen, and +you will see a line that keeps changing, showing the depth, time used so +far, how many moves have been searched and the PV. Look at the third +column what shows something like 12/30, which says that at the current +depth crafty has already searched 12 of the 30 legal moves at the root. +You will notice that there is an extra character after the 30, either a +"*" or "?". If an "*" is showing, Crafty is thinking about its move. If +a "?" is showing, crafty is pondering and thinks it is the opponent's move. + +If it shows a "?" but you know it is Crafty's move, you simply missed it. +Scroll back up using whatever scroll mechanism your text window uses, to +find the move Crafty made. Hopefully this won't happen often, but on the +occasional "emergency" men's room break, anything can happen. Just remember +that "?" means I am pondering and it is my opponent's move, "*" means I +am searching and it is my move. + +2. I entered the wrong move, how do I fix this? You are playing in a +game and at move 37, you enter Rfe1 rather than Rae1. To correct this, +you have to do a couple of things. First, Crafty is now searching, and +if you try to reset the position, it won't accept this command. To stop +the search, type ? (followed by a <RETURN> of course) to tell Crafty to +"move now". Once it displays the move it would play in response to the +incorrect move, it will start its "ponder search" but now the reset +command will work. Simply type "r 37" to back up to move 37, then type +Rae1 and Crafty will continue as though nothing happened. Pay attention +to the clock time after it moves and adjust if necessary (if you lost any +time while correcting an incorrect move.) + +Note: You can also use the "remove" command, which will unmake the last +move by each side. Crafty has to be pondering or waiting on input for +this to work, just like the reset command, so if *you* typed the wrong +move, type "?" to make it move, then "remove" which backs up one move +for each side, followed by the opponent's move. If the opponent makes +the wrong move on the board, and you enter it, do this same thing. Note, +if the opponent screws up, you should notice whether or not crafty had +predicted the right move. If it had, you should probably call the TD +over, back the game up one move with the remove command, then use the +"ponder xxx" command to tell crafty to ponder "xxx" (the move it was +pondering before the wrong move was made by the opponent) and then it +should be allowed to "sit" until the same amount of time elapses before +you enter the correct move. The idea is that if the opponent screws up, +it should not wipe out any searching crafty did while waiting. + +3. The machine dies (power failure maybe). How do I recover? First, you +can stop the clock for such failures, so do that *first*. Then, reboot the +machine and start crafty by typing "crafty c". Next, type the "history" +command and carefully check the last move it displays against the score +sheet you are maintaining by hand. If they are the same, you are ready to +enter a move and continue. If there are moves missing, use the "reada" +command to re-enter these moves and append them to the moves already +present. + +If the continue option won't work due to a corrupted history file, you have +two choices. The best choice is to restart crafty without the "c" option, +and then use the "read" command and enter the moves by hand so that if you +screw up later, the "reset" command will work correctly to let you back up. +If you are 100 moves into a game, this might not be practical. In this +case, use the "setboard" command to enter the position. Be careful to +check the position after entry using the display command, and be careful +to not enter the wrong move since you can't use the "reset" command to +back up after using the setboard command. + +After either of the above problems, you need to set the proper time +control (if this is in your .craftyrc this is not needed) and then you +need to adjust the clock to show the proper amount of time remaining. +The command to display the clock is "clock". To adjust the clock +use the command form "clock c-time o-time" where c-time is crafty's +time remaining, and o-time is the opponent's time remaing. These +can be etered as simply the number of minutes left, or in the hh:mm +format if preferred. "clock 60 50" sets crafty's clock to 60 minutes +left, opponent's clock to 50 minutes left. "clock 1:15 45" sets +Crafty's clock to 75 minutes remaining, opponent's clock to 45. +Crafty pays attention to how much time the opponent has used, +so be sure and get them both correct. You should subtract 5 minutes +from the actual time left on the clock to give yourself a cushion. Of +course, you should *never* enter "0" time left, or even worse, a negative +number, because Crafty will go south for the Winter if you do. :) + +Note that there is a "settc" command that simplifies getting the time +control right after a restart... It's explained above. +<end> |