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


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

The Fairychess Include File Tutorial. How to use the fairychess include file to program games for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝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.