Check out Grant Acedrex, our featured variant for April, 2024.

Enter Your Reply

The Comment You're Replying To
🕸Fergus Duniho wrote on Thu, Apr 9, 2020 05:52 PM UTC:

Using the fairychess-test include file, I updated Chess, Grand Chess, Gross Chess, and Chinese Chess to assign constants to the actual function and subroutine names instead of to aliases. They still make use of aliases for these names, but it is now only for display purposes. I am going to postpone copying the changes to the official fairychess include file to give Greg some time to update Opulent Chess without breaking it in the meantime. I haven't changed the documentation yet, but here is what you can do.

  1. Include fairychess-test instead of fairychess.
  2. Assign the constants to the actual function or subroutine names instead of the aliases.
  3. Add the Pawn alias for White_Pawn and Black_Pawn. (The main benefit of the change is that you can now do this.)
  4. Replace the if-elseif-else block for checking the legality of moves in each Post-Move section with the following code:
set codename const alias $moved;
if sub #codename $origin $dest and issub #codename:
elseif fn #codename $origin $dest and isfunc #codename and not issub #codename:
else:
set name alias #codename;
set errmsg list "You may not move your" #name "from" $origin "to" join $dest ".<BR>";
set desc join #codename "-Desc";
set errmsg str_replace "_" " " join #errmsg str_replace "%s" #name var #desc;
die #errmsg;
endif;

Once I know Opulent Chess is updated, I will copy fairychess-test to fairychess and switch back to including fairychess in my games. Then I'll notify Greg, who can do the same. I'm not going to worry about breaking Apothecary Chess, because that's still a work in progress anyway, but Aurelian should be doing the same things for his games too. This is just a quick how-to. I will update the documentation later.


Edit Form

Comment on the page The Fairychess Include File Tutorial

Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.