Skip to content

Latest commit

 

History

History
75 lines (64 loc) · 6.56 KB

variants.markdown

File metadata and controls

75 lines (64 loc) · 6.56 KB
layout title permalink
page
Variants
/variants/

Fairy-Stockfish has a large variety of variants already built in and can be extended further using a variant configuration file.

Built-in variants

Regional and historical games

Chess variants

Shogi variants

Related games

Custom variants

User-defined variants can be added via an INI-style configuration file and be loaded at runtime without needing to recompile the program. See the variants.ini in the repository for documentation and examples of variant configuration.

Let's say we want to replace the bishops in chess with knight+bishop compound pieces, also referred to as archbishops. The configuration could look as follows:

# we name our variant "testvariant" and let it inherit all the rules from chess
[ourtestvariant:chess]
# now we add the archbishop and assign it "a" as an abbreviation
archbishop = a
# since bishops are obsolete now, we remove them. This isn't strictly required, but recommended.
bishop = -
# we also need to update the promotion rules accordingly
promotionPieceTypes = nrqa
# and now let's define the new starting position
startFen = rnaqkanr/pppppppp/8/8/8/8/PPPPPPPP/RNAQKANR w KQkq - 0 1

And that's already it. We can now e.g. go to the Fairy-Stockfish playground to test it directly in the browser. Just paste the above configuration to a file and load that file in the variants.ini section. After selecting ourtestvariant you should be able to play the variant against the Fairy-Stockfish or let it play against itself.