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 ]

Comments/Ratings for a Single Item

Earlier Reverse Order LaterLatest
Apothecary Chess-Classic. Large board variant obtained through tinkering with known games.[All Comments] [Add Comment or Rating]
💡📝Aurelian Florea wrote on Tue, May 2, 2017 02:15 PM UTC:

While playing a game against Greg Strong I figured out that a rule is not clear.

No pieces besides the initial ones can enter the bruhaha squares.

That's the new rule. For now I just put it in a comment when sufficient material is obtained I'll edit the article.


💡📝Aurelian Florea wrote on Tue, May 2, 2017 03:21 PM UTC:

I have considered Greg Strong's input so I'm making a new rule (the one Greg proposed actually):

A player cannot move into a Brouhaha Square but may capture a piece already on it. Only the pieces initially placed there have special powers.

The second part is there to highlight that the special powers are given to help in the opening they don't go further to the possible capturer of the pieces initially placed on the brouhaha squares. Also remember that the special powers are just move abilities.


Kevin Pacey wrote on Thu, Mar 1, 2018 06:58 AM UTC:Excellent ★★★★★

The apothecary games may have a somewhat steep learning curve, but it seems it's well worth the trouble, based on my limited experience.


💡📝Aurelian Florea wrote on Thu, Jan 30, 2020 08:20 AM UTC:

@The Editors

These days I had tried to finalize the rules of my 2 apothecary games.

This should be the final version of this article pending review.


💡📝Aurelian Florea wrote on Sat, Feb 1, 2020 11:44 AM UTC:

I hope you guys enjoy the new version of this game. For now, the rules enforcing and move displaying are an ongoing job, for me to do. After that I hope to see you soon!...


💡📝Aurelian Florea wrote on Tue, Mar 24, 2020 12:21 PM UTC:

2 weeks ago you proposed the following code

def Joker fn const alias #lastpiece #0 #1;
def Joker-Range fn join const alias #lastpiece "-Range" #0;

 

for the joker piece. I got an "function has not been defined error" at the call in the checked function:

if fn const alias #piece #from var king

Also this line works fine with the other pices (I had tried it).


🕸Fergus Duniho wrote on Tue, Mar 24, 2020 03:10 PM UTC:

Give me a link to where you are using this code with a list of moves that result in this error message.


🕸Fergus Duniho wrote on Tue, Mar 24, 2020 03:33 PM UTC:

I was just getting the same kind of error while working on updating Grand Chess to use the fairychess include file. To fix it, I had to make sure my piece assignments were complete, and since I was using an alias for the Cardinal, I had to make sure that the alias operator got used in all the appropriate places.


💡📝Aurelian Florea wrote on Tue, Mar 24, 2020 03:35 PM UTC:

While working for the presets for this game and it's twin, the thought of how the joker imitates a pawn moving ahead like the allied pawns, or backward like the enemy pawns. I always took it for granted that it moves like allied pawns, but it could go the other way around also. What do you guys think?


Greg Strong wrote on Tue, Mar 24, 2020 04:33 PM UTC:

Allowing a pawn to move backward would be a very radical change and I doubt it would make a better game.  It certainly would be less of a "chess variant".


💡📝Aurelian Florea wrote on Tue, Mar 24, 2020 04:37 PM UTC:

Sorry Greg, but I did not made myself clear enough. I meant the joker. If the joker should be allowed to move ahead when imitating a pawn, or backward. This was the quenstion. I always took it for granted that the imitation was to be ahead, but technically speaking a white joker imitates a black one who moves backwards. Letting it to move ahead (as it comes natural to me though) would be an exception the the main rule that the joker imitates enemy pieces. Technicalities aside I still think that moving ahead is better.


🕸Fergus Duniho wrote on Tue, Mar 24, 2020 08:15 PM UTC:

The problem was caused by using #lastpiece instead of var lastpiece. The former inserts the value into the line during preprocessing, which doesn't work out so well for null or empty values, while the latter looks it up while evaluating the expression. These will work instead.

def Joker fn const alias var lastpiece #0 #1;
def Joker-Range fn join const alias var lastpiece "-Range" #0;

One thing that has come up while examining your code is how you want the Joker to move after a piece that moves differently for each side, such as the Pawn. Should it move as the enemy Pawn, which is how it currently works, or as its own Pawn? For the latter, these should work:

def Joker fn const alias flipcase var lastpiece #0 #1;
def Joker-Range fn join const alias flipcase var lastpiece "-Range" #0;

While these changes eliminate the problem you were having, there is still a problem with actually moving the Joker piece. One problem is that the Joker doesn't properly handle pieces that use subroutines instead of functions. But even with pieces that just use functions, it is not working properly. I'm getting too tired to continue looking into this today. Maybe I'll make more progress tomorrow.


Greg Strong wrote on Tue, Mar 24, 2020 09:58 PM UTC:

Sorry - yes, I wasn't thinking your question through.  Still, I think the Joker should forward when imitating a pawn.  If white moves a pawn two spaces, should the black joker (now imitating that pawn) be able to capture en passant?  If so, it needs to move forward (or things would be really strange.)


Greg Strong wrote on Tue, Mar 24, 2020 10:20 PM UTC:

Other questions:

Say white moves a bishop.  Now black's joker could move like a bishop - but instead black moves a rook.  Now its white's move and he wants to castle, but he cannot castle if in check.  To decide if he is in check, does black's joker still attack like a bishop, or does it attack like a rook?  Or neither?

Argument for attacking like a bishop: white's joker immitates black's last move and black's bishop immitates white's last move.  Black moving only changes the move of white's joker.

Argument for attacking like a rook: any move changes the move of both jokers.  This is the easiest to program but I don't like it.

Argument for neither: white's joker moves like black's last move only when white is on the move.  After white moves, his joker has no attack power until black moves again.

It is also important to determine exactly when the change happens.  Say white wants to make a normal king move and black's joker still attacks as a bishop.  Does this mean that the white king cannot move onto the bishop's diagonal because that is moving into check?  Or has the fact that, as soon as white moves his king the black joker moves as a king, mean that the white king is not in check?


🕸Fergus Duniho wrote on Wed, Mar 25, 2020 02:29 AM UTC:

In my fork of the Apothecary Chess 1 preset, the problem I've currently come up against may be due to endless recursion. When I try moving the Joker, the script crashes. What I think is happening is that after the Joker moves, it runs code for the other Joker, and now that the value of lastpiece is j or J, the Joker function recursively calls itself again and again without ever exiting. I just tried one way of fixing this, but it didn't solve the problem. Since it's late, I will not continue with any more attempts tonight. I just wanted to share what I think the problem is.


💡📝Aurelian Florea wrote on Wed, Mar 25, 2020 05:12 AM UTC:

First there is no castling in this game.

I realize I have to give more details regarding the joker. The rule is that it imitates the last move of the opponent. And this rule has that pawns issue.

On your question Greg. The switch of the imitated piece is when the move is completed. In this case the bishop move would be illegal because it places the black king in check.

About the en passant thing. This is something I have not thought properly. The philosophy behind this brings at least 2 cases.

1. the joker does not capture en passant ever as en passant is a property of a pawn and not a move. As I had decided that joker may not promote this should be the case.

2.  the joker may capture en passant at the 6th rank like any pawn.

I prefer 1 but I'd like a small comment.


H. G. Muller wrote on Wed, Mar 25, 2020 10:04 AM UTC:

I always like the 'not castling through check' rule as a form of e.p. capture: the King makes a double step, and can then be taken by a capture-capable move to the square it passed through in the subsequent move. As exposing your King to capture is illegal, such a castling would be illegal.

In this interpretation it would be legal to castle over a square that was diagonally attacked by the Joker from a distance, as after the castling that Joker would no longer move like a Bishop, and thus not be able to execute the e.p. capture of the King. I am not sure how the Joker moves after castling: as a Rook, as a King, both or neither. The rules would have to specify that. If it would move as a King, then a black Joker on e2 would make white castling illegal, as that Joker could in the reply become a King and attack f1/d1. Basically the rule would become: the King cannot pass a square during castling that it could not legally move to.

It is always a tricky question whether a Joker can deliver check. In most positions this is not important, as most moves would alter the Joker's capabilities in a way that resolved the check. But it can be important to distinguish checkmate from stalemate. Basically the question boils down to how the Joker would move after a turn pass of the opponent, because the 'in-check' definition involves the fiction of a turn pass. Must it also pass a turn, or will it just keep the move it had on the turn before? In the former case the position w:Ke3, Je2 b:Ke1 would be a stalemate, in the latter case it might be a checkmate (if white black moved Ke1 on the move before).


💡📝Aurelian Florea wrote on Wed, Mar 25, 2020 10:49 AM UTC:

The rule is that the joker moves like the last move of the opponent. This game does not have a castling but it will come to it in other games. Castling is generally considered a king move. There is a king may leap once a game rule. That it. I think the confusion related to when the loan of power ends not when it begins. That happens when the oppnent has just moved. I'm not sure I understand the qustions otherwise/


🕸Fergus Duniho wrote on Wed, Mar 25, 2020 12:40 PM UTC:

The rule is that the joker moves like the last move of the opponent.

As stated, that's too ambiguous. Here are some possible interpretations:

1. The Joker has the same powers of movement as the last piece the opponent moved, which is what I've been trying to program with my Joker function.

2. The Joker mostly has the same powers of movement as the last piece the opponent moved, but there are exceptions for particular pieces. For example, it might not be able to promote or castle.

3. The Joker is limited to the type of move of the opponent's last move. For example, if the opponent moved a Queen, diagonally, the Joker would be able to move diagonally, but not orthogonally.

4. The Joker is limited to the type and direction of the opponent's last move. For example, if the Queen moved vertically forward, the Joker could move vertically forward, but it could not move vertically backward, horizontally, or diagonally.

5. The Joker is limited to the type, direction, and distance of the opponent's last move. For example, if the Queen moved vertically forward 4 spaces, the Joker could move vertically forward up to four spaces.

6. The Joker is limited to the type, direction, and precise distance of the opponent's last move. For example, if the Queen moved vertically forward 4 spaces, the Joker could move vertically forward 4 spaces, no more and no less.


H. G. Muller wrote on Wed, Mar 25, 2020 12:58 PM UTC:

I would say the borrowed power of the Joker ends after the player owning the Joker moved it, or moved something else. Because then it is no longer that players turn, and a Joker is not allowed to move in the opponent's turn. So during the opponent's turn it has no powers at all.


🕸Fergus Duniho wrote on Wed, Mar 25, 2020 01:10 PM UTC:

Because then it is no longer that players turn, and a Joker is not allowed to move in the opponent's turn.

That's true of every piece on the board.

So during the opponent's turn it has no powers at all.

But that's not true of other pieces. Other pieces retain checking power during the opponent's move.

I would imagine that the Joker retains whatever power it used to move until the opponent moves another piece, thereby giving it a different power of movement. For example, if the Joker moves as a Rook and checks the King, the King would be in check, and one way to remove that check would be to move a Bishop, which would change the Joker's powers of movement.


💡📝Aurelian Florea wrote on Wed, Mar 25, 2020 01:31 PM UTC:

As I had said earlier the joker gains the power at the end of the opponent's move and retains it until the next time the opponent moves. I could have made myself not clear enough. So if the joker is unobstructed on the same diagonal like the enemy king it pins all bishops and queens the enemy has, because it would mean that the opponent has moved into check!

The power is almost in full (so Fergus in your question it is number 2). That is because the games could be quite imbalanced if a joker promotes to queen and a joker can easily move across the board compared to a pawn. Once again there is no castling in this game but some leaps for the unmoved king.


Greg Strong wrote on Wed, Mar 25, 2020 02:20 PM UTC:

1. The Joker has the same powers of movement as the last piece the opponent moved, which is what I've been trying to program with my Joker function. [Emphasis mine]

To do that, wouldn't you need White_Joker and Black_Joker subroutines?  As I understand your code, a piece move changes the move of both jokers, but perhaps you've changed it from the snippit you posted or I don't fully understand it.


🕸Fergus Duniho wrote on Wed, Mar 25, 2020 02:21 PM UTC:

One thing I just thought of is that the regular stalemated subroutine will not work for a game with the Joker. To factor in how moving a particular piece change's the checking power of the Joker, it should regulary update the value of lastpiece.

While looking up the correct name of the variable, I saw that I had used the wrong variable name in some places last night. When I corrected that, I was able to move the Joker in my fork of the Apothecary Chess 1 preset.

There are still more things to be done, but not right away.


💡📝Aurelian Florea wrote on Wed, Mar 25, 2020 05:26 PM UTC:

When you'll succeed with the joker piece there will still be work to be done with the 2 apothecaries. I can do this part I think. I currently have 1 working preset for each baring the presence of a joker.


H. G. Muller wrote on Thu, Mar 26, 2020 09:57 AM UTC:

But that's not true of other pieces. Other pieces retain checking power during the opponent's move.

That is exactly what I disagre with. Checking power is defined as the ability to make an actual capture after the opponent passes his turn (thus giving the turn back to the owner of the checking piece).

So the question is really how the Joker must move after a turn pass, because such a turn pass cannot be assigned to any particular piece. Must it then also pass its turn, or does it retain the powers it had on the move before? This question is important to distinguish checkmate from stalemate.

For 'passing through check' turn passing plays no role, though. The King was already moving when it reached the square it aims to pass through. The logical approach is to evaluate the situation under the fiction that he would stop there, and then the last move would have been a King move. So I would say the Joker has to be assumed to move as a King in order to judge whether the King passed through its attack. Even when the ultimate rule for Joker movement after a complete castling would be that it should move like a Rook. (E.g. because castling according to FIDE rules must first move the King, and then the Rook, so the Rook would be the last moved piece.)


💡📝Aurelian Florea wrote on Thu, Mar 26, 2020 10:30 AM UTC:

HG,

Some interpretation could be on game by game basic and it's inventor should cover all details. I have not thought on everything, but the joker is definetly an interesting piece.

As you stated the rule :"Checking power is defined as the ability to make an actual capture after the opponent passes his turn (thus giving the turn back to the owner of the checking piece)." you agree with me when I had said that if the joker in unbostucted on the same diagonal with the king all the bishops friendly to the king are pinned.


H. G. Muller wrote on Thu, Mar 26, 2020 12:01 PM UTC:

Indeed, if there is a diagonal path from Joker to King, Bishops and Queens would be pinned.

If there is a diagonal path of a black Joker to f1 (say from d3), I would not think that this would forbid O-O, because it also doesn't forbid Kf1,

The tricky question is what to do when the Joker has a diagonal path do e1 (say from c3). Can white castle now, or is he in check, and consequently cannot? This again depends on how one imagines the Joker to move after a turn pass. And if he keeps his old move in that case, it depends on the previously moved piece.


💡📝Aurelian Florea wrote on Wed, May 6, 2020 07:17 AM UTC:

The two things than need doing to complete the preset for this game is the finishing rules (as there are different from many chess variants) and all things related to the joker. For the first I will forfeit any more development as this website cannot support the 5 types of results present here. For the second the behavior of the jester is beyond my game code programming abilities and hopefully someone can help sooner or later. Fergus, if you see this, you have said a while ago that you took a look at the problem but I see you are very busy now. Anyway the day will come when this will be done one way or the other. I think I can handle the placing of the joker, I mean the main problem is the movement of the piece.


💡📝Aurelian Florea wrote on Wed, May 6, 2020 07:19 AM UTC:

Becuuase I was asked to and, the rules have been anyway changed I will make some challenges with the non rules enforcing preset.


💡📝Aurelian Florea wrote on Sun, May 10, 2020 12:04 PM UTC:

I have corrected an omision. The king need not be in check in order to perform the special leap.


💡📝Aurelian Florea wrote on Sat, May 23, 2020 01:45 PM UTC:

I have added some clarifications regarding how the joker moves in the beginning and when imitating the enemy joker. They can be found at the end of the rules chapter.


🕸Fergus Duniho wrote on Sat, May 23, 2020 04:05 PM UTC:

First of all, you want to keep track of the last type of piece moved, and to start off with, it needs an initial default value.

set last_type_moved None;
def None false;

I'm thinking this could work for tracking the last piece moved:

  if != const alias $moved Joker:
    set last_type_moved const alias $moved;
  endif

This keeps track of the last piece moved using its codename, which matches the function name used for how it moves. But now I have another question. Suppose that the last piece moved was a Black Pawn. Would the White Joker be able to move as a Black Pawn or as a White Pawn?


💡📝Aurelian Florea wrote on Sat, May 23, 2020 04:13 PM UTC:

Would the White Joker be able to move as a Black Pawn or as a White Pawn? 

So far I've played whith the joker always imitating it's own pieces when they have different moves. So the white joker moves like a white pawn when imitating a black pawn. That makes sense to me more as generally speaking pawns advance, so should the joker. Maybe if you think about it a little you would feel quite awkward with your piece moving backwards. But when moving as a pawn the joker may not promote.

Thanks for your help! 


🕸Fergus Duniho wrote on Sat, May 23, 2020 05:15 PM UTC:

I think these should work. Where a piece has a different definition for each side, it will use that for the piece on its own side. The other code for setting last_piece_moved should be used with this. This variable should be initialised in the Pre-Game section, and it should be updated in each Post-Move section. I rewrote None to include the two arguments for origin and destination as other piece functions do. Since it's a contradiction, it will always return false.

  def None == #0 #1 and != #0 #1;
  def White_Joker fn str_replace "Black_" "White_" #last_piece_moved #0 #1;
  def Black_Joker fn str_replace "White_" "Black_" #last_piece_moved #0 #1;

🕸Fergus Duniho wrote on Sat, May 23, 2020 09:20 PM UTC:

Since I made White_Joker and Black_Joker separate pieces, use this code in White's Post-Move section:

if != const alias $moved White_Joker:
  set last_type_moved const alias $moved;
endif;

Use the same code for Black's but substitute Black_Joker for White_Joker.


💡📝Aurelian Florea wrote on Sun, May 24, 2020 04:34 AM UTC:

For now I use code which starts the joker on the board and not in hand. That to make it easier to isolate bugs.

But I'm getting the error:

The function '' has not been defined. Its arguments are e10 f2

It is at the for each where checks are tested. Could it be because of the special king?


🕸Fergus Duniho wrote on Sun, May 24, 2020 12:57 PM UTC:

That kind of error comes from not assigning a codename to a label you use for notation. It could be any piece. Make sure every piece in the game is fully defined.


💡📝Aurelian Florea wrote on Sun, May 24, 2020 01:33 PM UTC:

Yes, you are correct, it was the joker, but now I'm getting:

The function '#last_piece_moved' has not been defined. Its arguments are e10 f2

That happens in the checked subroutine at the line:

if fn const alias #piece #from var king

I had solved that one. There was a line where I wrote last_piece_moved instead of last_type_moved. 

 


💡📝Aurelian Florea wrote on Sun, May 24, 2020 01:51 PM UTC:

Now the error is ;

The function 'White_Joker-Range' has not been defined. Its arguments are e1


🕸Fergus Duniho wrote on Sun, May 24, 2020 02:09 PM UTC:

The function '#last_piece_moved' has not been defined. Its arguments are e10 f2

A variable appears as a string literal when it has not been defined. Make sure that last_piece_moved has a value assigned to it.

The function 'White_Joker-Range' has not been defined. Its arguments are e1

I didn't give you any code for defining this, but it needs to be defined.

def White_Joker-Range fn join str_replace "Black_" "White_" #last_piece_moved "-Range" #0;
def Black_Joker-Range fn join str_replace "White_" "Black_" #last_piece_moved "-Range" #0;

🕸Fergus Duniho wrote on Sun, May 24, 2020 02:14 PM UTC:

You may also need this:

  def None-Range ();

💡📝Aurelian Florea wrote on Sun, May 24, 2020 02:29 PM UTC:

You have wrote both last_piece_moved and last_type_moved. Are they different entities and I'm missing something or something else?


🕸Fergus Duniho wrote on Sun, May 24, 2020 03:07 PM UTC:

Stick to one or the other. I wasn't paying careful attention to what I already wrote.


💡📝Aurelian Florea wrote on Sun, May 24, 2020 04:38 PM UTC:

Ok!


💡📝Aurelian Florea wrote on Sun, May 24, 2020 05:11 PM UTC:

Now when I try to move the joker in a correct manner I get this:

You may not move your White Joker from e1 to f4.

I recognize this line. It is from the post move section and it prevents things like moving one's queen like a knight.

As no moves were displayed either, I think this could be from an error in updating the joker's identity.


🕸Fergus Duniho wrote on Sun, May 24, 2020 06:56 PM UTC:

Without seeing the game in which that is a move, I cannot tell what is going on.


💡📝Aurelian Florea wrote on Mon, May 25, 2020 03:02 AM UTC:

Any joker move would do.

Here: https://www.chessvariants.com/play/pbm/play.php?game=Apothecary+Chess+2&settings=Apothecary2working&submit=Edit

you can find the preset in question. Just move a white mameluke (the camel picture), and then try to move the joker.


🕸Fergus Duniho wrote on Mon, May 25, 2020 03:20 AM UTC:

I'm on my ereader right now and won't be back on my computer until tomorrow morning, which is even later than your morning. My main suggestion for now is to replace #last_type_piece with var last_type_piece in the four Joker* functions, because this sometimes makes a difference.


💡📝Aurelian Florea wrote on Mon, May 25, 2020 04:05 AM UTC:

It works!... I'm so happy!...


💡📝Aurelian Florea wrote on Tue, Jun 9, 2020 03:19 PM UTC:

In the light of recent disuctions in the sister game, I have updated the rules for this game and brushed up a bit the article.

Also the preset allows the game to be played here.


💡📝Aurelian Florea wrote on Thu, Jun 11, 2020 07:53 AM UTC:

@Thor

I had sent you an invitation with the new preset.


💡📝Aurelian Florea wrote on Mon, Jun 22, 2020 11:55 AM UTC:

@Fergus,

I have copied the code from Apothecary-Modern here, and when I test the preset it seems fine, but when I try to move in an ongoing game of Apothecary Classic, I receive the error saying I've made special moves out of check.

Any idea why?


🕸Fergus Duniho wrote on Mon, Jun 22, 2020 07:20 PM UTC:

It sounds like you modified the code of an ongoing game in a way that retroactively made a past move illegal.


💡📝Aurelian Florea wrote on Tue, Jun 23, 2020 04:29 AM UTC:

@Fergus,

I have moved the buggy code from the presets named apothecary-classic and apothecary-modern to the apothecary2working and apothecary1working.

The code I had mentioned before:

if flag f2:
if moved == K:
  move $dest $origin; // Temporarily undo King move
  if sub checked $origin:
    if not or checkleap $origin $dest 1 0 checkleap $origin $dest 1 1:
    die A King may not use the special moves out of check.;
  endif;
endif;
  move $origin $dest;
endif;
endif;

introduces a bug.  Sometimes the message A King may not use the special moves out of check. is displayed seemingly randomly when non-king pieces are moved. That I had checked with the play at same location feature.

Have you any idea on how to fix this bug?


💡📝Aurelian Florea wrote on Tue, Jun 23, 2020 06:45 AM UTC:
files=10 ranks=12 holdingsType=1 promoZone=3 promoChoice=!P*N*B*L*E*R2*J2*Q1*C1*A1 graphicsDir=../graphics.dir/alfaerie/ whitePrefix=w blackPrefix=b graphicsType=gif squareSize=54 symmetry=mirror shuffle=A:BC,:BN,ACQ hole::::a1-j1,,a12-j12 pawn:p:ifmnDfmWfceF:pawn:a4,b4,c4,d4,e4,f4,g4,h4,i4,j4,,a9,b9,c9,d9,e9,f9,g9,h9,i9,j9 rook::::a2,j2,,a11,j11:1 queen::::e3,,e10:1 bishop:B:B:bishop:d3,g3,,d10,g10 knight:N:NmZ:knight:c3,h3,,c10,h10:1 mamluk:L:WL:camel:d1,g1,,d12,g12:1 siege elephant:E:FAH:elephant:e1,h1,,e12,h12 joker:J:fI:fool:f1,,f12 Chancellor:C:RN:chancellor:i3,,i10 archbishop:A:BN:cardinal:b3,,b10 king:K:KimbsLimbsN:king:f3,,f10

H. G. Muller wrote on Tue, Jun 23, 2020 07:31 AM UTC:

Well, if I look at your page source, I see this:

<div class="idiagram">
files=10
ranks=12
holdingsType=1
promoZone=3
promoChoice=!P*N*B*L*E*R2*J2*Q3*C3*A3
graphicsDir=../graphics.dir/alfaerie/
whitePrefix=w
blackPrefix=b
graphicsType=gif
squareSize=54
symmetry=none
pawn:p:ifmnDfmWfceF:pawn:a4,b4,c4,d4,e4,f4,g4,h4,i4,j4,,a9,b9,c9,d9,e9,f9,g9,h9,i9,j9
rook::::,
queen::::,
bishop:b:B:bishop:,
knight:n:NmZ:knight:,:1
mamluk:l:WL:camel:,:1
siege elephant:e:FAH:elephant:,
joker:j:fI:fool:,
Chancellor:c:RN:chancellor:,
archbishop:a:BN:cardinal:,
</div>

You should also see that when you edit your comment in source-code mode. (Switching the submission editor to WYSIWYG mode and then back to source code destroys the diagram, don't do it!)

Most of it looks OK, but except for the Pawns, the lists of squares where the pieces should be placed are all empty. You should have something like a2,j2,,a11,j11 for the Rooks etc., but you just have a single comma. I also see no King amongst the pieces. And in the promoChoice string you probably intend to suffix Q, C, A with '1' rather than '3', if you only allow those on the final rank. (Since you have promoZone=3, '3' would be default anyway, and would not have to be specified.)

Also, you defined the piece IDs as lower case, but in the promoChoice string you then refer to them with upper case. There isn't really any reason to define the ID for pieces other than Knight, as by default it would take the (capitalized) first character of the name.


💡📝Aurelian Florea wrote on Tue, Jun 23, 2020 08:19 AM UTC:

HG,

About the king: It does not castle bun while virgin it may leap one rank back using a knight or camel jump. I am thinking that in xbetza is : KimbsLimbsN. Is it correct?

The pieces are missing beacuse they should be added by shuffling. But for now I can;t do this. It probably should be treated as a particular case as the algorithm for placing piece from this game is rather weird, but you had said it may be done by java script.

 

Also I want to see the brouhaha code and the 960 code.


H. G. Muller wrote on Tue, Jun 23, 2020 09:16 AM UTC:

The Diagram does have a shuffle option now. But to make that work you should first place the pieces in some 'reference position', and then indicate in a shuffle option which piece types you want to permute. (It can then see the set of squares that should be involved in the shuffle.) Depending on whether the King has a castling move defined on it, the shuffle will respect its placement between the corner pieces during the shuffle, or not. In your case you have no castling, and there would be no restriction to the King placement.

In Chess960 the reference position would be FIDE; from this it would then know that the castling partners are Rooks, and that the King must remain between the Rooks. BTW, the Diagram does not implement Fischer castling; no way has been devised yet to indicate that in XBetza; the On notation would mean something else. Perhaps OX ? But as far as the shuffling is concerned, you could say shuffle=N!BRQK, where the exclamation point before the B indicates Bishops should be equally distributed over shades. When you ask it to do impossible things the results will be undefined.

I don't know whether this shuffle option satisfies your needs. A straightforward enhancement of it could be to allow multiple 'shuffle groups' (say comma separated in the shuffle option), where it would then apply the same shuffling as it does now to each group independently. (They had better be non-overlapping groups then, or the results would get statistical bias.)

And yes, your King move seems correct. But you should be able to see that in the XBetza sandbox, when you ask for the move diagram.

To see diagram source in a comment I usually click the 'View' link at the bottom of the comment to see it in isolation (so that I don't have to look for it on a page that contains lots of other stuff), and ask my browser to show the page source. There will still be a lot of stuff before it for the menu bar, and all the adds, but you can always use the browser search function to look for 'idiagram'.


💡📝Aurelian Florea wrote on Tue, Jun 23, 2020 12:34 PM UTC:

HG,

1. I still have not figured out how to make the squares, brouhaha

2. It may be a nice feature to display the brouhaha squares in a different colour

3.I don't think the shuffling works in this particular case (please read the article) but probably a javascript code is possible to do. Unfortuneatly I don't know Java script so if you can help me here I'd really apreciate it.


H. G. Muller wrote on Tue, Jun 23, 2020 01:30 PM UTC:

1. I still have not figured out how to make the squares, brouhaha

Just define a first piece with name 'hole' (the ID, move and image fields will be ignored), and a list of 'starting squares' where you want the holes to be. Then you also specify a piece to start at one of those squares. All holes act as brouhaha squares, also during the game: you can place pieces on them, and when you then move them away they revert to black.

2. It may be a nice feature to display the brouhaha squares in a different colour

I will think about it. Perhaps dark grey.

3.I don't think the shuffling works in this particular case (please read the article) but probably a javascript code is possible to do. Unfortuneatly I don't know Java script so if you can help me here I'd really apreciate it.

Well, this sounds more like placement chess with some restrictions than like shuffling. The logcal solution would be to put all the pieces in hand (except those that have fixed location, like Kings and Rooks). For easy placement just display the piece table permanently next to the board. You can do that by defining in the diagram parameters satellite=apothecary , and then somewhere on your page put a HTML element <table id="apothecaryTable"></table> . The Diagram script will then put the piece table there, rather than collapsible under the diagram, and people can directly drag the pieces to the Diagram.


💡📝Aurelian Florea wrote on Tue, Jun 23, 2020 01:52 PM UTC:

HG,

I'm not sure what placement chess is.

I was wondering if the placement of the pieces may be done automatically. Can a javascript be written to do this. and after each restart another legitimate initial position can be generated.


💡📝Aurelian Florea wrote on Mon, Jun 29, 2020 02:07 PM UTC:

@Fergus

I have tried to implement the ban on special moves while the virgin king is in check. I'm far from the result.

Could you take a look at the link below?

https://www.chessvariants.com/play/pbm/play.php?game=Apothecary+Chess+2&settings=Apothecary2working&submit=Edit


🕸Fergus Duniho wrote on Mon, Jun 29, 2020 03:38 PM UTC:

This should be handled in the Apothecary_King function and in the Apothecary_King subroutine, not externally. Furthermore, the subroutine should not call the function. Each one should handle this independently from the other.


💡📝Aurelian Florea wrote on Mon, Jun 29, 2020 05:19 PM UTC:

I have separated the 2 codes but never are the special moves availeble. I'm not sure about what to do!


🕸Fergus Duniho wrote on Mon, Jun 29, 2020 07:15 PM UTC:

The subroutine should undo the King's move before checking whether it is in check. If the move is legal, then it should redo it. The function does not need to undo and redo the King's move, but it should make sure the King is not in check before allowing the special moves. Also, each should handle the regular moves before checking whether the King is in check. Your current subroutine is very wasteful, because it will check whether the King is in check every single time.


💡📝Aurelian Florea wrote on Tue, Jun 30, 2020 08:18 AM UTC:

You are saying the the checked subroutine must be used inside the function?

Like that:

def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and match rankname #1 1 10
and flag #0
and not sub checked $origin
or checkleap #0 #1 1 0 
or checkleap #0 #1 1 1;

because this does not work.


🕸Fergus Duniho wrote on Tue, Jun 30, 2020 02:03 PM UTC:

$origin should not be included in the function definition. It may be used as an argument when calling a function or subroutine, but it should not be included in the definition of one. You should check the flag before calling the checked subroutine, because that will minimize the use of the subroutine. The same goes for checking the rank of the destination. Always do less expensive operations before more expensive operations, because that will minimize the need to do the most expensive operations.


💡📝Aurelian Florea wrote on Tue, Jun 30, 2020 06:45 PM UTC:

I have made the distinction between the function and the subroutine. But I still could not make work as expected.

def Apothecary_King
checkleap #0 #1 1 3
or checkleap #0 #1 1 2
and not sub checked #0
and match rankname #1 1 10
and flag #0
or checkleap #0 #1 1 0 
or checkleap #0 #1 1 1;

 

sub Apothecary_King from to:
if checkleap #from #to 1 1 or checkleap #from #to 1 0: 
return true;
endif;
move #to #from;
     if checkleap #from #to 1 3
     or checkleap #from #to 1 2
     and match rankname #to 1 10
     and flag #from :
         if sub checked #from:
         die You may not perform the special moves out of check.;
          endif;
     else:
     move #from #to;
     return true;
     endif;
endsub;


🕸Fergus Duniho wrote on Tue, Jun 30, 2020 11:50 PM UTC:

The function looks fine. In the subroutine, you should remove the else.


🕸Fergus Duniho wrote on Tue, Jun 30, 2020 11:54 PM UTC:

Also, add "return false;" to the very end of the subroutine.


💡📝Aurelian Florea wrote on Wed, Jul 1, 2020 04:40 AM UTC:

The new sub looks like this:

sub Apothecary_King from to:
if checkleap #from #to 1 1 or checkleap #from #to 1 0: 
return true;
endif;
move #to #from;
     if checkleap #from #to 1 3
     or checkleap #from #to 1 2
     and match rankname #to 1 10
     and flag #from :
         if not sub checked #from:
         move #from #to;
         return true;
         else die You may not perform the special moves out of check.;
         endif;
      endif;    
     return false;
endsub;

When trying to use regular moves out of check, I get the error "you cannot move into check.". This happens with or without the else part.


🕸Fergus Duniho wrote on Wed, Jul 1, 2020 04:40 PM UTC:

I didn't say to get rid of the else clause. I said to get rid of the else. Just the else. A single line of code.


💡📝Aurelian Florea wrote on Wed, Jul 1, 2020 04:56 PM UTC:

It still gives the error:  "you may not move into check".


💡📝Aurelian Florea wrote on Thu, Jul 2, 2020 08:51 AM UTC:

@ Fergus,

I have found the mistake. 
This piece of code was missing and adding it has solved the problem.

if == moved K: 
unsetflag f2;
set Kpos $dest;
endif;


💡📝Aurelian Florea wrote on Fri, Jul 3, 2020 11:38 AM UTC:

@Fergus,

I have unfortunately uncovered another bug on the preset for this game.

The joker can't move when imitating a pawn, although the moves are properly displayed. Any idea why?

 


🕸Fergus Duniho wrote on Fri, Jul 3, 2020 05:02 PM UTC:

Since it works for displaying legal moves, it's probably because the Pawn functions are only for potential moves, and the Joker is trying to use one of the Pawn functions when making an actual move. Specifically, I think it fails on the line "and empty #1" in the Pawn function, because that space is occupied for an actual move. Some options include changing your rules, rewriting the Pawn functions to handle both potential and actual moves, or using a Joker subroutine for actual moves, which would let you undo the Joker's move before testing it with a function, then redoing it if it is legal.


💡📝Aurelian Florea wrote on Mon, Jul 6, 2020 12:29 PM UTC:

@Fergus

The way I had thought the game, the joker should, when imitating a pawn, get only the regular power and not promotion rights or double move privileges. And that works best with moving some of the lines in the pawn function to the pawn subroutine. It should be rather easy.


🕸Fergus Duniho wrote on Mon, Jul 6, 2020 01:28 PM UTC:

I wouldn't recommend that. That doesn't sound like the correct solution to your problem.


💡📝Aurelian Florea wrote on Mon, Jul 6, 2020 01:41 PM UTC:

Ok, thanks for the heads up. I'll try to think at something else.


💡📝Aurelian Florea wrote on Tue, Jul 21, 2020 01:13 PM UTC:

@Fergus

A few weeks ago I have figured out that the joker imitates the pawn in all things which causes the joker moves to not be allowed.

To tackle this issue I have decided to write a Barren_Pawn function that the joker will use when imitating a pawn instead of imitating the regular pawn function. Otherwise things are unchanged. The Barren_Pawn functions are:

def White_Barren_Pawn checkaleap #0 #1 1 0 and empty #1 islower space #1 and or checkaleap #0 #1 1 -1 checkaleap #0 #1 1 1;

def White_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;

def Black_Barren_Pawn checkaleap #0 #1 -1 0 and empty #1 isupper space #1 and or checkaleap #0 #1 -1 -1 checkaleap #0 #1 -1 1;

def Black_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;

The piece of code involving the joker imitation is:

if != const alias $moved White_Joker:
  if != const alias $moved Pawn:
    set last_type_moved const alias $moved;
  else:
    set last_type_moved White_Barren_Pawn;
  endif;
endif;

and for black:

if != const alias $moved Black_Joker:
  if != const alias $moved Pawn:
    set last_type_moved const alias $moved;
  else:
    set last_type_moved Black_Barren_Pawn;
  endif;
endif;

I thought it should easily work. Unfortunately it does not. Any idea why that is?


82 comments displayed

Earlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.