pax_global_header00006660000000000000000000000064126611600320014507gustar00rootroot0000000000000052 comment=f7a7847ea2d4764d9a0a211ba6559fa98e8dbee6 fairymax-5.0b/000077500000000000000000000000001266116003200133355ustar00rootroot00000000000000fairymax-5.0b/CVfairy.html000066400000000000000000000515651266116003200156020ustar00rootroot00000000000000 Fairy-Max

Downloads

Fairy-Max Windows executable and source (includes ShaMax.exe and MaxQi.exe, and logo)

Pair-o-Max Windows executable (plus ini file and logo)

Looking-Glass executable for Alice Chess (includes ShaMax.exe and MaxQi.exe, and logo)

fairymax sources as tar ball for installing from source on *nix systems (includes maxqi.c)

Fairy-Max: an AI for playing user-defined Chess variants

Introduction

Fairy-Max is an AI, also called 'engine', for playing Chess variants. It is free open-source software. It was created for the purpose of empirically evaluating fairy pieces, by allowing those to participate amongst orthodox Chess pieces in Chess games aimed at checkmating an opponent royal piece. It searches ahead like the FIDE-Chess engine from which it was derived (the World's once smallest Chess program, micro-Max) by generating moves and trying them out on the internal board. To know how each piece type moves, micro-Max uses tables with step vectors, and it knows which pieces are leapers and which are sliders. In Fairy-Max, the contents of these tables is not fixed, but is loaded from a configuration file 'fmax.ini' at the start of each game. This allows the user to change the way pieces move (or add pieces of his own design) without changing the program, by altering the contents of the fmax.ini file. Fmax.ini is a normal text file and thus can be modified with any text editor (e.g. Notepad).

Fairy-Max is 'only an AI'. This means it does not provide any graphics to display the position of the game it is playing, but only relays the moves as text. It is primarily designed to be run as an engine inside the WinBoard GUI, (or its Linux counterpart XBoard), and it communicates with this GUI in 'WinBoard protocol'. Although there are several other GUIs that support WinBoard protocol, they will in general not offer as much variant support as WinBoard / XBoard. Most GUIs only support normal Chess, but ChessGUI by Matthias Gemuh also supports 10x8 Capablanca variants. Note that there are also many other WinBoard-compatible engines for playing variants that can be played under WinBoard 4.3 or higher. Some even play variants that Fairy-Max could never implement (e.g. Xiangqi or Crazyhouse).

There are however some dedicated versions of Fairy-Max that are adapted to variants with very unique needs, such as the Shatranj baring rule, or the confinement of pieces to certain board areas in Xiangqi. These versions, known as ShaMax and MaxQi, respectively, are in general only useful for playing a single Chess variant, and are included in the downloads listed at the top of this page. There also is a derivative 'Looking Glass', which plays Alice Chess. There also exists a special research derivative 'Pair-o-Max', which does take into account mating potential in the late end-game.

Setup

Fairy-Max can be downloaded in both Windows and Linux versions through the links at the top of this page. It is also included in the standard distribution of WinBoard, however, where it is pre-installed as primary engine, and can be started from the Windows Start menu. The Windows Fairy-Max package contains the engine executable, the fmax.ini (which contains its own format description), and the engine source code, all grouped inside a folder. To install it, just extract this folder to a suitable place on your hard disk. Recommended is to put this folder next to the one where you installed WinBoard. WinBoard has a Load Engine dialog in its Engine menu, which you could use to install Fairy-Max (or any other engine) by simply pointing out the exe file in a file-browse dialog. It needs no special parameters or options.

Fairy-Max' hash table size can be set through WinBoard's Common Engine Options dialog, and is responsible for almost its memory usage. (It is rounded down to 12 times a power of two, e.g. 48MB, 96MB, 192MB) If this does not comfortably fit in memory together with the engine process of the opponent (if there is a computer opponent), Fairy-Max will not run properly, and you would have to reduce the hash size.

For a detailed explanation of the variants that Fairy-Max can play, see the website of chessvariants.org

The piece descriptions in the fmax.ini file are grouped into variants, so that setting the engine to a certain variant (from the User Interface), will load the group of piece descriptions for that variant. The Fairy-Max download comes with an fmax.ini that predefines several variants (FIDE Chess, Capablanca Chess, Shatranj, Courier, Knightmate, Cylinder Chess), which can serve as an example for those that want to implement their own variants. In addition, the fmax.ini file contains definitions of the most common fairy pieces not participating in the predefined variants, so that the user can draw on them when composing his own variants. Although Fairy-Max supports merely 15 different piece types, this is only a limitation to the number of different piece types that can participate simultaneously in a single game. In a game of another variant, all 15 pieces could move completely differently.

Table 1: Variants pre-defined in the supplied fmax.ini

normal FIDE's good old mad-queen game
shatranj Arabic precursor of Chess with Elephants in stead of Bishops (best played with ShaMax)
capablanca 10x8 variant with Archbishop and Chancellor
gothic Patented variant similar to Capablanca, with a more exciting opening setup
courier 12x8 Medieval variant, combining Shatranj pieces with the modern Bishop
knightmate King moves like Knight, and vice versa
cylinder The board has no left or right edges, pieces wrap around
berolina 8x8 variant where Pawns capture straight ahead, and move diagonally
super Superchess, an 8x8 shuffle variant with 4 super-pieces, including Amazon
great Great Shatranj, a 10x8 variant where all sliders are replaced by corresponding short-range pieces
seirawan S-Chess, where a R+N and B+N compund start in hand and can be gated onto the 8x8 board
spartan Spartan Chess, where a completely unorthodox army with two kings (the Spartans) battle the regular (Persian) FIDE army
makruk Thai Chess, a Shatranj-like variant where Elephants are replaced by Gold Generals, and Pawns start on 3rd rank
falcon On 10x8 with two 'falcon' pieces (multi-path lame (1,3)+(2,3) leapers)
- Chess with Different Amies: the FIDE army, the Colorbound Cobberers, the Nutty Knights or Remarkable Rookies battle each other
xiangqi Chinese Chess (9x10 board) with Elephants, Cannons, and a King confined to a 3x3 Palace (only with MaxQi)
fairy A catch-all variant, in which by default any piece can participate. Fairy-Max redefines the meaning of this variant as specified by a combobox option.

The board size for each variant is also defined in the fmax.ini file, and is currently limited to 12x8. (Expansion of the number of ranks is on the to-do list.) The default opening position is also defined in there, but can be overruled by loading a position through the User Interface.

Pieces

Table 2: attributes that can be combined to define a move type

C capture target square is valid if occupied by enemy piece
N non-capture target square is valid if empty
T terminate move cannot continue, even if target square is empty
H hopper move can continue if target square was occupied
W wrap treat board like left edge borders right (cylinder board)
M multi-path special move mode for Falcon in Falcon Chess

Apart from Pawns, orthodox Chess pieces only come in two different types: leapers and sliders. Leapers can only do one step of a given type, while sliders can repeat their elementary step indefinitely, as long as they do not encounter an obstruction (piece or board edge). If the obstruction is an enemy piece, it can be captured, (both by leapers and sliders), but the move cannot continue after that even for a slider.

As not all fairy pieces fall in the slider or leaper category, Fairy-Max implements two additional move types: hoppers and alternators. Hoppers are sliders that can jump over the first obstruction in their path, and continue from there, with possibly a different type of move. The best known examples are the Cannon (Pao) from Chinese Chess, and the Grasshopper. The Pao changes its move type from 'non-capture only' to 'capture only' on hopping. The Grasshopper changes it from 'none' to 'both' (capture and non-capture), and in addition changes from slider to leaper. (It is only allowed to do one step after the hop, in contrast to the Pao, which remains a slider after hopping.)

Alternators are pieces that do not need to hop over anything to change their move type, but do so spontaneously after every step they make. This can be a change in step direction, to provide bend trajectories, but also in capture rights. E.g. a Xiangqi Elephant makes 2 diagonal steps in the same direction, on the first step it is not allowed to do anything (capture or non-capture) but continue, (if the square is empty, of course), on the second step it can both capture and non-capture (but is not allowed to continue any further, even if the square was empty). The Xiangqi Horse is similar, but also changes direction between the first and second step.

The Crooked Bishop is an example of a slider that changes direction on every step. This means both its primary and secondary step allow slider-like continuation. After the second step it switches back to its first, and continues alternating on every subsequent step. For simplicity, Fairy-Max treats every slider that is not a hopper as an alternator. In cases where this is not desired (e.g. for the Rook), it simply 'alternates' between two identical steps.

To provide flexibility in implementation of fairy pieces, the discription of the move type has to be given for each direction separately, rather than for the piece as a whole. This to allow mixed sliders/leapers, such as the Archbishop, which combines the Knight (leaper) and Bishop (slider) moves. For implementation of hoppers and alternators, the move description (direction and type) has to be given twice (primary and secondary move descriptor). The method used for that in the fmax.ini file is to specify which bits should change to make the secondary step and move rights out of the primary. This info can be used to change them in both directions (primary -> secondary and secondary -> primary), which is convenient for alternators. It also means that for 'normal' pieces, where nothing changes as primary and secondary step are the same, the secondary rights and step are all zero, and don't have to be written. Since version 4.8S a 2-bit 'delay count' can be specified with each piece to delay the first toggle between primary and secondary step type by 1, 2 or 3 steps, which allows implementation of limited-range sliders of ranges upto 5.

Fairy-Max makes no assumptions to the symmetry of the piece, meaning that all directions in which the piece moves have to be specified explicitly. E.g. for a Rook we have to list 4 moves, for a Knight 8. However annoying this sometimes might be, this is necessary for allowing implementation of asymmetric pieces such as the Crab or the Shogi Generals. Unfortunately, Fairy-Max is not smart enough yet to realize that the different sides play in opposite direction. Thus asymmetric pieces (such as Pawns) have to be implemented as different piece types for white and black. (E.g. what is a Crab for white, will be a Barc for black, and vice versa.) The following pieces have predefined descriptions in fmax.ini, ready for copying to your own variants.

Table 3: Pieces that are pre-defined in the fmax.ini that comes with the download

SIMPLE LEAPERS COMPOUND LEAPERS LEAPER-SLIDER COMPOUND SLIDERS LAME LEAPERS CYLINDER PIECES
Ferz King / Commoner Archbishop Bishop Elephant (Xiangqi) Cylinder Bishop
Wazir Bison Chancellor Rook Horse (Xiangqi) Cylinder Rook
Knight Wildebeest Caliph Nightrider Falcon Cylinder Knight
Dabbaba Carpenter Canvasser Queen SEPARATE CAPTURE Cylinder Queen
Elephant (Alfil) Kangaroo Amazon Crooked Bishop FIDE Pawn Cylinder Pawn
Camel High Priestess HOPPERS LIMITED RANGE Shatranj Pawn
Zebra Minister Grasshopper Rook-3 Quing
Crab / Barc Cannon (Xiangqi) Bishop-4 Keen

Rules

This section gives an indication of how the Chess variants are defined in the fmax.ini file. After a line "Game: " to indicate that a new variant description follows, we have lines that specify the board size, and the back rank of the array for white and black. (Fairy-Max always assumed a close rank of Pawns directly in front of that.) A name can be prefixed with "fairy/", meaning that it is not supported by WinBoard, and has to be played as the catch-all vatiant "fairy". An engine option (appearing in the GUI's Engine Settings dialog) will in this case determine what variant is really played (identified by the part of the name after the slash).

The variant name can be followed by a # and extra information. In such a case Fairy-Max will send a 'setup' command to the GUI to inform it of the default opening position for the variant, possibly accompanied by the info behind the #, which designates the one-letter piece ID with which the GUI should represent the various pieces. After the three initial lines follow the descriptions of all participating pieces, one line per piece.

For each piece, we have to give the letter by which it is represented when feeding a position to the engine, and the value the engine should attach to it in play. (So beware, Fairy-Max is not smart enough to figure this out by itself. If you tell it an immensely powerful piece like a Queen is only worth half a Pawn, it will happily trade it for one!) Then follows on the same line a list of move descriptors, one for each direction the piece moves in. A move description consists of an elementary board step, and a number that specifies the move attributes, i.e. what the piece is allowed to do in this direction (if it can capture and/or non-capture, if it is leaper or slider, if it can hop over an obstacle or not, if it respects the board edges or wraps around.) The exact way the step vectors and attributes are encoded is specified in comment lines contained in the fmax.ini, as it might still be subject to change in future versions.

The first two pieces specified are by definition the white and black Pawns. That means that Fairy-Max will let them promote if they reach the last rank. Fairy-Max does not think about under-promotion, but always promotes to 'Queen', i.e. the 7th piece specified, however that may move. Except when piece number 7 only appears in the initial setup for white, and a piece with number 9 occurs in the initial setup for black, in which case black would always promote to piece 9 (to allow variants with different armies).

Any piece with a negative value is considered royal. Fairy-Max makes a difference between value -1 and other negative values, though: -1 indicates absolute royalty, i.e. loss of any piece of this type means loss of the game. Other values indicate only loss of the last royal piece result in loss of the game, and any spare ones should be treated as if they are worth the absolute value of the given number. This allows for variants with 'delocalized royalty', such as Spartan Chess.

Notes

There are many things that Fairy-Max cannot do; it was never meant to be a general game-playing system like Zillions of Games. Amongst the impossibilities are piece drops, (as in Crazyhouse or Shogi), pieces for which the moves are dependent on their location on the board (as in Xiangqi, but MaxQi handles this particular case). and pieces whose moving exerts side effects on other squares that their old and new location (with the exception of castling and e.p capture). For some pieces the move is simply too complicated to fit within the Fairy-Max move-type classification system (e.g. Rose, Griffon).

Only boards with 8 ranks are currently implemented.

The current version of Fairy-Max implements e.p. capture in such a way that it also correctly handles Berolina Pawns, and allows castling with any corner piece.

Playing Tips

Positional evaluation in Fairy-Max is fairly primitive: a piece either is drawn towards the center, or not. If you want a piece to be drawn to the center, you should indicate it by a lower-case letter. Pawns do get a large positional bonus when they reach 6th or 7th rank, of 64 and 128 units ('centiPawn' in FIDE Chess), respectively. This assumes that the piece to which the Pawns will promote is of decisive value, so the opponent will have to sacrifice a piece to stop the promotion. Unfortunately, this does not work very well in Shatranj and Courier Chess, where Pawns promote to the worthless Ferz. Recent versions of Faiy-Max divide this bonus by 8 in cases where a "Queen" (the piece to which Pawns promote by default) is worth less than 250 centi-Pawn, to repair this problem. Nevertheless, the strategy of Fairy-Max is tailored too much to normal Chess, with normal Pawns to be a really good Shatranj or Courier player.

Equipment

Fairy-Max runs on a PC under any Windows operating system. The memory demand is determined by the size of its hash table, which by default is 96M. It would still run with a smaller hash table, but the larger the hash table, the better its play. Running with a hash table smaller than 6MB is not recommended. Recently also versions that can run on other platforms, such as Linux, were released.

Contact

Questions about Fairy-Max can be posted as comments to the Fairy-Max page on the chessvariants website, which are checked regularly by H.G. Muller, and of which this page is an adapted version.


Written by H.G. Muller.
WWW page created: July 8, 2008. Last updated: February 28, 2013. fairymax-5.0b/Makefile000066400000000000000000000047701266116003200150050ustar00rootroot00000000000000srcdir = . prefix = /usr/local bindir = $(prefix)/bin mandir = $(prefix)/share/man datadir = $(prefix)/share plugindir = $(datadir)/games/plugins fairydir = $(datadir)/games/fairymax CC?=gcc CFLAGS?= -O2 -s INI_Q?=$(fairydir)/qmax.ini VERSION?=`grep 'define VERSION' fairymax.c | sed -e 's/.*"\(.*\)".*/\1/'` ALL= fairymax shamax maxqi fairymax.6.gz all: ${ALL} fairymax: fairymax.c $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -DFAIRYDIR=\"${fairydir}\" fairymax.c -o fairymax shamax: fairymax.c $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -DFAIRYDIR=\"${fairydir}\" -DSHATRANJ fairymax.c -o shamax maxqi: maxqi.c $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -DINI_FILE=\"${INI_Q}\" maxqi.c -o maxqi install: ${ALL} ${srcdir}/data/* install -d -m0755 $(DESTDIR)$(bindir) cp ${srcdir}/fairymax ${srcdir}/shamax ${srcdir}/maxqi $(DESTDIR)$(bindir) install -d -m0755 $(DESTDIR)$(fairydir) cp ${srcdir}/data/*.ini $(DESTDIR)$(fairydir) cp ${srcdir}/data/*.hash $(DESTDIR)$(fairydir) install -d -m0755 $(DESTDIR)$(mandir)/man6 cp ${srcdir}/fairymax.6.gz $(DESTDIR)$(mandir)/man6 install -d -m0755 $(DESTDIR)$(plugindir)/logos cp ${srcdir}/data/logo.png $(DESTDIR)$(plugindir)/logos/fairymax.png cp ${srcdir}/data/logo.png $(DESTDIR)$(plugindir)/logos/shamax.png cp ${srcdir}/data/logo.png $(DESTDIR)$(plugindir)/logos/maxqi.png install -d -m0755 $(DESTDIR)$(plugindir)/xboard cp ${srcdir}/data/*.eng $(DESTDIR)$(plugindir)/xboard fairymax.6.gz: fairymax.pod pod2man -s 6 fairymax.pod | gzip -9n > fairymax.6.gz clean: rm -f ${ALL} dist-clean: rm -f ${ALL} *~ data/*~ *.man md5sums dist: fairymax install -d -m0755 Fairy-Max install -d -m0755 Fairy-Max/data rm -f fairymax.tar fairymax.tar.gz cp fairymax.c maxqi.c fairymax.pod Makefile README changelog copyright Fairy-Max cp data/* Fairy-Max/data (md5sum Fairy-Max/* Fairy-Max/data/* > Fairy-Max/md5sums) || true tar -cvvf fairymax-$(VERSION).tar Fairy-Max gzip fairymax-$(VERSION).tar rm fairymax rm Fairy-Max/data/* rmdir Fairy-Max/data rm Fairy-Max/* rmdir Fairy-Max uninstall: rm -f $(DESTDIR)$(plugindir)/logos/fairymax.png rm -f $(DESTDIR)$(plugindir)/logos/shamax.png rm -f $(DESTDIR)$(plugindir)/logos/maxqi.png rm -f $(DESTDIR)$(plugindir)/xboard/fairymax.eng rm -f $(DESTDIR)$(plugindir)/xboard/shamax.eng rm -f $(DESTDIR)$(plugindir)/xboard/maxqi.eng rm -f $(DESTDIR)$(fairydir)/* rmdir $(DESTDIR)$(fairydir) rm -f $(DESTDIR)$(mandir)/man6/fairymax.6.gz rm -f $(DESTDIR)$(bindir)/fairymax rm -f $(DESTDIR)$(bindir)/shamax rm -f $(DESTDIR)$(bindir)/maxqi fairymax-5.0b/README000066400000000000000000000016311266116003200142160ustar00rootroot00000000000000This package contains the sources of the XBoard-compatible Chess and Chess-variant engine Fairy-Max, and its dedicated derivatives ShaMax (for Shatranj) and MaxQi (for XiangQi = Chinese Chess). A Makefile is provided to compile and install them. Normally this would require only the command (given from the main directory of the package): sudo make install This will install the executables in /usr/games, (where XBoard expects them), and their data files in /usr/share/games/fairymax. Should you want to compile by hand, you could use the following commands: gcc -O2 fairymax.c -o fairymax gcc -O2 fairymax.c -DSHATRANJ -o shamax gcc -O2 maxqi.c -o maxqi In this case you will get versions that expect their fmax.ini or qmax.ini files in the current direcory. To change the default path of the ini files, you can include the argument -DINI_FILE=\"pathname\" to the gcc compilation command line. H.G.Muller fairymax-5.0b/changelog000066400000000000000000000362271266116003200152210ustar00rootroot00000000000000/***************************************************************************/ /* micro-Max version 4.8 (~1950 characters) features: */ /* - recursive negamax search */ /* - all-capture quiescence search with MVV/LVA priority */ /* - (internal) iterative deepening */ /* - best-move-first 'sorting' */ /* - a hash table storing score and best move */ /* - futility pruning */ /* - king safety through magnetic frozen king */ /* - null-move pruning */ /* - Late-move reductions */ /* - full FIDE rules (expt minor promotion) and move-legality checking */ /* - keep hash + rep-draw detect */ /* - end-game Pawn-push bonus, new piece values, gradual promotion */ /***************************************************************************/ /* The Fairy-Max version reads the piece description from a file fmax.ini */ /* The format supports many fairy pieces, including hoppers. */ /* f) now supports 15 piece types, by requisitioning WHITE bit */ /* g) supports larger board width. */ /* h) castling bug ('in-check by non-captures') corrected */ /* i) rep-draw bug ('side-to-move') corrected */ /* k) allow user underpromotions, recognize & ignore 'variant' command */ /* l) edit bug corrected (i & j file clear) */ /* m) piece values no longer quantized, game-stage counting bug corrected */ /* n) edit-menu K-side castling bug corrected. */ /* o) retrieve the requested variant from the .ini file */ /* p) clear hash table on variant switch */ /* q) reduced piece-material count for better Pawn push */ /* r) hash-table bug corrected (X still ORed with flags) */ /* s) Bug that prevented initialization center points corrected */ /* t) castling bug after edit fixed */ /* u) converted to protocol 2; ping implemented */ /* v) white e.p. rights hash bug fixed; */ /* w) piece indicators programable, multi-path support */ /* x) e.p. changed to support Berolina Pawns */ /* y) capture value of 6-7th-rank Pawn reduced in Shatranj */ /* z) bug in promotion input corrected */ /* A) stalemate-detection bug in printResult fixed */ /* B) Invalidate hash on game-level promotion (might be under-promotion!) */ /* C) King move evaluation based on negative piece value in stead of nr */ /* D) WB memory command added, undo fixed */ /* E) 15th piece read in */ /* F) accepts ini fileargument */ /* G) bug in calculation ASCII promotion character fixed */ /* H) unified normal and shatranj source */ /* J) rewrite under-promotion code, fixes persistent bug there */ /* K) o[] and oo[] made int to make fairymax work on big-endian machines */ /* L) added Resign option feature (using new WB protocol) */ /* M) char -> signed char for better portability */ /* N) add PV printing and multi-PV support */ /* O) non-Rook castling, 6th-rank promotion, independent B/W piece naming */ /***************************************************************************/ 4/6/2009 Unified source of ShaMax and Fairy-Max into single fmax.c file, and created this ChangeLog from the until then self-documenting source. 6/2/2009 Promotion code rewitten to not refer to default piece characters. 9/3/2009 Fixed big-endian bug in reading inifile (char with int format), and added some option features to make Fairy-Max useful as test engine for GUIs that want to implement the WB protocol extensions. 9/16/2009 Made signedness of char in AI explicit 27/12/2009 Added PV updating through the triangular-array method. Also added a multi-PV option to print lines within a certain sccore margin. 15/1/2010 Improved Makefile, updated docs Implement independent naming of white and black pieces. (So mirror- image pieces can use same letter.) Change castling code to allow castling with any corner piece type. Implement 6th-rank promotion based on 'Queen' value. Makruk added as new variant to the fmax.ini file. 16/1/2010 Fixed bug in Shatranj result claims. Flip eval sign when side-to-move changes through WB color command. 17/1/2010 Removed Shatranj stalemate claim again, as it was never triggered. 1/11/2010 Implement counting of pieces, and extinction win condition. Add engine option to allow subdivision of variant fairy. Add FIDE vs Nutty Knights as variant fairy/FIDE-Nutters Allow white and black to promote to a different piece type. 2/11/2010 Implement duple-check rule. Add Spartan Chess as variant to fmax.ini. Update docs. 1/12/2010 Version 4.8Q, implementing a reverse setup command for sending pieceToCharTable and initial position to the GUI, sub-specification of variant fairy through an engine-defined option, allowing Seirawan- type gating moves in search. Seirawan Chess is added as new variant, plus several new combinations of Chess with different armies 7/10/2011 Version 4.8R, keeping better track of which pieces are virgin in a setup position, and have a better distinction between use of the '4' move-rights code between an initial double-step jump without e.p. rights (as could so far only be used for Pawns, as the Spartan Hoplite), and castlings. As a result even royal pieces can now get an initial double-step other than castling, which has been used to implement Cambodian Chess as a sub-variant of Makruk (selected through a new option). Falcon Chess was added as a new variant. 12/2/2013 Version 4.8S. Fixes a lot of bugs: * Setting up Seirawan positions with ungated pieces * Making Seirawan gating with already gated pieces illegal * Fix undo in Seirawan (by remembering gatings) * Recognizing drop moves as illegal moves * Hash-table was only half used * Spurious result claims after under-promotion * False mate claims in Spartan when promotion to K was possible * Fix bug in Berolina e.p. capture that is actually non-capture * Fix conditions for check extension on capture of checker * Fix Clear Hash option, which did not work at all * Fix addition of 6th & 7th-rank Pawn bonus when setting up position * Adapt score by true piece value in case of (under-)promotion In addition it prints msec-accurate timing info, and can implement limited range sliders of range up to 5. Some game definitions using the Remarkable Rookies army (which uses a range-4 Rook) have been added as sub-variants of fairy. 8/9/2014 Version 4.8T. Three bug fixes, some enhancements, two new variants: * mark Rook non-virgin after castling, so it cannot gate in Seirawan * Fix printing of variants feature in MaxQi * Sending the setup command now also works with 3rd-rank Pawns * Allow sending a parent variant with 'setup' * Implement new method for indicating promo-zone width = 3 * Implement new variant nocastle * Implement new variant ASEAN Chess * Add option to play Makruk with Ai-Wok in stead of Met 17/10/2014 Version 4.8U. Four new variants were added: * Charge of the Light Brigade * King of the Hill * Bifurcator Chess * Team-Mate Chess General game-playing enhancements: * Hoppers can now be specified as hopping over friendly pieces only, and the point where the second move leg starts can be moved to the step just before hitting the platform. * Sliders will now toggle to their secondary move only once, allowing bent riders at the expense of crooked ones. * Code is added to recognize the situation 'bare King', and give higher award for cornering it in that case, to make mating with many weak pieces (as regularly occurs in Makruk) easier. * When a mate of the bare King in one corner cannot be found, points will be awarded to drive the King out of that corner to another one, allowing it to successfully perform KBNK-like mates. * Make it possible to mark pieces as invalid promotion choice Embracement of new standards: * Add logo, and install it according to new 'plugin standard' * Install a (new) .eng file to comply with the plugin standard * Issue the (new) XBoard 'piece' command for all non-standard pieces New options: * Fifty-move claiming can be adapted to the need of the variant * A comment line can now be displayed with each variant through an 'Info' button in the engine options Bugfixes, two of fatal bugs: * Fix printing of Seirawan gating moves * Correct the moves of the Marshal in the Rookies army of CWDA * suppress emission of a spurious (garbled) setup command at startup * Fix positioning of Pawns in ASEAN Chess in setup command 22/10/2014 Version 4.8V. Bugfix release for 4.8U: * Fixes null move, which was broken by the bare King patch, as that always set material (R) to 4, not just when bare King was detected. 26/1/2016 Version 5.0a A rather drastic enhancement of the general capabilities: * Analyze mode is supported, meaning arrival of input is tested during search. Both Linux and Windows code was added for this * Move exclusion during analysis is supported (feature exclude=1) * The number of board ranks is no longer fixed at 8, but can have any value up to 16. This required the promotion 'upgrade' to come from a table pt[], rather than being derived from rank number through a hard-coded expression * The promotion code now uses the true value of promotion pieces in the search, rather than assuming Q and correcting it at game level * Pawns can start on other ranks than the 2nd, and would normally start at the edge of the promotion zone as indicated by the =N suffix to the board size in the ini file * A negative N in the =N suffix now does affect on which rank the Pawns are placed, but leaved the promotion zone depth at 1 rank * A spin-off of the table-driven promotion is that the promotion piece can be made file-dependent. This is currently used to set the choice to the piece that starts on that square, as a side effect of starting the Pawns on 4th rank * Initial triple pushes of Pawns can be e.p. captured on both skipped squares on 10-rank boards, when they are specified as first move on the white Pawn * It is possible to define on Pawns a move that is both an initial triple push as well as a double push when advanced only one square. This uses the code that normally would be a 5-push * Any pair of royals will now be subject to the procedure of bare-King detection, and increase of its centralization weight, rather than just piece 3 and 4. This makes it easier to order the Kings last, for better LVA move sorting * Stalemate can be configured as a win, currently triggered by defining value -2 for the 9th piece (which then is a royal) * The castling-through-check test now can test more than the 3 squares starting at the King from-square, and really tests upto the square next to the King destination. This would work for castlings of any King stride >= 2 * The castling emptiness test now works for strides up to 4, on boards of any width (was 3, and flaky for K-side 10-wide) * Repetition detection now also is done inside the tree, making it possible to plan for sacrificial perpetuals * Bare-King checkmating is improved, by clearing the hash table after every move (except mate scores and game history). * The case with color-bound pieces is now handled by changing the centralization table as soon as the bare King visits a corner square into one that penalizes only the adjacent two corners * Against bare King all reductions are switched off, and a new 2-ply extension is granted on a bare King leaving a corner. This speeds up finding corner mates. * A variant-specific file is used to pre-charge the hash table with positions that are protected from overwrite. A file for Makruk to help recognizing some difficult mates is included in the install * New engine-defined options 'Save in hash file' (button) and 'Automatic persistent-hash dialog' (checkbox) can be used to add positions to this persistent hash file. * moves with bent trajectories can now be defined in the ini file by adding the desired secondary step as third parameter * clear hash on null-move switch, rather than spoiling the key These enhancements have made it possible to add many new variants, all out of reach before: * Los-Alamos Chess (6x6 without Bishops) * Janus Chess (10x8 with two Archbishops, stride-4 castling) * Roman Chess (10x10, with two Commoners) * Mexican Chess (10x10 with 2 Camels and Pawn triple-push) * Ciccolini's Chess (10x10 with Adjutants (BDD) and Zebras) * Grande Acedrex (12x12, game from 1283AD with bent sliders) * almost-Wildebeest (11x10, with Gnu and 2 Camels) 17/2/2016 Version 5.0b Mostly bug-fixes, and some small interface improvements: * Input of Makruk promotion moves (broken by 5.0a) fixed * Fix false game repetitions from undo messing up game history * Fix dropping out of analysis mode in checkmate position * Improve game-phase definition to prevent King chasing * Grand Acedrex piece values set to encourage Zebra promotion * Randomization obeys 'random' command, suppressed in analysis * Print mate scores according to new CECP standard * pieceToChar strings adapted to new XBoard piece order fairymax-5.0b/copyright000066400000000000000000000014761266116003200153000ustar00rootroot00000000000000This package was debianized by H.G.Muller on Fri Jun 5 20:42:56 CEST 2009. Upstream Author(s): H.G. Muller Copyright: Copyright (C) 2009 H.G. Muller License: Fairy-Max 4.8 is free software, and you have permission do with it whatever you want, whether it is commercial or not. Note, however, that Fairy-Max can easily be configured through its fmax.ini file to play Chess variants that are legally pro- tected by patents, and to do so would also require permission of the holders of such patents. No guarantees are given that Fairy-Max does anything in particular, or that it would not wreck the hardware it runs on, and running it is entirely for your own risk. The Debian packaging is (C) H.G.Muller. fairymax-5.0b/data/000077500000000000000000000000001266116003200142465ustar00rootroot00000000000000fairymax-5.0b/data/fairymax.eng000066400000000000000000000001151266116003200165560ustar00rootroot00000000000000plugin spec 0.0 fairymax chess,capablanca,seirawan,fairychess,shatranj,asean fairymax-5.0b/data/fmax.ini000066400000000000000000001232161266116003200157070ustar00rootroot00000000000000version 4.8(w) 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 Some Common piece definitions: The board steps are encoded as follows: ^ toward 8th rank | -52 -51 -50 -49 -48 -47 -46 -45 -44 -36 -35 -34 -33 -32 -31 -30 -29 -28 -20 -19 -18 -17 -16 -15 -14 -13 -12 <-- -4 -3 -2 -1 start 1 2 3 4 --> towards h file to 12 13 14 15 16 17 18 19 20 a-file 28 29 30 31 32 33 34 35 36 44 45 46 47 48 49 50 51 52 | v towards first rank SIMPLE LEAPERS Ferz: f:150 15,7 17,7 -15,7 -17,7 Wazir: w:125 1,7 16,7 -1,7 -16,7 Knight: n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 Dabbabah: d:100 2,7 32,7 -2,7 -32,7 Elephant: e:80 30,7 34,7 -30,7 -34,7 Camel: C:225 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 Zebra: Z:175 29,7 46,7 50,7 35,7 -29,7 -46,7 -50,7 -35,7 Unicorn: u:-1 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 COMPOUND LEAPERS King: k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 1,34 -1,34 King (Shatranj, no castling): k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 1,34 -1,34 King (Capablanca castling): k:-1 2,3034 -2,1034 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 Commoner: m:260 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 Bison: 1000 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 29,7 46,7 50,7 35,7 -29,7 -46,7 -50,7 -35,7 Wildebeest: g:800 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 Carpenter: c:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 2,7 32,7 -2,7 -32,7 Kangaroo: o:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 30,7 34,7 -30,7 -34,7 High Priestess: h:625 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 30,7 34,7 -30,7 -34,7 15,7 17,7 -15,7 -17,7 Minister c:625 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 2,7 32,7 -2,7 -32,7 1,7 16,7 -1,7 -16,7 Crab: c:150 31,7 33,7 -14,7 -18,7 Barc: b:150 14,7 18,7 -31,7 -33,7 SEPARATE CAPTURES / NON-CAPTURES White Pawn: p:100 -16,24 -16,6 -15,5 -17,5 White Pawn (Shatranj, no double move): p:100 -16,6 -15,5 -17,5 White Berolina Pawn p:74 -15,24 -17,24 -16,5 -15,6 -17,6 Black Pawn: p:100 16,24 16,6 15,5 17,5 Black Pawn with initial triple- and double-push (Mexican Chess) p:100 14,424 16,24 16,6 15,5 17,5 Black Pawn with initial triple- and double-push, and double-push on 3rd rank (Wildebeest Chess) p:100 14,C24 16,24 16,6 15,5 17,5 Pegasus (moves as Queen, captures as Rook): S:500 1,2 16,2 15,2 17,2 -1,2 -16,2 -15,2 -17,2 14,5 31,5 33,5 18,5 -14,5 -31,5 -33,5 -18,5 Keen (moves as King, captures as Queen): k:750 1,6 16,6 15,6 17,6 -1,6 -16,6 -15,6 -17,6 1,1 16,1 15,1 17,1 -1,1 -16,1 -15,1 -17,1 Quing (moves as Queen, captures as King): q:600 1,5 16,5 15,5 17,5 -1,5 -16,5 -15,5 -17,5 1,2 16,2 15,2 17,2 -1,2 -16,2 -15,2 -17,2 SLIDERS Bishop: b:350 15,3 17,3 -15,3 -17,3 Rook: R:500 1,3 16,3 -1,3 -16,3 NightRider: H:560 14,3 31,3 33,3 18,3 -14,3 -31,3 -33,3 -18,3 Queen: Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 LEAPER / SLIDER COMPOUNDS Archbishop: A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 Caliph: C:875 15,3 17,3 -15,3 -17,3 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 Marshall: C:900 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 Canvasser: C:900 1,3 16,3 -1,3 -16,3 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 Amazon: A:1150 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 HOPPERS GrassHopper: G:200 1,F8 16,F8 15,F8 17,F8 -1,F8 -16,F8 -15,F8 -17,F8 Cannon: C:400 1,BA 16,BA -1,BA -16,BA BIFURCATORS Dimachaer: D:300 16,14B8 16,1F4B8 -16,14B8 -16,1F4B8 1,104B8 1,FFFF04B8 -1,104B8 -1,FFFF04B8 Secutor: S:300 16,14BA 16,1F4BA -16,14BA -16,1F4BA 1,104BA 1,FFFF04BA -1,104BA -1,FFFF04BA Provocator: V:830 17,14B8 15,1F4B8 -15,14B8 -17,1F4B8 17,104B8 -15,FFFF04B8 -17,104B8 15,FFFF04B8 Murmillo: M:830 17,14BA 15,1F4BA -15,14BA -17,1F4BA 17,104BA -15,FFFF04BA -17,104BA 15,FFFF04BA LAME LEAPERS Horse: N:5 16,1070 16,1F070 1,10070 1,FFFF0070 -16,1070 -16,1F070 -1,10070 -1,FFFF0070 Xiangqi Elephant: E:1 15,70 17,70 -15,70 -17,70 LIMITED-RANGE SLIDERS R3 (range-3 Rook): D:375 1,443 16,443 -1,443 -16,443 R4 (range-3 Rook): D:425 1,843 16,843 -1,843 -16,843 R5 (range-3 Rook): D:450 1,C43 16,C43 -1,C43 -16,C43 B4 (range-4 Bishop): A:300 15,843 17,843 -15,843 -17,843 BENT SLIDERS Griffon: G:830 17,1003 15,1F003 -15,1003 -17,1F003 17,10003 -15,FFFF0003 -17,10003 15,FFFF0003 Aanca: A:780 16,1003 16,1F003 -16,1003 -16,1F003 1,10003 1,FFFF0003 -1,10003 -1,FFFF0003 Syntax of a variant description: Each variant starts with the label "Game:" followed by the variant name. After that follow upto 18 lines with the description. Line 1: Board size (files x ranks), optionally folowed by zone depth. Line 2: initial setup of white pieces on back rank Line 3: initial setup of black pieces on back rank Line 4-18: Description of piece types that can occur in the variant This can be followed by some optional info to be sent to GUI when it selects the variant, e.g. to tell it how some non-standard pieces move. The board size can run upto 16-L x 16, where L is the largest lateral leap of any piece. It can be suffixed with =N where the number N then indicates the depth of the promotion zone (which normally is just the last rank). Currently only n=3 is understood, and Pawns also start on 3rd rank then. A negative N leaves the zone at 1 rank, but puts the Pawns on the (1-N)th rank; There can be upto 15 piece types per variant, numbered 1 to 15. Numbers 1 and 2 are considered Pawns for white and black, respectively, and the one rank of the opening setup will be filled with them. These pieces will automatically promote to piece number 7 when they reach the promotion zone. So in normal Chess, piece 7 should be programmed as Queen. There is an exception to this: if the initial setup does have a white piece 7, but not a black one, and black has a piece number 9, then black will always promote to the latter. (This can be useful in variants with different armies for black and white). Currently, when the Pawns are configured to start on 4th rank, promotion will be to the piece that started on the promotion square in the initial setup, except for the King square, where it promotes to the piece on the a-side of it; future Fairy- Max versions might get a way to enable this feature independent from Pawn location. (But for now only Grande Acedrex needed this feature.) Castling can be done only with the original corner piece as specified by line 2 and 3. Any piece can in principle castle. (Subject to the normal restrictions on castling, i.e. not passing through check etc.) If you don't want that, remove the castling moves from the King description. If the castling initiator does not start in a central file, the results are currently undefined. The variant name can be suffixed with some info to be sent to the GUI as a 'setup' command, behind a # character. In particular the piece- to-character table to define which symbols the GUI should use for the various pieces, and (after another #) the 'parent' variant. Most variant definitions can be seen at the end of this file. Other lines in this file (i.e. those not recognized as belonging to a variant description) are ignored. They can be used for comments. Fairy-Max' 'Info' option makes the GUI display the text of the comment line starting with '//' just before the start of the definition. In case you want to build your own pieces, this is how it works: The piece-description lines have the following syntax: 1) a piece-indicator character (lower case if piece should be centralized) 2) a colon 3) the internal value to be used for the piece (in centiPawn; Royal = -1) 4) for each direction it moves in, a ray descriptor consisting of: a) the initial step vector (on a 16xN board, so 16 = straight ahead) b) a comma c) the move-mode descriptor, given in hexadecimal, as the individual bits specify the various options optionally followed by d) a comma e) a secondary step vector The piece indicator character is used to set up positions, and for the promotion choice as extra character at the end of an input move. (Fairy- Max itself always promotes to "Queen", i.e. the 7th piece of the list.) If more pieces use the same letter, the first one is used for white, and the last one for black. If more than two have the same name, the others cannot be indicated at all, but they could still occur in the initial setup (where you specify them by number, not letter). Pieces with negative values are considered royal. If one side has more than one royal piece of the same type, he loses if the _last_ one is captured. This means any 'spare' royal pieces can be sacrificed, and the exchange value assumed for them will be the absolute value of what you defined. With a value -1, however, loss of the first piece of that type loses the game. For royal piece types larger than 7 there is the special rule that it is not allowed to leave more than one of them under attack ('duple check'). A royal value of -2 is currently used as a kludge to enable an alternative winning condition, namely when the royal piece reaches (and survives in) one of the four central squares. NOTE: Any piece with a value that (in decimal notation) ends in '3' will not be accepted as promotion choice. (And neither will be absolute royalty, i.e. piece value -1). The individual bits in the move-mode descriptor have the following meaning: In the last hexadecimal digit: 1 capture allowed (of enemy piece; own pieces always block a move) 2 non-capture allowed (i.e. we can move here if the square is empty) 4 leaper, i.e. move terminates after one step (as opposed to slider) 8 hop over non-empty square (normally occupied squares terminate a move) Bits set in the forelast digits TOGGLE the corresponding bits in the last digit. For hoppers when they hop over something, for the other pieces after one to four steps (so for normal pieces, better not set those bits!). The digit before that indicates some special things; a 1 indicates the board should be treated as a cylinder, pieces crossing the right edge re-entering the board at the left, and vice versa. The 2 bit indicates the move is a multi-path move, only used for the Falcon in Falcon Chess. The upper two bits (4 and 8) form a two-bit count, indicating how many steps the first toggle of the move mode of a slider should be postponed (4 = 1 step, 8 = 2 steps, C = 3 steps). This can be used to define 'limited range' sliders or lame leapers skipping over several squares. For a hopper these bits have a different meaning: 8 indicates the hop can only be taken over a friendly piece, and 4 that the toggle to the second leg should be taken one step before the obstacle, rather than on top of it (for implementing colliding bifurators). The higher-order bits toggle corresponding bits in the step vector, to allow bent paths. They should not be set explicitly; if a different step for the second part of the trajectory is required, it can be specified after a second comma, and Fairy-Max will calculate from this how to set the high-order toggle bits. In absence of a secondary step the latter will be assumed to be equal to the initial step. Useful bit combinations for the last digit are: 3 normal slider 7 normal leaper 6 leaper that only moves (e.g. Pawn straight ahead) 5 leaper that only captures (e.g. Pawn diagonal) 1 slider that only captures 2 slider that only moves 0 pass through (for testing emptiness by Xiangqi Horse and Elephant) 4 reserved for skip-step of Pawn double move and castling 8 skip to hopper platform (1st part of Grasshopper move) A non-capture before hop (1st part of Cannon move) C must hop immediately If the first step is a slider, a second step is made (if the square was empty), but if the mode toggles to leaper, the move stops there (e.g. Horse). Hoppers MUST change into non-hoppers on hopping, i.e. the 8 bit of BOTH lower digits must be set. Otherwise results will be undefined. Note that the first two piece-describing lines MUST be for the white and black Pawn, respectively, or promotions will have undefined effects. Also note that uMax does do primitive evaluation of Pawn structure, which might become counter-productive if the Pawn move is changed. A low digit equal to 4 gets special treatment, as the normal interpretation as the last and only step of a move which can neither capture nor move is useles. It will in stead be used as if it was 0 (i.e. there is a follow-up step), but only if the piece has not moved before. If the 1 or 2 bit of the preceding toggle digit are set, they then determine what the move can do after this second step, in the normal way. (For pawn double-push and castling this would normally be a non-capture.) The 4 and 8 bits of this toggle digit are not used for toggling the leaper and hopper bits, though, but indicate if e.p. capture on the reply should be suppressed, and if the move should be allowed to continue even if the first step hits an occupied square. Currently only the following values are defined (all working only for pieces that have not moved yet). 24 e.p.-capturable blockable double-step, non-capture only (on Pawns) 34 castling (on non-Pawns): will swing edge piece around you when possible E4 e.p.-immune jump, non-capture only F4 e.p.-immune jump Other combinations are RESERVED, and will result in undefined effects. (i.e.: they might do different things in future versions as they do in this one)! For the truly lazy, a few complete game descriptions can be found below: // FIDE Chess (a.k.a. Mad Queen variant) Game: normal 8x8 8 5 6 9 3 6 5 8 8 5 6 9 4 6 5 8 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 S:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // Chess without castling (intended as shuffle variant) Game: nocastle 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // Arabic precursor of modern Chess, with weak Queen and Bishops Game: shatranj 8x8 6 4 5 3 7 5 4 6 6 4 5 3 7 5 4 6 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:110 30,7 34,7 -30,7 -34,7 R:630 1,3 16,3 -1,3 -16,3 q:180 15,7 17,7 -15,7 -17,7 e:110 30,7 34,7 -30,7 -34,7 f:180 15,7 17,7 -15,7 -17,7 // ASEAN Chess. New form of Makruk, with promotion of 8th rank only Game: asean 8x8=-2 7 6 4 3 8 4 6 7 7 6 5 3 9 5 6 7 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 q:180 15,7 17,7 -15,7 -17,7 b:300 15,7 17,7 -15,7 -17,7 -16,7 b:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 // Thai Chess. Pawns promote on reaching 6th rank! Game: makruk 8x8=3 13 12 8 3 7 8 12 13 13 12 9 7 4 9 12 13 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 f:181 15,7 17,7 -15,7 -17,7 q:181 15,7 17,7 -15,7 -17,7 m:181 15,7 17,7 -15,7 -17,7 s:300 15,7 17,7 -15,7 -17,7 -16,7 s:300 15,7 17,7 -15,7 -17,7 16,7 b:300 15,7 17,7 -15,7 -17,7 -16,7 b:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 // Cambodian Chess. Like Makruk, but with extra initial King and Met moves Game: Cambodian 8x8=3 13 12 8 3 7 8 12 13 13 12 9 7 4 9 12 13 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 -16,10F4 -16,1F0F4 -1,100F4 1,FFFF00F4 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 16,10F4 16,1F0F4 1,100F4 -1,FFFF00F4 f:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 q:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 m:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 s:300 15,7 17,7 -15,7 -17,7 -16,7 s:300 15,7 17,7 -15,7 -17,7 16,7 b:300 15,7 17,7 -15,7 -17,7 -16,7 b:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 # # K& KiN # M& FifD // Thai Chess variant with Ai-Wok super-piece (RNF). Game: Ai-wok 8x8=3 6 5 3 8 7 3 5 6 6 5 4 7 8 4 5 6 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 s:300 15,7 17,7 -15,7 -17,7 -16,7 s:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 A:1350 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 # # A& NFR // Cambodian Chess using WinBoard's new engine-defined variant mechanism // Cambodian Chess. Like Makruk, but with extra initial King and Met moves Game: cambodian # PN.R.M....SKpn.r.m....sk # makruk 8x8=3 13 12 8 3 7 8 12 13 13 12 9 7 4 9 12 13 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 -16,10F4 -16,1F0F4 -1,100F4 1,FFFF00F4 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 16,10F4 16,1F0F4 1,100F4 -1,FFFF00F4 f:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 q:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 m:181 15,7 17,7 -15,7 -17,7 16,F4 -16,F4 s:300 15,7 17,7 -15,7 -17,7 -16,7 s:300 15,7 17,7 -15,7 -17,7 16,7 b:300 15,7 17,7 -15,7 -17,7 -16,7 b:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 # # K& KiN # M& FifD // Ai-Wok using WinBoard's new engine-defined variant mechanism // Thai Chess variant with Ai-Wok super-piece (RNF). Game: ai-wok # PN.R...A..SKpn.r...a..sk # makruk 8x8=3 6 5 3 8 7 3 5 6 6 5 4 7 8 4 5 6 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 s:300 15,7 17,7 -15,7 -17,7 -16,7 s:300 15,7 17,7 -15,7 -17,7 16,7 n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 A:1350 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 # # A& NFR // Medieval intermediate between Shatranj and FIDE Chess Game: courier 12x8 11 9 5 10 8 3 7 6 10 5 9 11 11 9 5 10 8 4 7 6 10 5 9 11 p:65 -16,6 -15,5 -17,5 p:65 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 e:70 30,7 34,7 -30,7 -34,7 w:100 1,7 16,7 -1,7 -16,7 f:120 15,7 17,7 -15,7 -17,7 m:280 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:300 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:366 15,3 17,3 -15,3 -17,3 R:550 1,3 16,3 -1,3 -16,3 // The King (Unicorn) moves as a Knight, and vice versa. The Unicorn can castle! Game: knightmate 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 m:222 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // Modern variant with B+N and R+N compounds (Archbishop and Chancellor) on 10x8 board Game: capablanca 10x8 6 4 8 5 7 3 5 9 4 6 6 4 8 5 7 3 5 9 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 k:-1 1,3034 -1,1034 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 A:825 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 C:875 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 e:1000 15,7 17,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 -1,7 1,7 -16,7 16,7 -1,34 1,34 -16,34 16,34 // Modern variant with B+N and R+N compounds (Archbishop and Chancellor) on 10x8 board Game: gothic 10x8 6 4 5 7 9 3 8 5 4 6 6 4 5 7 9 3 8 5 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 k:-1 1,3034 -1,1034 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 A:825 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 C:875 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 // Modern variant with two B+N compounds (Janus) on 10x8 board Game: janus 10x8 5 6 3 4 8 7 4 3 6 5 5 6 3 4 8 7 4 3 6 5 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 A:825 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,2034 -1,1034 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 // The Falcon can take any of the 3 shortest paths to its destination Game: falcon 10x8 6 4 5 8 7 3 8 5 4 6 6 4 5 8 7 3 8 5 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 k:-1 1,3034 -1,1034 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 f:450 13,FFFFF207 29,F207 46,F207 47,10207 49,10207 50,11207 35,11207 19,1207 -13,1207 -29,FFFF1207 -46,FFFF1207 -47,FFFF0207 -49,FFFF0207 -50,FFFEF207 -35,FFFEF207 -19,FFFFF207 A:825 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 C:875 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 # # F& aflafrKafraflKafafsKafsafK // Cylinder Chess: left and right board edges are connected Game: cylinder 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:100 -16,24 -16,6 -15,105 -17,105 p:100 16,24 16,6 15,105 17,105 k:-1 1,34 -1,34 1,107 16,7 15,107 17,107 -1,107 -16,7 -15,107 -17,107 n:350 14,107 31,107 33,107 18,107 -14,107 -31,107 -33,107 -18,107 b:450 15,103 17,103 -15,103 -17,103 R:525 1,103 16,3 -1,103 -16,3 Q:1150 1,103 16,3 15,103 17,103 -1,103 -16,3 -15,103 -17,103 # # P& fmWfceoFifmnD # N& oN # B& oB # R& oR # Q& oQ # K& oK // Berolina Chess. Pawns capture straight and move diagonally Game: berolina 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:74 -15,24 -17,24 -16,5 -15,6 -17,6 p:74 15,24 17,24 16,5 15,6 17,6 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 # # P& fmFfceWifmnA // Modern variant with four new pieces in randomly chosen setup on 8x8 board Game: super 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:350 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:360 15,3 17,3 -15,3 -17,3 R:575 1,3 16,3 -1,3 -16,3 Q:900 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 S:825 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 E:850 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 V:775 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 A:1200 1,3 16,3 -1,3 -16,3 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 o:700 2,7 30,7 32,7 34,7 -2,7 -30,7 -32,7 -34,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 g:640 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 2,7 30,7 32,7 34,7 -2,7 -30,7 -32,7 -34,7 m:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 16,70 -16,70 w:340 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 // Seirawan Chess; to 'gate in' Hawk (B+N) or Elephant (R+N), select it before moving Game: seirawan 8x8 5 3 4 7 6 4 3 5 5 3 4 7 6 4 3 5 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 h:780 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 E:814 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 // The usual Persian army combats an entirely different gang of Spartans Game: spartan 8x8 6 4 5 7 11 5 4 6 3 10 12 8 8 12 9 3 p:74 -16,64 -16,6 -15,5 -17,5 h:70 15,E4 17,E4 16,5 15,6 17,6 l:290 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 1,6 -1,6 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 c:255 1,7 16,7 -1,7 -16,7 2,7 -2,7 32,7 -32,7 w:790 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 G:640 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 k:-435 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-435 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 // Chess with Different Armies Game: fairy/FIDE-Clobberers # PNBRQ.........Kp.....eac....lk 8x8 6 4 5 7 10 5 4 6 12 3 8 9 11 8 3 12 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:500 16,3 -16,3 -1,3 1,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 # # e WA # c FAD # l BD # k KilO2rO3 // Chess with Different Armies Game: fairy/Clobberers-FIDE # P.....EAC....LKpnbrq.........k 8x8 12 3 8 7 10 8 3 12 6 4 5 9 11 5 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:500 16,3 -16,3 -1,3 1,3 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 # # E WA # C FAD # L BD # K KirO2lO3 // Chess with Different Armies Game: fairy/FIDE-Nutters # PNBRQ................Kp...........h.t.c...uk 8x8 6 4 5 7 10 5 4 6 11 3 8 9 10 8 3 11 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:500 16,3 -16,3 -1,3 1,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 u:400 31,7 33,7 14,7 18,7 1,7 -1,7 -16,7 -15,7 -17,7 C:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 t:485 16,3 1,3 -1,3 -16,7 -15,7 -17,7 # # h vNF # t fsRbWbF # c fsRbWfhNF # u fhNbsWbF # k KisO2 // Chess with Different Armies Game: fairy/Nutters-FIDE # P...........H.T.C...UKpnbrq................k 8x8 11 3 6 7 10 6 3 11 8 4 5 9 10 5 4 8 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 u:400 -31,7 -33,7 -14,7 -18,7 1,7 -1,7 16,7 15,7 17,7 C:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 -15,7 -17,7 16,7 15,7 17,7 R:500 16,3 -16,3 -1,3 1,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 t:485 -16,3 1,3 -1,3 16,7 15,7 17,7 # # H vNF # T fsRbWbF # C fsRbWfhNF # U fhNbsWbF # K KisO2 // Chess with Different Armies Game: fairy/Clobberers-Nutters # P.....EAC....L.......Kp...........h.t.c...uk 8x8 6 4 5 7 10 5 4 6 11 3 8 9 12 8 3 11 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 u:400 31,7 33,7 14,7 18,7 1,7 -1,7 -16,7 -15,7 -17,7 C:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 t:485 16,3 1,3 -1,3 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # h vNF # t fsRbWbF # c fsRbWfhNF # u fhNbsWbF # E WA # C FAD # L BD # K KirO2lO3 # k KisO2 // Chess with Different Armies Game: fairy/Nutters-Clobberers # P...........H.T.C...UKp.....eac....l.......k 8x8 11 3 6 7 10 6 3 11 5 4 8 9 12 8 4 5 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 u:400 -31,7 -33,7 -14,7 -18,7 1,7 -1,7 16,7 15,7 17,7 C:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 -15,7 -17,7 16,7 15,7 17,7 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 t:485 -16,3 1,3 -1,3 16,7 15,7 17,7 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # H vNF # T fsRbWbF # C fsRbWfhNF # U fhNbsWbF # e WA # c FAD # l BD # K KisO2 # k KilO2rO3 // Chess with Different Armies Game: fairy/FIDE-Rookies # PNBRQ................Kp.............w.mh.s.k 8x8 6 4 5 7 11 5 4 6 8 3 10 9 11 10 3 8 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 R:500 16,3 -16,3 -1,3 1,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 s:400 16,843 1,843 -1,843 -16,843 M:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 -16,3 -14,7 -31,7 -33,7 -18,7 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # w WD # h HFD # s W4 # m RN # k KisO2 // Chess with Different Armies Game: fairy/Rookies-FIDE # P.............W.MH.S.Kpnbrq................k 8x8 6 3 10 7 11 10 3 6 8 4 5 9 11 5 4 8 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 n:325 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:350 15,3 17,3 -15,3 -17,3 s:400 16,843 1,843 -1,843 -16,843 M:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 16,3 14,7 31,7 33,7 18,7 R:500 16,3 -16,3 -1,3 1,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # W WD # H HFD # S W4 # M RN # K KisO2 // Chess with Different Armies Game: fairy/Clobberers-Rookies # P.....EAC....L.......Kp.............w.mh.s.k 8x8 6 4 5 7 11 5 4 6 8 3 10 9 12 10 3 8 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 s:400 16,843 1,843 -1,843 -16,843 M:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 -16,3 -14,7 -31,7 -33,7 -18,7 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # E WA # C FAD # L BD # w WD # h HFD # s W4 # m RN # K KirO2ilO3 # k KisO2 // Chess with Different Armies Game: fairy/Rookies-Clobberers # P.............W.MH.S.Kp.....eac....l.......k 8x8 6 3 10 7 11 10 3 6 5 4 8 9 12 8 4 5 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 e:320 30,7 34,7 -30,7 -34,7 16,7 -16,7 1,7 -1,7 l:530 15,3 17,3 -15,3 -17,3 32,7 -32,7 2,7 -2,7 s:400 16,843 1,843 -1,843 -16,843 M:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 16,3 14,7 31,7 33,7 18,7 c:480 15,7 17,7 -15,7 -17,7 32,7 -32,7 2,7 -2,7 30,7 34,7 -30,7 -34,7 A:875 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,1034 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # W WD # H HFD # S W4 # M RN # e WA # c FAD # l BD # K KisO2 # k KilO2irO3 // Chess with Different Armies Game: fairy/Nutters-Rookies # P...........H.T.C...UKp.............w.mh.s.k 8x8 6 4 5 7 11 5 4 6 8 3 10 9 11 10 3 8 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 u:400 -31,7 -33,7 -14,7 -18,7 1,7 -1,7 16,7 15,7 17,7 t:485 -16,3 1,3 -1,3 16,7 15,7 17,7 C:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 -15,7 -17,7 16,7 15,7 17,7 s:400 16,843 1,843 -1,843 -16,843 M:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 -16,3 -14,7 -31,7 -33,7 -18,7 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # w WD # h HFD # s W4 # m RN # H vNF # T fsRbWbF # C fsRbWfhNF # U fhNbsWbF # K& KisO2 // Chess with Different Armies Game: fairy/Rookies-Nutters # P.............W.MH.S.Kp...........h.t.c...uk 8x8 4 3 5 7 11 5 3 4 10 6 8 9 11 8 6 10 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 w:310 1,7 16,7 -1,7 -16,7 2,7 32,7 -2,7 -32,7 s:400 16,843 1,843 -1,843 -16,843 h:480 15,7 17,7 -15,7 -17,7 2,7 32,7 -2,7 -32,7 3,7 48,7 -3,7 -48,7 h:310 31,7 33,7 15,7 17,7 -31,7 -33,7 -15,7 -17,7 M:935 -16,3 1,3 -1,3 -14,7 -31,7 -33,7 -18,7 16,3 14,7 31,7 33,7 18,7 u:400 31,7 33,7 14,7 18,7 1,7 -1,7 -16,7 -15,7 -17,7 C:935 16,3 1,3 -1,3 14,7 31,7 33,7 18,7 15,7 17,7 -16,7 -15,7 -17,7 t:485 16,3 1,3 -1,3 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 -1,7 16,7 15,7 17,7 -16,7 -15,7 -17,7 # # h vNF # t fsRbWbF # c fsRbWfhNF # u fhNbsWbF # W WD # H HFD # S W4 # M RN # K& KisO2 // Great Shatranj: modern variant with range-two leapers replacing sliders, on 10x8 board. Game: great 10x8 6 4 5 8 3 10 9 5 4 6 6 4 5 8 3 10 9 5 4 6 p:100 -16,6 -15,5 -17,5 p:100 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:290 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 e:270 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 w:300 1,7 16,7 -1,7 -16,7 2,7 -2,7 32,7 -32,7 s:280 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 g:640 1,7 16,7 -1,7 -16,7 2,7 -2,7 32,7 -32,7 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 h:640 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 m:640 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 1,7 16,7 -1,7 -16,7 2,7 -2,7 32,7 -32,7 # # P& fmWfcF # E& FA # W& WD # G& KAD # H& NAF # M& NWD // Charge of the Light Brigade (normal Chess rules) Game: light-brigade # PNBRQKpnbrqk # nocastle 8x8 0 7 0 7 3 0 7 0 4 4 4 4 3 4 4 4 p:74 -16,24 -16,6 -15,5 -17,5 p:74 16,24 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:444 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:400 15,3 17,3 -15,3 -17,3 R:500 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // King of the Hill (King MUST be #3 and have value -2 to trigger hill eval) // Apart from mate, reaching one of the 4 central squares with K also wins Game: king-of-the-hill # PNBRQKpnbrqk # fairy 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:66 -16,24 -16,6 -15,5 -17,5 p:66 16,24 16,6 15,5 17,5 k:-2 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // Bifurcator Chess // slider moves split into two directions at the first friendly piece they meet Game: bifurcator # PNBRQKpnbrqk # fairy 8x8 6 4 5 7 3 5 4 6 6 4 5 7 3 5 4 6 p:66 -16,24 -16,6 -15,5 -17,5 p:66 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:370 15,3 17,3 -15,3 -17,3 15,1FCB8 17,1CB8 -15,1CB8 -17,1FCB8 15,FFFF0CB8 17,10CB8 -15,FFFF0CB8 -17,10CB8 R:518 1,3 16,3 -1,3 -16,3 1,10CB8 16,1FCB8 -1,10CB8 -16,1FCB8 1,FFFF0CB8 16,1CB8 -1,FFFF0CB8 -16,1CB8 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 # # B& BtgabyabsB # R& RtgabyabsR // Variant where no single piece has mating potential Game: team-mate # PN....EF...M.A.J...CUKpn....ef...m.a.j...cuk # fairy 8x8 10 8 6 12 3 5 9 7 10 8 6 12 4 5 9 7 p:110 -16,24 -16,6 -15,5 -17,5 p:110 16,24 16,6 15,5 17,5 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 m:275 30,7 34,7 -30,7 -34,7 45,7 51,7 -45,7 -51,7 e:360 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 c:600 14,FFFF1043 31,F043 33,31043 18,13043 -14,FFFF3043 -31,11043 -33,2F043 -18,11043 f:360 30,7 34,7 -30,7 -34,7 1,7 -1,7 16,7 -16,7 n:360 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 u:550 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 1,7 16,7 -1,7 -16,7 J:770 2,3 32,3 15,3 17,3 -2,3 -32,3 -15,3 -17,3 A:883 16,1003 16,1F003 -16,1003 -16,1F003 1,10003 1,FFFF0003 -1,10003 -1,FFFF0003 # # E& FA # F& WA # M& AG # U& WN # C& NmpafsafF # A& WyafsW # K& KisO2 # J& BD0 // Variant on a 6x6 board without Game: los-alamos # PN.RQKpn.rqk # fairy 6x6 6 4 7 3 4 6 6 4 7 3 4 6 p:99 -16,6 -15,5 -17,5 p:99 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:333 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:296 15,3 17,3 -15,3 -17,3 R:444 1,3 16,3 -1,3 -16,3 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 // Variant from 1820 with Zebra ('Elephant') and Bishop - Dababbarider compound ('General') Game: ciccolini # PN.RQ..........G.......EKpn.rq..........g.......ek # fairy 10x10 5 4 6 3 7 8 3 6 4 5 5 4 6 3 7 8 3 6 4 5 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 e:222 46,7 50,7 -46,7 -50,7 35,7 29,7 -35,7 -29,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:475 1,3 16,3 -1,3 -16,3 G:700 15,3 17,3 -15,3 -17,3 32,3 -32,3 2,3 -2,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34,2 -1,34,-2 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 # # E& Z # G& BD0 // Mexican Chess: 10x10 variant with two 'Conquistadores' (move as Camel) Game: mexican # PNBRQ...................CKpnbrq...................ck # fairy 10x10 6 4 3 5 7 8 5 3 4 6 6 4 3 5 7 8 5 3 4 6 p:100 -16,424 -16,24 -16,6 -15,5 -17,5 p:100 16,424 16,24 16,6 15,5 17,5 c:222 47,7 49,7 -47,7 -49,7 19,7 13,7 -13,7 -19,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:332 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34,2 -1,34,-2 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 # # P& fmWfceFifmW3 # C& C // 12x12 variant from the Alfonso codex (1283 AD), with bent sliders and range-3 leapers Game: grande-acedrex # P.CR.............A..U..G........LKp.cr.............a..u..g........lk # shatranj 12x12=-3 8 7 9 5 6 10 3 6 5 9 7 8 8 7 9 5 6 10 4 6 5 9 7 8 p:95 -16,6 -15,5 -17,5 p:95 16,6 15,5 17,5 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 1,E4 -1,E4 -16,E4 -15,E4 -17,E4 k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 1,E4 -1,E4 16,E4 15,E4 17,E4 g:235 46,7 50,7 -46,7 -50,7 35,7 29,7 -35,7 -29,7 c:340 15,3 17,3 -15,3 -17,3 l:444 3,7 -3,7 48,7 -48,7 47,7 49,7 -47,7 -49,7 19,7 13,7 -19,7 -13,7 R:481 1,3 16,3 -1,3 -16,3 u:700 14,3,15 31,3,15 33,3,17 18,3,17 -14,3,-15 -31,3,-15 -33,3,-17 -18,3,-17 A:830 17,3,16 15,3,16 -15,3,-16 -17,3,-16 17,3,1 -15,3,1 -17,3,-1 15,3,-1 # # K& KimAimD # G& Z # L& HC # U& NmpafsyafW # A& FyafsF // Roman Chess: 10x10 variant with two 'Archers' (non-royal Kings) Game: roman # PNBRQ.....AKpnbrq.....ak # fairy 10x10 6 4 3 5 7 8 5 3 4 6 6 4 3 5 7 8 5 3 4 6 p:100 -16,24 -16,6 -15,5 -17,5 p:100 16,24 16,6 15,5 17,5 a:290 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 n:310 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:332 15,3 17,3 -15,3 -17,3 R:475 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 k:-1 1,34,2 -1,34,-2 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 // Approximation to Wildebeest Chess, with Gnu and Camels. One-step castling is not possible. Game: almost-wildebeest # PNBRQ...................C......GKpnbrq...................c......gk # fairy 11x10 6 4 5 5 7 9 8 3 3 4 6 6 4 3 3 8 10 7 5 5 4 6 p:100 -16,C24 -16,24 -16,6 -15,5 -17,5 p:100 16,C24 16,24 16,6 15,5 17,5 c:223 47,7 49,7 -47,7 -49,7 19,7 13,7 -13,7 -19,7 n:313 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 b:333 15,3 17,3 -15,3 -17,3 R:473 1,3 16,3 -1,3 -16,3 Q:950 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 g:700 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7 k:-2 1,34,3 -1,34,-3 1,34,2 -1,34,-2 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 k:-2 1,34,3 -1,34,-3 1,34,2 -1,34,-2 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 # # P& fmWfceFifmW3iifmnD # C& C # G& NC # K& KisO2isO3isO4 // End of game file fairymax-5.0b/data/logo.png000066400000000000000000000223611266116003200157200ustar00rootroot00000000000000PNG  IHDRd2%W pHYsod vpAgd2kǤ4$,IDAThޕ{wVgνowE`e"Ŋb5XDb7łKQ#M,Q`(E)tX}gǹ5>\;gϝ3gf3/K_D00EӞ_E!dApHNo|g.< AH<x7O&pp'!a,X C*ƗʓED"L @!V,&!h5&fkX ab$#%ZI`L Xw]aM̤]b7'a;CZ<`}w&-^wa``"W@"/@FX@" EL@@ E[(  EaR@+b!E\b!"7H1XaEB aXb!!bi(h% VL(f!A0,fhZ/@ 8$FoH^  ,3*Q1 &6)", DH` FD1n4YAAD HCHO5H̯ O- }&b&P{j`ҍ_y@&$!6(z*f)h"bM!RԏB&XHHDDH&V$BIK[!"a!M4H 0DxRP1@g=& @@2c~'V0ʯ~:7 %zKf]s;n0pE>8d  hEgtd$`& HX J)Vw6n<=[RM׷}OZm7Ƒ Np*-DѦ=qv\+,;p[ i`,e^JI+gŎG;! )XfNp2  v *(+j! r*%yM? 6 @+ac-:' ^|_oމK (>eR#Y~%ֹEPAG_>*ǁUlCAGdup)V;-{;+TNhoЭs2wbg6X^~+T,P#nf RXjahM](tP %0 $ffV+xnNAP1xoe-!91E,D@.S'[{FʗJógiYw}駏|K{'LG~×/kPPWA`>?L:diXr7ҺϙzѴ˵$vizYAz\@$SNJG~zEZ$גvjpH>wθGu_w=ߘN-Y ZfT8˩lƖ\177qM W@t,c%frN|K:**BkM*be>tLUCPww "$b\8i0V"BQ8"H;߬z̸ud2yXG[V@"d-[&{_ Ҽn5sfs_4Z\1@_;6 "|Ǟ\vq<1DYT߅3O:AC bV!Cdn4|ܷ^"oECJDl;<_Zȇʶc/ ̺)P7 @+Ϯ(U V5jҐ&-J|a+lY!W ԕ51U8tOiiIuO9txUzf=ԓ74~nvWzʧN{䷗\ ]?g~%N"PB^ M fp2> C[lb7u?9/gEҝTQFOy&ʒqs@*2ԪfFYTEToέY'Vy{^Eywﮫ#k桇2 ]rW;72>' ^G/'LUZ֮Œ%Xȑ_~ : _\-ԮI}Rz7nfPb]]k%. Q67J m_>ӡ+ㅍ;^(;љ7F'_+9=aЪn}}~5kVS\C^$vv5{yW.=c"H_4q̟v̲ȦM#cT.|7j璊@JfHqD^[? IpV /<"`E}B,h{E0@8ik/TV2ʺN2pgk}?RY=ܑ+t O7o|QGK/뮽C"M;%%hHoo3tko~_ӉM> n~Ϸm|3XSr]$_Z hYZ[0pvE\M`pfX?f=ެ">R>6x6S1.෪٭ztP> ȺS+6μKwt;e|W; Oa%ghErPzBg" 1 ܕ0~)LVQStb%5>tZѣmg!-*~;tk _`FvΆF@72dMՔm竿W]rqu~)DHL A| ?|-7ρ1*8f O@fu@mV"9*^|JR'TDa"sZkh{/7ڲ|V%ZJIq͍nVc&Yޝw#NS?],חlf8\2)ZVlی!l;od#ڀT ;͋:n6aˎXX NQCL`lFqUR @ hGݾC"#o=WI׽7[9Uԇ)-pG\Ua_Ijh 9 e D{*}cFs΀=pXu "ٗ`M9K" ֔M^Nݭ)q\\VͳQ@҈ +۝T$"ZE;$l+6@}fkjǛuh.[2;⦾Vqw\r_?cC' Ng/6jΦq{rqL0uJN.z @4zu^H,fKMVQH!@z*UR:l<:T^#nrYm}N2@Z2vk ኒݳ;Bi[>^i';zol^EelyU51zoIoʥorw:}*U"@lXśD/:>!)$yYH+qEDX+SH'y]e[tW\Y|ɷe6ᮄ8nkgeux//hj6Y94~VPw,xw34mZnMlB_bU[ "Ƞ~7ְjukO^N:]*C !8k5d/I+VDz{snn\”Im=*:y8]+0L"we>dWXV,(<|([NWFLT]v͸m:i;Uvy$7dMy[*|dT-QKs 5DC D{5+!*7_U|Uםtyp:("RupEki:®E>&e+Zl9tNYJES(,ZKa7E 3uVZzeM>z|WGթ&iEB ]i zQ$ Eᠲ-XT=ySћ*x@eIīIjEDU,0?f!B< ,fd z85'W _\q ŠbtZ!<ǧN9F#I:oUDڏ=3lyC3gH/h%k%e/pB)To.Vh3*`-bQAZثYc*l(6š3" h+@h<<}?2-zO"Pz%d0}5@lSrS$QXL1Z"D LZ L)Դux$H6yڤA3HPpi0I SfxHZV}%@~/cvTo6!/PCX% x^RUDy%'MM.:z5ܤJLs#,0xY 3Folkp1$`D0'zں[R: B4Ѐ)i@`٫.Ao !`d86.ϲ-\ Y6wV8B6lFJp&eA (觨.SP3rY9{΋.أMJ@X1(`Ol+ @sѩ ǀi 6)@JJb(tL ͢=3W|q4 E!$ց@Y/ ~R^;zܗ\x}WVE Iīv5K<"u_fA, 1,)VWLAE~g 8d+U{שhm<󔎅 l>篕7O-jsq m:I[(>Xf;짻$T9ˉd:)wmm G})qr EZHை.YM|jM61dȝgSs2 W`@E4(KEB*dH2#PTV̜qZs^lE}|Ի/+J=|(Qᐒ#o {nۀvkDm_qg_vAбUWL%ζ-yE'i \٪,Pmi߿=*>h|nsVM*dXqM][)K}Qz]A[5gѩַ<._ՠ [l}[jKTu ^=L$47.}$3\{Oj`U{w-q__mG=B,?4#X42t?0VVymݹp~G*/M(⑟Z.G ^ 0Բm~njr:5v̛$OO9ʃ"0#>"(rPCQOg %3͢hzcSMNXqMf7lʼp7/' O"6|T| "3 ŋjOq9o~o빯>y]A_e句? Vl7)Ѻ=4&<&\w߼w/9da)lˣ<|ݼ# 7a^xOX#jAvfܵ> _3nAzPᰝjۺZ/>~f({rCʐa܊˛m[ ǎO](E|hːj%$ZCjUya5k?-.[(bИWgiI= ^W?Ơ;D@[oR>fS t> 4M@Q_>)yK.j˫\I 1EB®ȠvNjpS5P}o{ڴCUFklcVn_@]H'ޡ_&rE!):-[r3C,0nXl5@@QBo\  N0ӽzGPVͽ)m:[8!+#ŷ)sOm^Zjě}r߾wzGO:JA8VGeWl-pM%Klu=8f-яJ[E6UYP\XՐ rGn{~w^yչp)1蜸9v:Ꞛ'ދ'>V>/+'[eCBCоS%@,\TORs┐p#_TN͇kFpѼ'r{v!}g[`W ,.RX~ l` vXv>M4\j+bSP|dsUT{u:gBs!# ^FHG~S+{joht@_ZEys5* amپܲ9+}U4ɥZ_D7 /в;J|:Κ麺+7t<nZEvvfbWTZA8贫׭x9aGmg28"{sN<=va2Fktp)79 :P~>XF1Mۀ&ւ.Di8iBg$z!87AտzqA/?Eg)[$@ *D~y]w?ps>H~UJgPzЈ—*}:l7vxɥͷ>N'T5mpf?Hk* 0%R_Quǿdv+.<0vpv9w;T2A) #NWĎ-ө(.:cBM|fK1 Xa"•gh'#g&W=٦;<t^Á/+hS/J.MYl,E ͛dlf ~ ],]Hav$살""""aF_F\|3rhBTOs&+,TR![dV.@<캀&eؤ$k!>f gz^XvwvIs *@D4RAWs,{ږ;?oa wF_Ϛ>쉳;w6+3Ct+,&!Ah;hЭx,i v? Z녍CKuF+xiol I] M,,"Nk=jL&%Pةy{6kɁM_AcȀ.@aQs=a m&&?٥~+hK *HNG"0ڀ&;FVɜҦ1F ?oT^$}"{ƞ VxǁyBIG",&T@-攙љS0QHִ%![@O0@m$$ԞX#1 +x!€!/ "}+0D U 8 p43DsRÃu(a)[?Ce+sr%tEXtdate:create2014-09-12T18:12:21+02:00F%tEXtdate:modify2014-09-12T18:11:43+02:00+]IENDB`fairymax-5.0b/data/makruk.hash000066400000000000000000000022001266116003200163770ustar00rootroot0000000000000079810814:752b613c=-7995 0593bb0a:76e21832=-7995 4c0c66d6:6c5f733c=-7995 664f1151:60ad24e9=-7995 90735259:f4213c2b=-7995 6b0b6531:b73a8c78=-7995 4bad1972:157d831a=-7995 eea9ea6d:86734f88=-7995 c3edf05e:60d37ccf=-7995 664210c5:233831ba=-7995 6972e2d3:910ee947=-7995 7413432a:f64623b4=-7995 7df305dc:45d5c62b=-7995 58718bb8:7e791374=-7995 e31c9489:e9b45d35=-7995 a44ebb4c:4fe77158=-7995 107dd42e:0e0d48d5=-7995 7d448af3:06117aa2=-7995 27105d6f:bac9d28e=-7995 f60c2757:c59caf42=-7995 add1c0af:89b8d507=-7995 ae193a31:fed40d3f=-7995 84014d91:e1ef4e15=-7995 ca1dfd75:2314e6f7=-7995 6a1458d7:c43fc8e5=-7995 08bca616:1d9b065f=-7995 fee5f0cf:406e7916=-7995 e38cb9f1:41430da3=-7995 f7ad75aa:b2b4a80a=-7995 68f94879:62d5dbac=-7995 47b3e75a:7dc8e54a=-7995 1af24af9:9601be22=-7995 1e990593:d4fb5b4e=-7995 1c5b6f90:c528e66a=-7995 f5b5e304:e5d33842=-7995 d8513d27:ad078889=-7995 89ffd5ff:13ea08b0=-7995 54cd3c23:cc80cbef=-7995 6ef0096d:b014045b=-7995 14fe7120:b492a1b1=-7995 b81cf1eb:c968b50a=-7995 899108cb:8a7bb45e=-7995 a67747bb:21822187=-7995 697ecbce:6e7fb753=-7995 7790fd86:0a73da65=-7995 1725909f:7e4282dd=-7995 68319730:e943f4c2=-7995 a431cb24:b94e5557=-7995 fairymax-5.0b/data/maxqi.eng000066400000000000000000000000361266116003200160570ustar00rootroot00000000000000plugin spec 0.0 maxqi xiangqi fairymax-5.0b/data/qmax.ini000066400000000000000000000015561266116003200157240ustar00rootroot00000000000000version 4.8(w) 10x9 11 9 4 8 3 8 4 9 11 11 9 5 8 3 8 5 9 11 p:100 -1,7 p:100 1,7 k:-1 1,C07 16,C07 -1,C07 -16,C07 e:150 15,470 17,470 -15,470 -17,470 e:150 15,870 17,870 -15,870 -17,870 q:190 -1,7 16,7 -16,7 q:190 1,7 16,7 -16,7 A:200 15,C07 17,C07 -15,C07 -17,C07 h:450 16,1070 16,1F070 1,10070 1,FFFF0070 -16,1070 -16,1F070 -1,10070 -1,FFFF0070 C:460 1,BA 16,BA -1,BA -16,BA R:900 1,3 16,3 -1,3 -16,3 // Chinese Chess Game: xiangqi 10x9 11 9 4 8 3 8 4 9 11 11 9 5 8 3 8 5 9 11 p:100 -1,7 p:100 1,7 k:-1 1,C07 16,C07 -1,C07 -16,C07 e:150 15,470 17,470 -15,470 -17,470 e:150 15,870 17,870 -15,870 -17,870 q:190 -1,7 16,7 -16,7 q:190 1,7 16,7 -16,7 A:200 15,C07 17,C07 -15,C07 -17,C07 h:450 16,1070 16,1F070 1,10070 1,FFFF0070 -16,1070 -16,1F070 -1,10070 -1,FFFF0070 C:460 1,BA 16,BA -1,BA -16,BA R:900 1,3 16,3 -1,3 -16,3 // End of game file fairymax-5.0b/data/shamax.eng000066400000000000000000000000401266116003200162140ustar00rootroot00000000000000plugin spec 0.0 shamax shatranj fairymax-5.0b/fairymax.c000066400000000000000000001360441266116003200153310ustar00rootroot00000000000000/***************************************************************************/ /* Fairy-Max, */ /* Version of the sub-2KB (source) micro-Max Chess program, fused to a */ /* generic WinBoard interface, loading its move-generator tables from file */ /***************************************************************************/ /*****************************************************************/ /* LICENCE NOTIFICATION */ /* Fairy-Max 5.0 is free software, released in the public domain */ /* so that you have my permission do with it whatever you want, */ /* whether it is commercial or not, at your own risk. Those that */ /* are not comfortable with this, can also use or redistribute */ /* it under the GNU Public License or the MIT License. */ /* Note, however, that Fairy-Max can easily be configured through*/ /* its fmax.ini file to play Chess variants that are legally pro-*/ /* tected by patents, and that to do so would also require per- */ /* mission of the holders of such patents. No guarantees are */ /* given that Fairy-Max does anything in particular, or that it */ /* would not wreck the hardware it runs on, and running it is */ /* entirely for your own risk. H.G,Muller, author of Fairy-Max */ /*****************************************************************/ #define MULTIPATH #define VERSION "5.0b" #include #include #include #include #include #ifndef FAIRYDIR #define FAIRYDIR "." #endif #define INI_FILE FAIRYDIR "/fmax.ini" #ifdef WIN32 # include # define CPUtime 1000.*clock int Input() { // checks for waiting input in pipe static int init; static HANDLE inp; DWORD cnt; if(!init) inp = GetStdHandle(STD_INPUT_HANDLE); if(!PeekNamedPipe(inp, NULL, 0, NULL, &cnt, NULL)) return 1; return cnt; } #else # include # include # include # include int GetTickCount() // with thanks to Tord { struct timeval t; gettimeofday(&t, NULL); return t.tv_sec*1000 + t.tv_usec/1000; } double CPUtime() { // get CPU time used by process, converted to 'MILLICLOCKS' struct tms cpuTimes; static int cps = 0; if(!cps) cps = sysconf(_SC_CLK_TCK); times(&cpuTimes); return ((double)(cpuTimes.tms_utime + cpuTimes.tms_stime) * CLOCKS_PER_SEC * 1000)/cps; } int Input() { int cnt; if(ioctl(0, FIONREAD, &cnt)) return 1; return cnt; } #endif int StartKey; #define ANALYZE -2 #define EMPTY -1 #define WHITE 0 #define BLACK 16 #define STATE 256 /* The following macros indicate the differences between Fairy-Max and its */ /* dedicated Shatranj derivative ShaMax so that these can now be compiled */ /* from the same unified source file. */ /* Compile with gcc option -DSHATRANJ to build ShaMax. */ #ifdef SHATRANJ # define FAC 175 # define EG 13 # define NAME "ShaMax" # define SHAMAX(x) x # define FMAX(x) #else # define FAC 128 # define EG 10 # define NAME "Fairy-Max" # define SHAMAX(x) # define FMAX(x) x #endif /* make unique integer from engine move representation */ #define PACK_MOVE 256*K + L + (PromPiece << 16) + (GT<<24); /* convert intger argument back to engine move representation */ #define UNPACK_MOVE(A) K = (A)>>8 & 255; L = (A) & 255; PromPiece = (A)>>16 & 255; GT = (A)>>24 & 255; /* Global variables visible to engine. Normally they */ /* would be replaced by the names under which these */ /* are known to your engine, so that they can be */ /* manipulated directly by the interface. */ int Side; int Move; int PromPiece; int Result; int TimeLeft; int MovesLeft; int MaxDepth; int Post; int Fifty; int GameNr; int Randomize; int Resign; char Cambodian[80] = "makruk"; int Threshold = 800; int drawMoves = 50; int Score; int zone, pRank, popup; int prom, pm, gating, succession, hill; char piecename[32], piecetype[32], blacktype[32]; char selectedFairy[80]; char *inifile = INI_FILE; char info[999], hashfile[256]; int Ticks, tlim, Setup, SetupQ; int GameHistory[1024]; char HistoryBoards[1024][STATE], setupPosition[290]; int GamePtr, HistPtr; int map[1<<16]; #define RBITS 12 #define W while #define K(A,B) *(int*)(T+A+S*(B&31)) #define J(A) K(y+A,b[y])-K(x+A,u)-K(H+A,t) #define SETKEY(Key,A) for(Key=i=0;i<=BE;i++)Key+=K(i+A,b[i]) int U=(1<<23)-1; struct _ {int K,V;unsigned char X,Y,D,F;} *A; /* hash table, 16M+8 entries*/ int M=136,S=256,I=8e3,Q,O,K,N,j,R,J,Z,LL,GT, /* M=0x88 */ BW,BH,BE,sh,RR,ab,CONS,L,ep,stale,wk,bk,bareK,bareL,score,R2, pt[513], /* promotion bonus/upgrade */ w[16]={0,2,2,-1,7,8,12,23,7,5}, /* relative piece values */ o[256], oo[32], /* initial piece setup */ of[256], od[16]; /* 1st dir. in o[] per piece*/ signed char pl[32], b[1025], /* board: 16x8+dummy, + PST */ T[8200], /* hash translation table */ centr[32], n[]=".*XKNBRQEWFMACHG?x+knbrqewfmachg"; /* piece symbols on printout*/ int pv[10000],*sp=pv; // triangular array int margin; int seed=76596595; int Rand() { return (seed = 1103515245*seed + 12345)*150610563>>14; } void pboard() {int i; i=-1;W(++iD;m=a->V;X=a->F;Y=a->Y+S-1; /* resume at stored depth */ if(a->K-Z|z&S&&(X=8)|| /* miss: other pos. or empty*/ !(m<=q|X&4&&m>=l|X&2)) /* or window incompatible */ d=Y=0; /* start iter. from scratch */ if(X&1)return 0; /* busy-flag set: rep-draw */ *sp++=0; /* initialize empty PV */ X=a->X; /* start at best-move hint */ W(d++D<99)a->F=1,a->K=Z; /* mark hash entry 'busy' */ P=d>2&&l+I?D(16-k,-l,1-l,-e,S,2*S,d-3):I; /* search null move */ m=-P beta unconsidered:static eval */ SHAMAX( if(pl[k]<=1&pl[16-k]>1)m=I-1; ) /* bare king loses */ ab|=!(N++&4095)&&tlim>1e8&&Input(); /* node count (for timing) */ do{u=b[x]; /* scan board looking for */ if(u&&(u&16)==k) /* own piece (inefficient!)*/ {r=p=u&15; /* p = piece type (set r>0) */ if(hill&&w[p]<0&b[769+x])m=I,d=98; /* King on the hill: we won */ j=od[p]; /* first step vector f.piece*/ W(r=o[++j]) /* loop over directions o[] */ {A: /* resume normal after best */ flag=h?3:of[j]; /* move modes (for fairies) */ y=x;F=FF=G=S;rg=flag>>10&3;vf=32; /* (x,y)=move, (F,G)=castl.R*/ if(rg>p)rg=pt[x]&~u&2*u?(vf=0):1; do{ /* y traverses ray, or: */ H=y=h?Y^h:y+r; /* sneak in prev. best move */ if(flag&1<<8)H=y=(y&15)>13?y+BW:(y&15)>=BW?y-BW:y; /* cylinder board */ if(y<0|y>BE|(y&15)>=BW)break; /* board edge hit */ #ifdef MULTIPATH if(flag&1<<9) /* if multipath move */ {t=flag>>RBITS; /* get dir. stepped twice */ if(b[x+t]){if(b[y-2*t]|b[y-t])break;}else if(b[x+2*t]&&b[y-t])break; /* test if empty path exists*/ } #endif m=E>9^511)?H:z&S-1; /* shift capt.sqr. H if e.p.*/ t=b[H]; if(flag&1+!t) /* mode (capt/nonc) allowed?*/ {if(t&&(t&16)==k)break; /* capture own */ i=w[t&15]+((t&192)>>sh); /* value of capt. piece t */ if(i<0&&(pl[t&31]<2|| /* K capture, (of last K), */ t>>3&kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* or duple check: cutoff*/ if(m>=l&d>1)goto C; /* abort on fail high */ v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/ if(d-!t>1) /*** all captures if d=2 ***/ {v=gt=0;G: /* retry move with gating */ v+=centr[p]*(b[x+513]-b[y+513]); /* center positional pts. */ if(G-S)b[FF]=(rk=b[G])|32,v+=20; /* castling: put R & score */ b[G]=b[H]=0;b[x]=gt;b[y]=u|32; /* do move, set non-virgin */ pl[t&31]-=!!t; /* updat victim piece count */ v-=w[p]>0|R2); /*** freeze K in mid-game ***/ if(p<3) /* pawns: */ {v-=9*((b[x-2]!=u)+ /* structure, undefended */ (b[x+2]!=u) /* squares plus bias */ +(w[b[x^16]&15]<0)) /*** cling to magnetic K ***/ +(R-76>>2); /* end-game Pawn-push bonus */ b[y]+=V=u&32?pt[y]:0; /*upgrade P or convert to Q */ V>>=sh; /* for Shatranj promo to F */ i+=V+abs(w[b[y]&15])-w[p]; /* promotion / passer bonus */ } if(z&S){ if(map[x+S*y]){v=-I;goto S;} /* skip if excluded move */ if(GamePtr<6&Randomize)v+=(Rand()>>10&31)-16; /* randomize */ } J+=J(0);Z+=J(4)+G-S; SHAMAX( pl[k]-=!!t; ) /* count pieces per side */ v+=e+i;V=m>q?m:q; /*** new eval & alpha ****/ if(z&S)V=m-margin>q?m-margin:q; /* multiPV */ C=d-1-(d>5&p>2&!t&!h); /* nw depth, reduce non-cpt.*/ C=R0?C:d; /* extend 1 ply if in-check */ if(bareK)C=p==bareK&&2&b[769+x]?d+1:d-1; /* corner-leave extension */ do s=C>2|v>V?-D(16-k,-l,-V,-v,/*** futility, recursive eval. of reply */ F,y&255,C):v; W(s>q&++CV&vD=99;a->V=0; /* lock game in hash as draw*/ R2-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; if(centr[p]>2)bareL=y; /* remember location bare K */ sp=ps; return l;} /* & not in check, signal */ v=m; /* (prevent fail-lows on */ } /* K-capt. replies) */ SHAMAX( pl[k]+=!!t; ) S:pl[t&31]+=!!t; b[G]=rk;b[FF]=b[y]=0;b[x]=u;b[H]=t; /* undo move,G can be dummy */ } /* if non-castling */ if(z&S&&!ab&K==I&d>2&v>V&v I-S ? 100000+I-v : v < S-I ? -100000-I-v : v); printf("%8d %10d",(GetTickCount()-Ticks)/10,N); while(*p){X=*p>>9;Y=*p++; printf(" %c%d%c%d",'a'+(X&15),BH-(X>>4&15)-(BH==10),'a'+(Y&15),BH-(Y>>4&15)-(BH==10));} printf("\n");fflush(stdout); }GT=gt; /* In root, remember gated */ } if(v>m) /* new best, update max,best*/ m=v,X=x,Y=y|S&F; /* mark non-double with S */ if(gating&&!(u&32)&&p>2&&d-!t>1){ /* virgin non-Pawn: gate */ pl[(gt|=k+40)-27]++; /* prev. gated back in hand */ if(m>=l)goto C; /* loop skips cutoff :-( */ W(++gtF&=6;sp=ps;return 0;} /* unwind search to abort */ if(h){h=0;goto A;} /* redo after doing old best*/ } s=t&&2&~rg|~t&16^k;v=r^flag>>RBITS; /* platform & toggled vector*/ if(flag&15^4|u&vf|| /* no double or moved before*/ p>2&!(flag&128)&& /* no P & no virgin jump, */ ((b[G=x&~15|(r>0)*(BW-1)]^32)<33 /* no virgin R in corner G, */ ||b[G-r]|b[G-2*r]|b[FF=y+v-r]|b[y+r]) /* no 2 empty sq. next to R */ )t+=flag&4; /* fake capt. for nonsliding*/ else if(flag&64)t=flag&128?0:t,flag&=63; /* e.p-immune initial step */ else F=y+(p<3)*(ep&~u<<8); /* set e.p. rights */ if(s&&flag&8&&!(y=rg&1?y-r:y,t=0) /* hoppers go to next phase */ ||!(flag&128)&&!rg--) /* zig-zag piece? (w. delay)*/ r=v,flag^=flag>>4&15; /* alternate vector & mode */ }W(!t); /* if not capt. continue ray*/ }} if((++x&15)>=BW)x=x>BE?0:x+16&~15; /* next sqr. of board, wrap */ }W(x-B); C:FMAX( m=m+stale|P==I?m:(X=Y=0); ) /* if stalemate, draw-score */ if(a->D<99) /* protect game history */ a->K=Z,a->V=m,a->D=d,a->X=X, /* always store in hash tab */ a->F=4*(m>q)|2*(mY=Y&S?Y+1:0; /* move, type (bound/exact),*/ } /* encoded in X 2,4 bits */ if(z&4*S)K=X,L=Y&~S; sp=ps; return m+=m 1) /* third repeat */ { if(mode != EMPTY) printf("1/2-1/2 {Draw by repetition}\n"); return 1; } differs: ; } K=I;ab=0; cnt = D(s,-I,I,Q,O,LL|4*S,3); #ifdef SHATRANJ if(pl[s]==1 && pl[16-s]==1) { printf("1/2-1/2 {Insufficient mating material}\n"); return 4; } if(pl[s]<=1 && pl[16-s]>1) { if (s == BLACK) printf("0-1 {Bare King}\n"); else printf("1-0 {Bare King}\n"); return 5; } #else if(cnt>-I+1 && K==0 && L==0) { printf("1/2-1/2 {Stalemate}\n"); return 2; } #endif if(cnt==-I+1) { if (s == WHITE) printf("0-1 {Black mates}\n"); else { if(succession) { // suppress loss claim if black might be able to replace its King by promotion for(j=0;j= 2*drawMoves) { if(mode != EMPTY) printf("1/2-1/2 {Draw by fifty move rule}\n"); return 4; } return 0; } void InitEngine() { N=32*S+7;W(N-->S+3)T[N]=Rand()>>9; seed=GetTickCount(); } void InitGame() { int i,k=0; Side = WHITE; Q=0; O=S; Fifty = 0; R = 0; for(i=0;i<16*BH;i++)b[i]=0; for(i=0;i<32;i++)pl[i]=0; K=BW;W(K--) {b[K]=oo[K+16]+16;b[K+(BH-1)*16]=oo[K];b[K+16*pRank]=18;b[K+(BH-1-pRank)*16]=1; /* initial board setup*/ pl[oo[K+16]+16]++;pl[oo[K]]++;pl[18]++;pl[1]++; if(w[oo[K+16]+16] == -1)pl[oo[K+16]+16]=1; if(w[oo[K]] == -1)pl[oo[K]]=1; L=BH;W(L--)b[16*L+K+513]=(K-BW/2+hill/2.)*(K-BW/2+hill/2.)+(L-(BH-1)/2.)*(L-(BH-1)/2.),pt[16*L+K]=0; /* center-pts table */ pt[K+16]=pt[K+32]=pt[K+(BH-3)*16]=pt[K+(BH-2)*16]=64;pt[K+16*zone]=6-128;pt[K+(BH-1-zone)*16]=5-128; /* promotion bonus & piece upgrade */ if(pRank == 3) L=oo[K-(w[oo[K]]<0)],pt[K]=L-129,pt[K+(BH-1)*16]=L-130; } b[769+16*3+BW/2]=b[769+16*4+BW/2]=b[769+16*3+BW/2-1]=b[769+16*4+BW/2-1]=1; /* hill */ b[769]=b[769+16*(BH-1)]=b[769+16*(BH-1)+BW-1]=b[769+BW-1]=2; /* corners */ for(i=0; i12 || BH>16) { printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); } BE = (BH-1)*16 + BW-1; CONS = 799 + 16*(BH-8); // highest valid square number and move-conversion constant i = 1; fscanf(f, "=%d", &i); zone = i - 1; // new method to indicate deviant zone depth for(i=0; i=2 || fscanf(f,"%c:%d",&c, w+i+1)==2) { if(c) { od[++i]=j; centr[i] = c>='a'; blacktype[c&31]=i; piecename[i]=c&31; if(piecetype[c&31]==0) piecetype[c&31]=i; // only first succession |= w[i] < -4; // expendable royalty; assume we can promote to it if(w[i]<0) wk=bk, bk=i; // remember royals } if(step2 != 666) of[j] += (step2 ^ o[j]) << RBITS, step2 = 666; // compute toggle-vector from 3rd move parameter j++; o[j]=0; /* printf("# c='%c' i=%d od[i]=%d j=%d (%3d,%8x)\n",c?c:' ',i,od[i],j,o[j-1],of[j-1]); /**/ c=0; if(i>15 || j>255) break; } if(BH == 10 && o[0] == -16 && of[0] & 0xC00) ep += 16<<9; // pawn with triple-push sh = w[7] < 250 ? 3 : 0; hill = (w[3] == -2); stale -= (w[9] == -2); pRank = (zone ? zone : 1); if(zone < 0) pRank = -1-zone, zone = 0; // negative =N suffix is kludge for configuring Pawn rank if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN if(ptc == 2) printf("setup (%s) ", pieceToChar); else printf("setup (%s) %dx%d+0_%s ", pieceToChar, BW, BH, parent); for(i=0; i 1 && !strcmp(argv[1], "-v")) argc++, argv--, printf("%s\n", VERSION), exit(0); if(argc>1 && sscanf(argv[1], "%d", &m)==1) { U = (1<1) inifile = argv[1]; signal(SIGINT, SIG_IGN); setvbuf(stdin, NULL, _IONBF, 0); // suppress input buffering printf("tellics say " NAME " " VERSION "\n"); printf("tellics say by H.G. Muller\n"); InitEngine(); LoadGame(NULL); InitGame(); Computer = EMPTY; MaxTime = 10000; /* 10 sec */ MaxDepth = 30; /* maximum depth of your search */ for (;;) { fflush(stdout); PromPiece = 0; /* Always promote to Queen ourselves */ for(N=K=0;K>4; if(!K|K==BW-1&&!L|L==BH-1&&b[513+bareL]) for(i=0;i20 ? 1 : 22-R; Ticks = GetTickCount(); if (Side == Computer) { /* think up & do move, measure time used */ /* it is the responsibility of the engine */ /* to control its search time based on */ /* MovesLeft, TimeLeft, MaxMoves, TimeInc */ /* Next 'MovesLeft' moves have to be done */ /* within TimeLeft+(MovesLeft-1)*TimeInc */ /* If MovesLeft<0 all remaining moves of */ /* the game have to be done in this time. */ /* If MaxMoves=1 any leftover time is lost*/ cpuT = CPUtime(); printf("# times @ %u\n", Ticks); m = MovesLeft<=0 ? 40 : MovesLeft; tlim = (0.6-0.06*(BW-8))*(TimeLeft+(m-1)*TimeInc)/(m+7); if(tlim>TimeLeft/15) tlim = TimeLeft/15; printf("# %d+%d pieces, centr = (%d,%d) R=%d\n", N&63, N>>8, centr[wk], centr[bk], R); if(bareK|RR>4^R>4) // with bare King or after switching on or off null move for(i=0;i<=U;i++)if(A[i].D<99&&abs(A[i].V)>4)-(BH==10), 'a'+(L&15),BH-(L>>4)-(BH==10)); if(prom)printf("%c",piecename[prom]+'a'-1); printf("\n"); /* time-control accounting */ TimeLeft -= m; TimeLeft += TimeInc; if(--MovesLeft == 0) { MovesLeft = MaxMoves; if(MaxMoves == 1) TimeLeft = MaxTime; else TimeLeft += MaxTime; } GameHistory[GamePtr++] = PACK_MOVE; CopyBoard(HistPtr=HistPtr+1&1023); if(Resign && Score <= -Threshold) { printf("resign\n"); Computer=EMPTY; } else if(PrintResult(Side, Computer)) Computer = EMPTY; } else { if(!PrintResult(Side, Computer)) printf("resign { refuses own move }\n"); Computer = EMPTY; } continue; } if(Computer == ANALYZE) { if(popup-- == 1) popup++, printf("askuser remember Save score in hash file (OK/Cancel)?\n"); N=ab=0;K=I;tlim=1e9; D(Side,-I,I,Q,O,LL|S,3); } if (!fgets(line, 256, stdin)) return 1; if (line[0] == '\n') continue; sscanf(line, "%s", command); if (!strcmp(command, "xboard")) continue; if (!strcmp(command, "protover")) { printf("feature myname=\"" NAME " " VERSION "\"\n"); printf("feature memory=1 exclude=1\n"); printf("feature setboard=0 xedit=1 ping=1 done=0\n"); printf("feature variants=\""); PrintVariants(0); printf("\"\n"); PrintOptions(); continue; } if (!strcmp(command, "ping")) { int nr=0; sscanf(line, "ping %d", &nr); printf("pong %d\n", nr); continue; } if (!strcmp(command, "p")) { pboard(); continue; } if (!strcmp(command, "memory")) { int mem, mask; sscanf(line+6, "%d", &mem); mem = (mem*1024*1024)/12; // max nr of hash entries mask = 0x3FFFFFF; while(mask > mem) mask >>= 1; if(mask != U) { free(A); U = mask; A = (struct _ *) calloc(U+1, sizeof(struct _)); } continue; } # define CLEAR(X) for(i=0; i 0); continue; } if (!strcmp(command, "white")) { /* set white to move in current position */ if(Side == BLACK) Q = -Q; Side = WHITE; Computer = BLACK; continue; } if (!strcmp(command, "black")) { /* set blck to move in current position */ if(Side == WHITE) Q = -Q; Side = BLACK; Computer = WHITE; continue; } if (!strcmp(command, "st")) { /* move-on-the-bell mode */ /* indicated by MaxMoves = 1 */ sscanf(line, "st %d", &MaxTime); MovesLeft = MaxMoves = 1; TimeLeft = MaxTime *= 1000; TimeInc = 0; continue; } if (!strcmp(command, "sd")) { /* set depth limit (remains in force */ /* until next 'sd n' command) */ sscanf(line, "sd %d", &MaxDepth); MaxDepth += 2; /* QS depth */ continue; } if (!strcmp(command, "level")) { /* normal or blitz time control */ sec = 0; if(sscanf(line, "level %d %d %d", &MaxMoves, &MaxTime, &TimeInc)!=3 && sscanf(line, "level %d %d:%d %d", &MaxMoves, &MaxTime, &sec, &TimeInc)!=4) continue; MovesLeft = MaxMoves; TimeLeft = MaxTime = 60000*MaxTime + 1000*sec; TimeInc *= 1000; continue; } if (!strcmp(command, "time")) { /* set time left on clock */ sscanf(line, "time %d", &TimeLeft); TimeLeft *= 10; /* centi-sec to ms */ continue; } if (!strcmp(command, "otim")) { /* opponent's time (not kept, so ignore) */ continue; } if (!strcmp(command, "easy")) { continue; } if (!strcmp(command, "hard")) { continue; } if (!strcmp(command, "accepted")) { continue; } if (!strcmp(command, "rejected")) { continue; } if (!strcmp(command, "random")) { Randomize = !Randomize; continue; } if (!strcmp(command, "remember")) { FILE *f = fopen(hashfile, "a"); // add current position to persistent hash sscanf(line+8, "%d", &score); // user can overrule score if(f) fprintf(f, "%08x:%08x=%d\n", J+(S+Side)*O, Z, score), fclose(f); popup = 2; // suppresses repeat of popup on restart of analysis search continue; } if (!strcmp(command, "option")) { int i; static char filename[80]; if(sscanf(line+7, "Resign=%d", &Resign) == 1) continue; if(sscanf(line+7, "Resign Threshold=%d", &Threshold) == 1) continue; if(sscanf(line+7, "Ini File=%s", filename) == 1) { inifile = filename; continue; } if(sscanf(line+7, "Clear Hash%c", &c) == 1) for(i=0; i<=U; i++) A->K = 0; if(sscanf(line+7, "Info%c", &c) == 1) printf("telluser %s\n", info+3); if(sscanf(line+7, "MultiVariation Margin=%d", &margin) == 1) continue; if(sscanf(line+7, "Variant fairy selects=%s", selectedFairy+6) == 1) continue; if(sscanf(line+7, "Makruk rules=%s", Cambodian) == 1) continue; if(sscanf(line+7, "Claim draw after=%d", &drawMoves) == 1) continue; if(sscanf(line+7, "Automatic persistent-hash dialog=%d", &popup) == 1) continue; if(sscanf(line+7, "Save in hash file%c", &c) == 1 && Computer == ANALYZE) { FILE *f = fopen(hashfile, "a"); // add current position to persistent hash if(f) fprintf(f, "%08x:%08x=%d\n", J+(S+Side)*O, Z, score), fclose(f); } continue; } if (!strcmp(command, "go")) { /* set computer to play current side to move */ Computer = Side; MovesLeft = -(GamePtr+(Side==WHITE)>>1); while(MaxMoves>0 && MovesLeft<=0) MovesLeft += MaxMoves; continue; } if (!strcmp(command, "hint")) { Ticks = GetTickCount(); tlim = 1000; ab = 0; D(Side,-I,I,Q,O,LL|4*S,6); if (K==0 && L==0) continue; printf("Hint: "); printf("%c%d%c%d",'a'+(K&15),BH-(K>>4)-(BH==10), 'a'+(L&15),BH-(L>>4)-(BH==10)); printf("\n"); continue; } if (!strcmp(command, "undo") && (nr=1) || !strcmp(command, "remove") && (nr=2) ) { /* 'take back' moves by replaying game */ /* from history until desired ply */ if (GamePtr - nr < 0) continue; GamePtr -= nr; HistPtr -= nr; /* erase history boards */ while(nr-- > 0) for(m=0; m= 'A' && m <= 'Z' && piecetype[m&31]) { p = (color == WHITE ? piecetype : blacktype)[line[0]&31]; if(line[1] == '@') { // stuff holdings pl[color+p+5] = m = line[2] - '0'; pl[BLACK+WHITE-color]+=m;pl[p+color]+=m; Q+=m*w[p]; R+=m*(w[p]/FAC); continue; } else if(line[1] >= 'a' && line[1] <= 'a'+BW-1 && line[2] >= '0' && line[2] <= '0'+BH) { line[2] = '0' + atoi(line + 2) + (BH==10); // allow 2-digit rank m = line[1]-16*line[2]+CONS; r = m & 0xF0; switch(p) { case 1: case 2: if(color==WHITE) b[m]=r==0x10?161:r==0x20?97:r==16*(BH-2)?1:33, Q+=w[1]+(r==0x10?128:r==0x20?64:0); else b[m]=r==16*(BH-2)?178:r==16*(BH-3)?114:r==0x10?18:50, Q+=w[2]+(r==16*(BH-2)?128:r==16*(BH-3)?64:0); break; default: b[m]=p+color+32; // assume non-virgin if(color==BLACK && m<0x10 && p==oo[m+16] || // but make virgin on original square color==WHITE && m>=16*(BH-1) && p==oo[m-16*(BH-1)]) b[m] -= 32; if(w[p]<0) { // Royal piece on original square: virgin Q-=w[p]; // assume value was flipped to indicate royalty if(pl[p+color])R-=w[p]/FAC; // capturable King, add to material } else { Q+=w[p]; R+=w[p]/FAC; } case 0: // undefined piece, ignore break; } pl[BLACK+WHITE-color]++;pl[p+color]++; if(w[p+color] == -1)pl[p+color]=1; // fake we have one if value = -1, to thwart extinction condition continue; } } } if(Side != color) Q = -Q; GamePtr = HistPtr = 0; Setup = 1; SetupQ = Q; // start anew for(i=0; iL ? i-1 : i+2; } if(w[GT&15] < -1) pl[GT&31]++, J+=89729; // promotion to royal piece if((b[K]&15) < 3) GT = 0; // Pawn => true promotion rather than gating ab=0; if(D(Side,-I,I,Q,O,LL|9*S,3)!=I) { /* did have move syntax, but illegal move */ printf("Illegal move:%s\n", line); } else { /* legal move, perform it */ if(i >= 0) b[i]=b[K],b[K]=0; // reverse Seirawan gating GameHistory[GamePtr++] = PACK_MOVE; Side ^= BLACK^WHITE; CopyBoard(HistPtr=HistPtr+1&1023); if(PrintResult(Side, Computer) && Computer != ANALYZE) Computer = EMPTY; } } } return 0; } fairymax-5.0b/fairymax.pod000066400000000000000000000213001266116003200156550ustar00rootroot00000000000000=head1 NAME fairymax - xboard-compatible chess and chess-variant engine 'Fairy-Max' =head1 SYNOPSIS B [hashSize] [iniFile] B [hashSize] [iniFile] B [hashSize] [iniFile] =head1 DESCRIPTION B is a program that plays chess and chess variants. It uses the xboard/winboard chess-engine protocol to communicate. Apart from 'regular' chess (also known as the Mad-Queen variant), it can play Capablanca chess, gothic chess, janus chess, knightmate, cylinder chess, berolina chess, superchess, makruk (Thai chess, and also some of its variants, Cambodian chess (Ouk), asean chess and ai-wok), courier chess, Seirawan chess, Spartan chess, falcon chess, great shatranj, team-mate chess, charge of the light brigade, king of the hill, bifurcator chess, Los-Alamos chess, Mexican chess, Ciccolini's chess, grande acedrex, wildebeest chess (almost), shuffle chess without castling and chess with different armies (all combinations of the FIDE, Clobberers, Nutters and Rookies armies). Fairy-Max can be easily configured by the user to play other variants as well, by modifying the ini file. This ini file describes the rules of movement of the participating pieces and the initial board setup. Fairy-Max can also play shatranj, but in this case is not aware of the shatranj rule that a bare king loses. So it might play sub-optimally in the late end-game. A version of Fairy-Max adapted to implement the baring rule (and the rule that stalemate is a win) is available under the name B. Grande Acedrex and Courier Chess might also have had a baring rule, so you may want to play these with shamax instead of fairymax too. Similarly, a version of Fairy-Max adapted to play Xiang Qi (Chinese Chess) is included in the fairymax package as well, under the name B. B is a derivative of the world's (once) smallest chess program (source-code wise), micro-Max. The latter measures less that 2000 characters, (about 100 code lines), and has a computer rating of around 2050 on the CCRL rating list. Although this is about 1000 rating points behind the world champion, micro-Max still makes a quite tough opponent even for club players, although it is not unbeatable. The main difference between micro-Max and Fairy-Max is that the latter loads its move-generator tables, which specify how the various pieces move, from an external file, so it can be easily adapted to incorporate un-orthodox pieces. For ease of use of the artificial-intelligence, Fairy-Max is equipped with I/O routines that allow it to run with the xboard graphical user interface. See xboard(6) for instructions about how to use B through xboard. To start up quickly, you just need the command: B. Note that to be able to play the chess variants, it is recommended to use the latest XBoard version, as some of the recently added variants will use features not supported by older XBoard versions (in particular allowing an engine to reconfigure XBoard's ideas on the initial setup and how the pieces move). Problems with older XBoard versions might range from only being able to play the variant with legality testing switched off, inability to display some of the unorthodox pieces in board sizes other than B, B or B, not recognizing variants with non-standard names, to refusing even names that by now are standard XBoard variants. For some variants even the name is unknown to XBoard, and they are all grouped under the catchall name 'fairy'. Which variant is played by Fairy-Max when XBoard is set to 'fairy', can be determined by a combobox control in the XBoard 'Engine Settings' menu dialog. This currently applies to the various army combinations of chess with different armies. After having set this B option, activating XBoard's B menu when already in variant fairy, or selecting fairy from the B menu dialog will then start the selected game. Fairymax supports multi-PV mode: by specifying a non-zero multi-PV margin in the Engine-Settings dialog of XBoard, Fairy-Max will not only print the principal variation for the best move, but also for every move that approaches the score of this best move to within the set margin. (If it does not find the best move on the first try, this might lead to printing of a few extra lines below the threshold.) Fairy-Max now also supports analysis mode, and exclusion of moves from the analysis. The fmax.ini file from which Fairy-Max by default takes the piece and game definitions is a self-documenting text file, which contains instructions for how to define new pieces and chess variants. In addition it contains an extensive list of pre-defined pieces, incuding many not occurring in any of the pre-defined variants, which the user can draw on to define his own variants. Amongst the move types supported by Fairy-Max are normal leaper and slider moves, (e.g. knight and rook), divergent moves (i.e. capture and non-capture moves can be different), hoppers (which jump over other pieces, such as the Chinese cannon or the grasshopper), lame leapers (the move of which can be blocked on squares they cannot move to, such as the Chinese horse and elephant), limited-range sliders (upto range 5), and any combination thereof, in every possible direction. The board width is configurable upto a width of 14 files, and cylindrical boards (where left and right edge connect) are supported as well. The board height can be configured up to 16 ranks. =head1 OPTIONS =over 8 =item B If the first argument to fairymax is numeric, it is taken as an indicator for the amount of memory Fairy-Max is allowed to use for its internal hash table. The default value for this argument, 22, would result in a memory usage of 48MB. Each next-higher number doubles the memory usage, each next-lower halves it. Running with less than 6MB (i.e. argument 19) is not recommended. When fairymax is running under xboard 4.3.15 or later the hash-table size can be set through the xboard menus, making this argument superfluous. =item B A second or non-numeric first argument is taken as a filename. Fairy-Max will use the mentioned file in stead of its default fmax.ini file to define the movement of pieces and initial setup of the variants. This makes it easier to define your own variants. =item B Fairy-Max also supports some options that can only be set interactively, though XBoard's engine settings menu dialog. These include a setting to further define -variant fairy, (e.g. which armies to pit against each other in chess with different armies), and whether makruk is to be played with Thai or Cambodian rules (the latter requiring XBoard's legality testing to be switched off!). You can also enable resigning, and set a score threshold for when Fairy-Max should do it, and define the already mentioned multi-PV margin there. An 'Info' button in the settings dialog makes XBoard pop up a window with some info about the currently selected variant. =item B Some of the interactive options can be used to store the current position in a file bearing the name of the variant being played, with the extension '.hash' added to it, during analysis. Positions in that file will be loaded into Fairy-Max' hash table before every game, protected from overwrite. This can be used to create an opening or end-game book for the variant. The B button is convenient for saving the occasional position. For saving many positions in a row the option B can be ticked. This pops up a dialog at the start of every analysis search, in which the user then just has to press 'OK' to put the score from the analysis into the hash file. If a number is typed in that dialog before pressing 'OK', the position will be saved with that score (in centi-Pawn) rather than the score determined by the engine's own analysis. This can for instance be used to discourage opening lines the engine overrates. The file will be created in the current directory, but at the start of a game both this file, as well as one in Fairy-Max' private data files, will be loaded. The install does contain such a persistent hash file for makruk, to help Fairy-Max find the checkmate in the 'difficult' corners of the KMMMK and KNMMK (with like M) end-games. =back =head1 AVAILABILITY At http://hgm.nubati.net/cgi-bin/gitweb.cgi the source code can be obtained. =head1 SEE ALSO xboard(6) explanations: http://www.chessvariants.org/index/msdisplay.php?itemid=MSfairy-max micro-Max: http://home.hccnet.nl/h.g.muller/max-src2.html XBoard: http://hgm.nubati.net =head1 STANDARDS WinBoard, B(6) interface ("Chess Engine Communication Protocol") =head1 AUTHOR H.G.Muller . This manual page was generated with pod2man(1). fairymax-5.0b/maxqi.c000066400000000000000000001037631266116003200146320ustar00rootroot00000000000000/***************************************************************************/ /* MaxQi, */ /* Version of the sub-2KB (source) micro-Max Chess program, fused to a */ /* generic WinBoard interface, loading its move-generator tables from file */ /* Adapted to play Xiang Qi, which required rather specialized changes */ /***************************************************************************/ /* micro-Max version 4.8 (~1950 characters) features: */ /* - recursive negamax search */ /* - all-capture quiescence search with MVV/LVA priority */ /* - (internal) iterative deepening */ /* - best-move-first 'sorting' */ /* - a hash table storing score and best move */ /* - futility pruning */ /* - king safety through magnetic frozen king */ /* - null-move pruning */ /* - Late-move reductions */ /* - full FIDE rules (expt minor promotion) and move-legality checking */ /* - keep hash + rep-draw detect */ /* - end-game Pawn-push bonus, new piece values, gradual promotion */ /***************************************************************************/ /* This version reads the piece description from a file fmax.ini */ /* The format supports many fairy pieces, including hoppers. */ /* f) now supports 15 piece types, by requisitioning WHITE bit */ /* g) supports larger board width. */ /* h) castling bug ('in-check by non-captures') corrected */ /* i) rep-draw bug ('side-to-move') corrected */ /* k) allow user underpromotions, recognize & ignore 'variant' command */ /* l) edit bug corrected (i & j file clear) */ /* m) piece values no longer quantized, game-stage counting bug corrected */ /* n) edit-menu K-side castling bug corrected. */ /* o) retrieve the requested variant from the .ini file */ /* p) clear hash table on variant switch */ /* q) reduced piece-material count for better Pawn push */ /* r) hash-table bug corrected (X still ORed with flags) */ /* s) Bug that prevented initialization center points corrected */ /* t) castling bug after edit fixed */ /* u) converted to protocol 2; ping implemented */ /* v) white e.p. rights hash bug fixed; */ /* w) piece indicators programable, multi-path support */ /* x) e.p. changed to support Berolina Pawns */ /* y) capture vlue of 6-7th-rank Pawn reduced in Shatranj */ /* z) bug in promotion input corrected */ /* A) stalemate-detection bug in printResult fixed */ /* B) Invalidate hash on game-level promotion (might be under-promotion!) */ /* C) King move evaluation based on negative piece value in stead of nr */ /* D) WB memory command added, undo fixed */ /* E) 15th piece read in */ /* F) accepts ini fileargument */ /* Xiang Qi adaptations: */ /* orient board sideways for easy implementation of King-facing rule */ /* allow board to have 9 rows (= files) */ /* add array for specifying board zones */ /* add zone limiter for each piece */ /* change promotion code to act when crossing river */ /* remove stalemate code */ /* G) o[] and oo[] made int, to work on big-endian machines */ /***************************************************************************/ /*****************************************************************/ /* LICENCE NOTIFICATION */ /* Fairy-Max 4.8 is free software, and you have my permission do */ /* with it whatever you want, whether it is commercial or not. */ /* Note, however, that Fairy-Max can easily be configured through*/ /* its fmax.ini file to play Chess variants that are legally pro-*/ /* tected by patents, and that to do so would also require per- */ /* mission of the holders of such patents. No guarantees are */ /* given that Fairy-Max does anything in particular, or that it */ /* would not wreck the hardware it runs on, and running it is */ /* entirely for your own risk. H.G,Muller, author of Fairy-Max */ /*****************************************************************/ #define MULTIPATH /* fused to generic Winboard driver */ #include #include #include #include #include #ifndef WIN32 #include int GetTickCount() // with thanks to Tord { struct timeval t; gettimeofday(&t, NULL); return t.tv_sec*1000 + t.tv_usec/1000; } #ifndef INI_FILE #define INI_FILE "qmax.ini" #endif #else #include #define INI_FILE "qmax.ini" #endif int StartKey; #define EMPTY -1 #define WHITE 0 #define BLACK 16 #define STATE 128 #define FAC 128 /* make unique integer from engine move representation */ #define PACK_MOVE 256*K + L; /* convert intger argument back to engine move representation */ #define UNPACK_MOVE(A) K = (A)>>8 & 255; L = (A) & 255; /* Global variables visible to engine. Normally they */ /* would be replaced by the names under which these */ /* are known to your engine, so that they can be */ /* manipulated directly by the interface. */ int Side; int Move; int PromPiece; int Result; int TimeLeft; int MovesLeft; int MaxDepth; int Post; int Fifty; int UnderProm; int GameNr; char piecename[32], piecetype[32], defaultchar[]=".PPKNBRQEWFMACHG"; char *inifile = INI_FILE; int Ticks, tlim, Setup, SetupQ; int GameHistory[1024]; char HistoryBoards[1024][STATE], setupPosition[129]; int GamePtr, HistPtr; #define W while #define K(A,B) *(int*)(T+A+((B&31)<<8)) #define J(A) K(y+A,b[y])-K(x+A,u)-K(y+A,t) int U=(1<<23)-1; struct _ {int K,V;char X,Y,D,F;} *A; /* hash table, 16M+8 entries*/ int M=136,S=128,I=8e3,Q,O,K,N,j,R,J,Z,LL,L, /* M=0x88 */ BW,BH,sh, w[16]={0,2,2,-1,7,8,12,23,7,5}, /* relative piece values */ o[256], oo[32], /* initial piece setup */ of[256], od[16]; /* 1st dir. in o[] per piece*/ signed char b[513], /* board: 16x8+dummy, + PST */ T[8200], /* hash translation table */ centr[32], n[]=".P*KEEQQAHCR????x+pkeeqqahcr????"; /* piece symbols on printout*/ char zn[] = { /* zones of xiangqi board */ 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0, 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0, 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0, 0,0,0,1,1,2,2,0,0,0, 0,0,0,0,0,0, 0,0,0,1,1,2,2,0,0,0, 0,0,0,0,0,0, 0,0,0,1,1,2,2,0,0,0, 0,0,0,0,0,0, 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0, 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0, 1,1,1,1,1,2,2,2,2,2, 0,0,0,0,0,0 }; pboard() {int i; i=-1;W(++i<144)printf(" %c",(i&15)==BW&&(i+=15-BW)?10:n[b[i]&31]); } D(k,q,l,e,z,n) /* recursive minimax search, k=moving side, n=depth*/ int k,q,l,e,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ { /* e=score, z=prev.dest; J,Z=hashkeys; return score*/ int j,r,m,v,d,h,i,P,V,f=J,g=Z,C,s,flag,F; unsigned char t,p,u,x,y,X,Y,B,lu; struct _*a=A+(J+k&U-1); /* lookup pos. in hash table*/ q-=qD;m=a->V;F=a->F; /* resume at stored depth */ X=a->X;Y=a->Y; /* start at best-move hint */ if(z&S&&a->K==Z)printf("# root hit %d %d %x\n",a->D,a->V,a->F); if(a->K-Z|z&S | /* miss: other pos. or empty*/ !(m<=q|F&8&&m>=l|F&S)) /* or window incompatible */ d=X=0,Y=-1; /* start iter. from scratch */ W(d++2&&l+I?D(16-k,-l,1-l,-e,2*S,d-3):I; /* search null move */ m=-P beta unconsidered:static eval */ N++; /* node count (for timing) */ do{u=b[x]; /* scan board looking for */ if(u)m=lu|u&15^3?m:(d=98,I),lu=u&15^3; /* Kings facing each other */ if(u&&(u&16)==k) /* own piece (inefficient!)*/ {r=p=u&15; /* p = piece type (set r>0) */ j=od[p]; /* first step vector f.piece*/ W(r=o[++j]) /* loop over directions o[] */ {A: /* resume normal after best */ flag=h?3:of[j]; /* move modes (for fairies) */ y=x; /* (x,y)=move */ do{ /* y traverses ray, or: */ y=h?Y:y+r; /* sneak in prev. best move */ if(y>=16*BH|(y&15)>=BW)break; /* board edge hit */ t=b[y]; /* captured piece */ if(flag&1+!t) /* mode (capt/nonc) allowed?*/ {if(t&&(t&16)==k||flag>>10&zn[y])break; /* capture own or bad zone */ i=w[t&15]; /* value of capt. piece t */ if(i<0)m=I,d=98; /* K capture */ if(m>=l&d>1)goto C; /* abort on fail high */ v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/ if(d-!t>1) /*** all captures if d=2 ***/ {v=centr[p]?b[x+257]-b[y+257]:0; /* center positional pts. */ b[x]=0;b[y]=u; /* do move */ v-=w[p]>0|R<10?0:20; /*** freeze K in mid-game ***/ if(p<3) /* pawns: */ {v+=2; /* end-game Pawn-push bonus */ if(zn[x]-zn[y])b[y]+=5, /* upgrade Pawn and */ i+=w[p+5]-w[p]; /* promotion bonus */ } if(z&S && GamePtr<6) v+=(rand()>>10&31)-16; // randomize in root J+=J(0);Z+=J(4); v+=e+i;V=m>q?m:q; /*** new eval & alpha ****/ C=d-1-(d>5&p>2&!t&!h); /* nw depth, reduce non-cpt.*/ C=R<10|P-I|d<3||t&&p-3?C:d; /* extend 1 ply if in-check */ do s=C>2|v>V?-D(16-k,-l,-V,-v,/*** futility, recursive eval. of reply */ 0,C):v; W(s>q&++CD=99;a->V=500; /* lock game in hash as loss*/ R-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; return l;} /* & not in check, signal */ v=m; /* (prevent fail-lows on */ } /* K-capt. replies) */ J=f;Z=g; b[y]=t;b[x]=u; /* undo move */ } /* if non-castling */ if(v>m) /* new best, update max,best*/ m=v,X=x,Y=y; /* no marking! */ if(h){h=0;goto A;} /* redo after doing old best*/ } s=t; t+=flag&4; /* fake capt. for nonsliding*/ if(s&&flag&8)t=0,flag^=flag>>4&15; /* hoppers go to next phase */ if(!(flag&S)) /* zig-zag piece? */ r^=flag>>12,flag^=flag>>4&15; /* alternate vector & mode */ }W(!t); /* if not capt. continue ray*/ }} if((++x&15)>=BW)x=x+16&240,lu=1; /* next sqr. of board, wrap */ if(x>=16*BH)x=0; }W(x-B); C:if(a->D<99) /* protect game history */ a->K=Z,a->V=m,a->D=d,a->X=X, /* always store in hash tab */ a->F=8*(m>q)|S*(mY=Y; /* move, type (bound/exact),*/ if(z&S&&Post){ printf("%2d ",d-2); printf("%6d ",m); printf("%8d %10d %c%c%c%c\n",(GetTickCount()-Ticks)/10,N, 'i'-(X>>4&15),'9'-(X&15),'i'-(Y>>4&15),'9'-(Y&15)),fflush(stdout);} } /* encoded in X S,8 bits */ if(z&4*S)K=X,L=Y&~S; return m+=m 1) /* third repeat */ { printf("1/2-1/2 {Draw by repetition}\n"); return 1; } differs: ; } K=I; cnt = D(s,-I,I,Q,4*S,3); if(cnt==-I+1) { if (s == WHITE) printf("0-1 {Black mates}\n"); else printf("1-0 {White mates}\n"); return 3; } if(Fifty >=100) { printf("1/2-1/2 {Draw by fifty move rule}\n"); return 4; } return 0; } InitEngine() { int i, j; N=8100;W(N-->256)T[N]=rand()>>9; srand(GetTickCount()); } InitGame() { int i,j; for(i=0;i<16*BH;i++)b[i]=0; /* clear board */ b[23]=b[119]=10;b[BW+8]=b[BW+104]=26; /* place Cannons */ K=BH;W(K--) {b[16*K]=oo[K+16]+16;b[16*K+BW-1]=oo[K];if(!(K&1))b[16*K+BW-7]=18,b[16*K+6]=1; /* initial board setup*/ L=BW;W(L--)b[L+16*K+257]=(K-(BW-1)/2.)*(K-(BW-1)/2.)+(L-(BH-1)/2.)*(L-(BH-1)/2.); /* center-pts table */ } /*(in unused half b[])*/ Side = WHITE; Q=0; O=S; Fifty = 0; R = 0; for(i=0; i12 || BH>9) { printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); } for(i=0; i='a'; piecetype[c&31]=i; piecename[i]=c&31; } j++; o[j]=0; /* printf("tell c='%c' i=%d od[i]=%d j=%d (%3d,%8x)\n",c,i,od[i],j,o[j-1],of[j-1]); /**/ c=0; if(i>15 || j>255) break; } fclose(f); sh = w[7] < 250 ? 3 : 0; } int main(int argc, char **argv) { int Computer, MaxTime, MaxMoves, TimeInc, sec, i, j; char line[256], command[256], c, cc; int m, nr; FILE *f; if(argc>1 && sscanf(argv[1], "%d", &m)==1) { U = (1<1) inifile = argv[1]; signal(SIGINT, SIG_IGN); printf("tellics say MaxQi 4.8 (G)\n"); printf("tellics say by H.G. Muller\n"); InitEngine(); LoadGame(NULL); InitGame(); Computer = EMPTY; MaxTime = 10000; /* 10 sec */ MaxDepth = 30; /* maximum depth of your search */ for (;;) { fflush(stdout); if (Side == Computer) { /* think up & do move, measure time used */ /* it is the responsibility of the engine */ /* to control its search time based on */ /* MovesLeft, TimeLeft, MaxMoves, TimeInc */ /* Next 'MovesLeft' moves have to be done */ /* within TimeLeft+(MovesLeft-1)*TimeInc */ /* If MovesLeft<0 all remaining moves of */ /* the game have to be done in this time. */ /* If MaxMoves=1 any leftover time is lost*/ Ticks = GetTickCount(); m = MovesLeft<=0 ? 40 : MovesLeft; tlim = (0.6-0.06*(BW-8))*(TimeLeft+(m-1)*TimeInc)/(m+7); if(tlim>TimeLeft/15) tlim = TimeLeft/15; PromPiece = 0; /* Always promote to Queen ourselves */ N=0;K=I; if (D(Side,-I,I,Q,S,3)==I) { Side ^= BLACK^WHITE; if(UnderProm>=0 && UnderProm != L) { printf("tellics I hate under-promotions!\n"); printf("resign { underpromotion } \n"); Computer = EMPTY; continue; } else UnderProm = -1; printf("move "); printf("%c%c%c%c",'i'-(K>>4),'9'-(K&15), 'i'-(L>>4&15),'9'-(L&15)); printf("\n"); m = GetTickCount() - Ticks; /* time-control accounting */ TimeLeft -= m; TimeLeft += TimeInc; if(--MovesLeft == 0) { MovesLeft = MaxMoves; if(MaxMoves == 1) TimeLeft = MaxTime; else TimeLeft += MaxTime; } GameHistory[GamePtr++] = PACK_MOVE; CopyBoard(HistPtr=HistPtr+1&1023); if(PrintResult(Side)) Computer = EMPTY; } else { if(!PrintResult(Side)) printf("resign { refuses own move }\n"); Computer = EMPTY; } continue; } if (!fgets(line, 256, stdin)) return 1; if (line[0] == '\n') continue; sscanf(line, "%s", command); if (!strcmp(command, "xboard")) continue; if (!strcmp(command, "protover")) { printf("feature myname=\"MaxQi 4.8G\"\n"); printf("feature memory=1\n"); printf("feature smp=1\n"); printf("feature setboard=0 ping=1 done=0\n"); printf("feature variants=\""); PrintVariants(); printf("\" done=1\n"); continue; } if (!strcmp(command, "ping")) { int nr=0; sscanf(line, "ping %d", &nr); printf("pong %d\n", nr); continue; } if (!strcmp(command, "p")) { pboard(); continue; } if (!strcmp(command, "memory")) { int mem, mask; sscanf(line+6, "%d", &mem); mem = (mem*1024*1024)/12; // max nr of hash entries mask = 0x7FFFFFFF; while(mask > mem) mask >>= 1; if(mask != U) { free(A); U = mask; A = (struct _ *) calloc(U+1, sizeof(struct _)); } continue; } if (!strcmp(command, "new")) { /* start new game */ LoadGame("xiangqi"); InitGame(); GamePtr = Setup = 0; GameNr++; HistPtr = 0; Computer = BLACK; TimeLeft = MaxTime; MovesLeft = MaxMoves; for(nr=0; nr<1024; nr++) for(m=0; m>1); while(MaxMoves>0 && MovesLeft<=0) MovesLeft += MaxMoves; continue; } if (!strcmp(command, "hint")) { Ticks = GetTickCount(); tlim = 1000; D(Side,-I,I,Q,4*S,6); if (K==0 && L==0) continue; printf("Hint: "); printf("%c%c%c%c",'a'+(K&7),'8'-(K>>4), 'a'+(L&7),'8'-(L>>4)); printf("\n"); continue; } if (!strcmp(command, "undo") && (nr=1) || !strcmp(command, "remove") && (nr=2) ) { /* 'take back' moves by replaying game */ /* from history until desired ply */ if (GamePtr - nr < 0) continue; GamePtr -= nr; HistPtr -= nr; /* erase history boards */ while(nr-- > 0) for(m=0; m= 'A' && m <= 'Z' && line[1] >= 'a' && line[1] <= 'a'+BH-1 && line[2] >= '0' && line[2] <= '0'+BW-1) { m = 16*('i'-line[1])+'9'-line[2]; p = 4; /* Elephant code */ switch(line[0]) { case 'K': b[m]=3+color; break; case 'R': p++; case 'C': p++; case 'H': p++; case 'A': p+=4; b[m]=p+color; Q+=w[p]; R+=w[p]/FAC; break; case 'P': if((color==WHITE) == ((m&15)<5)) p = 6; else p = 1; case 'E': p+=(color==BLACK); b[m]=p+color; Q+=w[p]; R+=w[p]/FAC; break; } continue; } } if(Side != color) Q = -Q; GamePtr = HistPtr = 0; Setup = 1; SetupQ = Q; // start anew for(i=0; i<128; i++) setupPosition[i] = b[i]; // remember position setupPosition[128] = Side; continue; } /* command not recognized, assume input move */ m = line[0]<'a' | line[0]>='a'+BH | line[1]<'0' | line[1]>='0'+BW | line[2]<'a' | line[2]>='a'+BH | line[3]<'0' | line[3]>='0'+BW | line[4] != '\n'; {char *c=line; K=16*('i'-c[0])+'9'-c[1]; L=16*('i'-c[2])+'9'-c[3]; } if (m) /* doesn't have move syntax */ printf("Error (unknown command): %s\n", command); else if(D(Side,-I,I,Q,S,3)!=I) { /* did have move syntax, but illegal move */ printf("Illegal move:%s\n", line); } else { /* legal move, perform it */ GameHistory[GamePtr++] = PACK_MOVE; Side ^= BLACK^WHITE; CopyBoard(HistPtr=HistPtr+1&1023); if(PrintResult(Side)) Computer = EMPTY; } } } fairymax-5.0b/windows/000077500000000000000000000000001266116003200150275ustar00rootroot00000000000000fairymax-5.0b/windows/elephant.ico000066400000000000000000000042761266116003200173340ustar00rootroot00000000000000 ( @\ddd@㏀㏀ǀÀÀfairymax-5.0b/windows/fmax.rc000066400000000000000000000001001266116003200162770ustar00rootroot00000000000000ICON_WHITE ICON DISCARDABLE "elephant.ico" fairymax-5.0b/windows/fres.o000066400000000000000000000047321266116003200161540ustar00rootroot00000000000000L .rsrct < @0J)N PJ)N8J)N J)NhJ)N  ICON_WHITE` ( @\ddd@㏀㏀ǀÀÀ .rsrc