The Chess Variant Pages
Custom Search




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

Latest Ratings and Comments

Later Reverse Order EarlierEarliest
This item is a miscellaneous item
It belongs to categories: Orthodox chess, 
It was last modified on: 2006-02-26
 By Fergus  Duniho. About Game Courier. Web-based system for playing many different variants by email or in real-time.[All Comments] [Add Comment or Rating]
Jean-Louis Cazaux wrote on 2020-04-09 UTC

Does anyone has any news from Fergus? Considering the current situation I do worry. We were engaged in a game of Metamachy since December, each of us playing a move every day more or less. It happens that he never answered the last move I made 11 days ago (we are April 9). I sent him an e-mail but I got no answer so far. Hope Fergus is safe. If you read this Fergus, please make a sign. Take care. (I'm Jean-Louis Cazaux)


Jean-Louis Cazaux wrote on 2020-04-09 UTC

Does anyone has any news from Fergus? Considering the current situation I do worry. We were engaged in a game of Metamachy since December, each of us playing a move every day more or less. It happens that he never answered the last move I made 11 days ago (we are April 9). I sent him an e-mail but I got no answer so far. Hope Fergus is safe. If you read this Fergus, please make a sign. Take care. (I'm Jean-Louis Cazaux)


NEW! This item is a reference work
It belongs to categories: Orthodox chess, 
It was last modified on: 2020-03-29
 Author: Fergus  Duniho. 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 2020-04-09 UTC

After thinking about it, I think it makes more sense to assign constants to the names used in the code than it does to assign them to aliases. The alias can be calculated after the real name is returned by const. This allows the same alias to be used for a piece with different functions or subroutines for each side, such as Pawn as an alias for both White_Pawn and Black_Pawn. The way it is currently coded is suited only for using different aliases for different versions of the same piece definition, such as Minister and Elephant for Chinese_Elephant. But this is a bad example, because I have separate functions for the Elephant on each side anyway. So, I think there is more call for using one alias for multiple piece defintions than for using one piece definition with multiple aliases. I will update code and documentation tomorrow.


Aurelian Florea wrote on 2020-04-08 UTC

Ok, I'll take a look tomorrow. Thanks!...


Fergus Duniho wrote on 2020-04-08 UTC

This is because you copied old code that was still buggy. When I made a fork and copied in the new code from Chess, it worked fine. The new code is described in detail on this page in the Aliases section.


Aurelian Florea wrote on 2020-04-08 UTC

The 4 initial moves. The ones that the usual king does not have.


UPDATED! This item is a game information page
It belongs to categories: Orthodox chess, 
It was last modified on: 2020-04-06
 By Steven  Streetman. Spartan Chess. (Updated!) A game with unequal armies. (8x8, Cells: 64) [All Comments] [Add Comment or Rating]
David Cannon wrote on 2020-04-08 UTCExcellent ★★★★★

I don't usually like games with different armies, but this is an exception. You've put a lot of thought into making a game whose different armies are not unevenly matched. For sure, the Spartan side lacks a Queen and its army appears to be slightly less powerful, but that is compensated for by the presence of two kings, both of which must be checkmated/captured. 


NEW! This item is a reference work
It belongs to categories: Orthodox chess, 
It was last modified on: 2020-03-29
 Author: Fergus  Duniho. 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 2020-04-08 UTC

I don't see why that would make a difference. What move couldn't you make using King as an alias for Apothecary_King?


Aurelian Florea wrote on 2020-04-08 UTC

I had done that and the moves were displayed but I was not able to do them due to the error saying that a king cannot move there.

I have change the code in the setconst area to:

setconst k Apothecary_King;
setconst K Apothecary_King;

and now things work properly as far as I can see.


Fergus Duniho wrote on 2020-04-08 UTC

I see in your code that you started using the name King directly instead of as an alias for Apothecary_King. When you do it this way, it calls the King subroutine. This is working out for you, because the King subroutine calls the King function. The subroutine also includes some code for handling castling, but since you have not set wcastle and bcastle, it will recognize any attempt at castling as illegal without needing to call the castle subroutine. So, it basically just uses the function to check the move's legality, and it updates the value of kpos or Kpos to the space the King moved to. What the King subroutine is doing that your code was not doing before is updating kpos or Kpos BEFORE your code checks whether your King has moved into check. Presently, you have the code for updating kpos and Kpos at the very end of your Post-Move sections, but these variables need to be updated before checking whether you have moved into check. So, if you just changed the position of this part of your code, you could use King as an alias for Apothecary_King without any problem.


Aurelian Florea wrote on 2020-04-08 UTC

I have made tests for the all moves and then check and checkmate and things seem ok if we redefine (by overwritting) the king subroutine. These don't work properly if an Apothecary_king function is defined and then use of aliases is made. Is there a reason against leaving things as is, Fergus?


Aurelian Florea wrote on 2020-04-08 UTC

Is not that post move section?

It is, I misread sorry!...


Fergus Duniho wrote on 2020-04-07 UTC

I don't understand what you are trying to say.

You said:

The only thing is that the definition of king is used rather than an apothecary king and then an alias with king.

That's a bug. It should show the description for the Apothecary_King. This bug is due to you using older code that is not bug-free. This buggy code is in your Post-Move sections. The Chess preset has up-to-date bugfree code in its Post-Move sections. The bug is in this line:

set desc join #name "-Desc";

This should be:

set desc join realname #name "-Desc";


Aurelian Florea wrote on 2020-04-07 UTC

But I verified checkmates and they work in both apothecary chess modern and apothecary chess classic as I copied the functions to the other game.


Aurelian Florea wrote on 2020-04-07 UTC

I don't understand what you are trying to say.


Fergus Duniho wrote on 2020-04-07 UTC

Since King is an alias for Apothecary_King, it converts King to Apothecary_King before it searches for a function, subroutine, or description. If it can't find an Apothecary_King subroutine, for example, that's the end of the line, and it will not search for a King subroutine.

Except that your code is based on some earlier code with a bug in it. Compare your code for displaying descriptions with the code in the Chess preset, which is up-to-date and corrected.


Aurelian Florea wrote on 2020-04-07 UTC

All right. Things are great! Thanks!...

The only thing is that the definition of king is used rather than an apothecary king and then an alias with king. Could this have any problems. Anyway big help for your Help!


Fergus Duniho wrote on 2020-04-07 UTC

The line "and or f2 f9" should be "and flag #0".


Aurelian Florea wrote on 2020-04-07 UTC

Finally I tried to replace the code that was using a boolean variable with one using flags. I'm not sure how this will change what you provdeded earlier and worked fine while kpos and Kpos were used correctly.


Fergus Duniho wrote on 2020-04-07 UTC

I see from you commenting it out that you've identified this line as the problem that's causing premature checkmate:

set Kpos space moved;

It should be changed to

set Kpos $dest;

The space operator returns the piece on the coordinate given to it, but you want to set Kpos to a coordinate, and $moved is a piece, not a coordinate.


Fergus Duniho wrote on 2020-04-07 UTC

I was wondering about one line during the night. This should correct it. Note that if you had switched to flags earlier, this line wouldn't even be needed. Keeping things simple makes programming easier.

def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and match rankname #1 1 10
and or and var K1stmove == #0 f2 and var k1stmove == #0 f9
or checkleap #0 #1 1 0 
or checkleap #0 #1 1 1;

Aurelian Florea wrote on 2020-04-07 UTC

Unfortuneatly the code you proposed does not work either. It gives false pozitives when displaying (shows all camel and knight moves) but on the other hand, the special 1st time moves are considered wrong when applied. My guess is that then it is a deeper problem as the king is not a ordinary piece and changing it's properties could impact other subroutines in less predictable ways.

I have not changed the code to use flags because yesterday I was a little busy with other things, but I doubt this impacted the overall result, althought a slower speed was to be expected. Thanks for your help Fergus, but it seems that apothecary chess is to difficult for me to program at this time, so I'm considerring taking a break from programming presets.


This item is a miscellaneous item
It belongs to categories: Orthodox chess, 
It was last modified on: 2005-08-31
Recognized Chess Variants. Index page listing the variants we feel are most significant. (Recognized!)[All Comments] [Add Comment or Rating]
J Andrew Lipscomb wrote on 2020-04-06 UTC

It's good now,


NEW! This item is a reference work
It belongs to categories: Orthodox chess, 
It was last modified on: 2020-03-29
 Author: Fergus  Duniho. 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 2020-04-06 UTC

While the simplest way of writing your Apothecary_King function will use flagged spaces, this should work using the method you're using now:

def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and match rankname #1 1 10
and or var K1stmove == #0 f2 or var k1stmove == #0 f9
or checkleap #0 #1 1 0 
or checkleap #0 #1 1 1;

Although the piece being moved will be found on a different space for actual moves and potential moves, the location of the original space remains the same whether the move is actual or potential. So, if the King is moving from its original space, and its 1st move variable is set, then it is on it's first move. Since the available Knight and Camel moves only allow the King to go to the back rank, this function also checks whether the move is to the back rank. This allows it to use checkleap instead of checkaleap, and that avoids the need to test which King is moving on each line.


Fergus Duniho wrote on 2020-04-06 UTC

I think your problem stems from the overly complicated way you are writing your Apothecary_King function due to keeping track of whether the King has moved in a more complicated manner. It should clear up once you change how you keep track of whether the King has already moved and write a simpler function that uses flagged spaces.


25 comments displayed

Later Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.