Comments by catugo
I don't now what you are doing. Please give me more details. Is it a game you play or an older log?
Please try again!
I think I had solved it. If not I had corrected the error for another Apothecary chess modern preset. So please say that it does not work, if the case.
I have defined the none range piece type definition with (()()): def None-Range (()()); That because the error I mentioned earlier was that the piece that was the joker imitating was not an array.
@Greg,
The preset you have shown me is an older one. The newest ones are: https://www.chessvariants.com/play/pbm/play.php?game%3DApothecary+Chess-Classic%26settings%3DApothecary_Chess-Classic https://www.chessvariants.com/play/pbm/play.php?game%3DApothecary+Chess-Modern%26settings%3DApothecary_Chess-Modern.
Hopefully I'll have the time today to update the older presets.
It looks to me that initializing the joker with none cannot be done. When I had selected rook things work out fine!
@Fergus, As I had said in the previous message on this topic I have an error in my apothecary presets.
https://www.chessvariants.com/invention/apothecary-chess-1 https://www.chessvariants.com/invention/apothecary-chess-2
The for loop in the links above tries to the None piece for checking the legality. I remember the code working. Is it possible that some game code changes hinders this preset? Or is it a regular bug?
I have a problem with the apothecary presets. The ones that are in their final shape give an error at this code (second line-1061)
1060 for (from piece) fn friends 1061 for to fn join const alias #piece "-Range" #from 1062 if fn const alias #piece #from #to and not fn friend space #to and onboard #to 1063 move #from #to 1064 if not sub checked cond == #from #kingpos #to #kingpos 1065 setlegal #from #to 1066 endif 1067 endif 1068 restore 1069 next 1070 next
Do other presets have the same problem, as I remember mine working the last time I had checked?
There is an error in the article probably. When castling is described it says that the king moves 3 squares but this can't happen when castling short as the rook is in the way.
I have accepted these days 2 challenges as white and I got black (as the default). One was shako and the other is opulent chess. Is this a problem of mine or of the website?
I think this article is ready for publishing the Apothecary Chess-Classic game.
I think this article is ready for publishing the Apothecary Chess-Modern game.
Since this comment is for a page that has not been published yet, you must be signed in to read it.
It works well. I hope there are no more bugs. Thanks Fergus!
I have corrected the mistake and now it goes like this:
def White_Barren_Pawn
checkaleap #0 #1 0 1 and cond empty #0 not capture empty #1
or and checkaleap #0 #1 -1 1 or checkaleap #0 #1 1 1
cond empty #0 capture islower space #1;
def White_Barren_Pawn-Range merge leaps #0 1 0 leaps #0 1 1;
def Black_Barren_Pawn
checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1
or and checkaleap #0 #1 -1 -1 or checkaleap #0 #1 1 -1
cond empty #0 capture isupper space #1;
But during my tests I came across the fact that a joker imitating a barren_pawn does not have the ability to capture another joker (although it is fine when capturing a knight).
I'm confused about what you want to say. Isn't it that : and cond empty #0 capture isupper space #1; does exactly that, capture for actual moves, and isupper space #1 checks for a potential victim in potential moves? Where am I wrong?
I have corrected the post move code to:
if != const alias $moved White_Joker:
if != const alias $moved White_Pawn:
set last_type_moved const alias $moved;
else:
set last_type_moved Black_Barren_Pawn;
endif;
endif;
and similar for black. This code works.
But the Barren_Pawn worked fine when I had done only the move part of the pawn's powers but now I have added the capture part and nothing is legal anymore. Please help if you may! The code in question is:
def Black_Barren_Pawn
checkaleap #0 #1 0 -1 and cond empty #0 not capture empty #1
or checkleap #0 #1 -1 -1 or checkleap #0 #1 1 -1
and cond empty #0 capture isupper space #1;
@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?
I have the same problem.
Probably Fergus is working for something new.
Ok, thanks for the heads up. I'll try to think at something else.
@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.
I should use redirect then on the old settings file toward the new one, isn't it?
@ Greg,
I prefer to keep the name and maybe rename the settings files used for old games. Can it be done?
@Oisin D.
I need a moment with no ongoing games so that I can change the pieces from Griffin and Aanca to Dragon and Griffin, so please temporarilly delete your pending invitation.
@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,
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;
I don't have any restriction, Brouhaha (the game) even have special powers that allow easier deployment in the beginning.
Indeed it is I who has started using this name. It seemed apropiate to me, but at the time I have not put much though into it!
It still gives the error: "you may not move into check".
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.
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;
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.
I have separated the 2 codes but never are the special moves availeble. I'm not sure about what to do!
@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?
I played against the AI in the interactive diagram .
when a pawn of mine has reached the promotion zone the promote menu has not appeared.
My guess is that the rank with brouhaha squares is counted as the final rank so the 3rd from last is unpromotable, the 2nd from last behaves as the 3rd from last should, and so on.
@HG,
Does the extended notation understand that the royal piece cannot move in certain ways out of check?
For example in orthodox chess the king cannot move out of check.
In my apothecary games the virgin king may make a knight or camel leap 1 rank back, but not out of check.
Fergus,
I want to use the same set, not another one, but with a dragon picture instead of a bird picture. Is that even possible or should I make another piece set from the beginning?
To the editors.
Can a piece set be changed or it needs to be redone from the beginning?
I want to change in the apothecary chess standard piece set the bird with the dragon.
have written the following code but I don't know where to call the subroutine.
sub King from to
move #to #from;
if sub checked #from:
verify or checkleap #from #to 1 0 checkleap #from #to 1 1;
else:
verify fn King #from #to;
endif;
move #from #to;
endsub;
;
@Fergus,
I have remade the code to work as expected for the king to not be able to use the special moves out of check:
/play/pbm/play.php?game%3DApothecary+Chess+1%26settings%3DApothecary1working
The relevant piece of code for white is:
if flag f2:
if == moved K:
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;
endif;
endif;
There is still the problem that the special moves are displayed as legal when a king is in check. Is that solvable?
@HG,
Indeed HG, now the diagram works as expected for me too!...
Thanks!
I'm not sure why but the diagram still does not work.
It behaves the same way.
I'm wondering if you have not tried to put a bishop over an already occupied square. Would this be an error?
I have tested it by pressing restart and it does not go well. The queen and knigt get swaped. But not the way I described in the rules. My code is here:
<script type="text/javascript" src="../membergraphics/MSinteractive-diagrams/betza.js"></script>
<div style="float:left;margin:0 40px 20px 0;">
<div class="idiagram">
files=10
ranks=12
holdingsType=1
promoZone=3
promoChoice=!P*N*B*C*W*R2*J2*Q1*D1*G1
graphicsDir=../graphics.dir/alfaerie/
whitePrefix=w
blackPrefix=b
graphicsType=gif
squareSize=54
symmetry=mirror
shuffle=G:BD,:BN,GDQ
hole::::a1,b1,c1,i1,j1,,a12,b12,c12,i12,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:NmHmA:knight:c3,h3,,c10,h10:1
wizard:W:FL:mage:d1,g1,,d12,g12
champion:C:WAD:champion:e1,h1,,e12,h12:1
joker:J:fI:fool:f1,,f12
dragon:D:FyafsF:dragon:i3,,i10
griffin:G:WyafsW:gryphon:b3,,b10
king:K:KimbsLimbsN:king:f3,,f10
</div></div>
I had tested it be pressing restart a few times on the diagram. Refresh gives me the initial position.
@HG,
I remembered seeing a diagram with randomized setup, but I cannot find it anymore.
@Fergus,
I have moved the buggy code back to the old testing ground:
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;
The way this goes wrong is that other pieces other than the king are affected by it. Any idea why?
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.
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.
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.
HG,
I'm trying to see the code for the diagram bellow but I cannot. May you help me?
@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?
I removed the buggy code.
Now it should work!
@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,
I have solved it:
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;
All right, you were correct on that final point, but things are not done.
Let us start from scratch. Maybe I'll understand what is going on.
The code that greg has suggested:
if and flag f2 == moved K:
for the condition that enters the main code in question does not work although the way I see it it should.. It is always false. I have checked for the flag. That works fine so it moved be the == moved K part. But I can't see why!
I know that. This is why the error seems weird to me. I'll get back to you on that!
I see what you say but with that I get always false. And the flag works well. I had checked. So it is the equality. If i write if and flag f2 moved == K then it works for the king but the code enters for other pieces too which is weird. So maybe == moved K regardless of how is written does not give the expected answer but all T or all F, which is weird. And that probably means I have trouble somewhere else.
@Fergus,
I'm glad to say I have managed to make it work.
Here is the code that does well:
if flag f2 and moved == K:
move $dest $origin; // Temporarily undo King move
if sub checked $origin and not checkleap $origin $dest 1 0 or checkleap $origin $dest 1 1:
die A King may not castle out of check.;
endif;
move $origin $dest;
endif;
if == moved K:
unsetflag f2;
set Kpos $dest;
endif;
if sub checked var Kpos:
die You may not move into check.;
endif;
Later edit:
But althought the code works for white it does not work for black well, and also there is a weird side effect where a queen move on the first square generates the a king may not castle out of check error. So there is still work to do despite the progress.
2nd edit:
I think I have found the bug that generates both problems. It is the first if :
if flag f2 and moved == K:
this is either always true or always false if I move the == ahead of moved but I cannot get it to work in the intended way which is enter the condition when flag f2 of set and the K has just been moved.
I had tried the following in the postmove section 1 but with little succes:
if flag f2 and == moved K:
move $dest $origin; // Temporarily undo King move
if sub checked $origin:
die A King may not castle out of check.;
endif;
move $origin $dest;
endif;
@HG,
I will be changing the pictures once I figure out how.
For now you can use the symbolic apothecary piece set.
@Fergus,
I have noticed that I forgot to ask you how to restrict the king's special moves to when the king is not in check. May you give me a final extra hand for this project?
The preset is here : https://www.chessvariants.com/play/pbm/play.php?game=Apothecary+Chess-Modern&settings=ApothecaryChess-Modern
Can I do the following changes to the apothecary: standard piece set?
I'd like to be able sometime myself because in the near future I hope to come up with some other new games.
Add a dragon (with the letter D)
Delete the Bird
Rename the AB to A the CA to L and the CH to H
Considerring the arguments made by Jean-Louis Cazeaux I have changed the names of 2 of the pieces to my original intent so the griffin and aanca became dragon and griffin (meaning the aanca is called griffin now).
I had found a function called weird promotion. I'll get to it tommorrow. Thanks HG!...
Later Edit: I don't understand how the rule that states that you must have the pieces in reserve is implemented.
I'll take a look on Grand chess also, I guess!
I thought the AI would be easy picking but it is not :)!
HG,
If you have time to make the interactive diagrams AI work on the particular cases of chess960 (for the initial position randomness) and gross chess (for the promotion rule) I'd really apreciate it for my apothecary games as I think I would be able to do interactive diagrams on them, too.
HG,
The script works wonderfully. Thanks!
Microsoft edge got updated last night. I think this is why!
No matter.
Now it works.
Microsoft edge got an update. I think that is the reason.
Thanks Fergus!
Why does the below diagram asks to put the gated piece on the board?
HG,
Have you made a documentation with all your additions to Betza notation?
By shuffling i meant like in 960 indeed. I remember you doing the shuffling especially for this game but I then lost it when I lost the device where it was saved. Once I get to the interactive diagram on apothecary chess I will ask this favor of you. Thanks!
I had managed to clear the cache but the error still goes. I use microsoft edge.
Wow cool thing supporting the imitator. I remember earlier versions were not able. Does the AI work also with it? This could sound silly, but random initial positions are supported?
And by the way, talking about previous moves, is there a way they will be taken into account as I am thinking about the joker in my apothecary chess game.
The game started from regular initial position and it went like this : 1. Ng5 Cd11 2. e5 Ci11 3. j5 Nf8 4. h5 Tg10 5. Ng6 Nxg6 . I'm not sure what needs refreshing.
@HG,
Hello,
I had just tried it and my advanced lyon defended by the DH got captured by the AI. I then tried it again. It seems to happend to player's lyon on 6th rank once the second dk pawn got moved. Maybe if you try reproducing such a position you may find the bug!...
I got it. But in the "description of your submition" (I have earlier noticed that in other boxes of the same type.) I can't post any links as the ok button does not work in the url posting window.
Hello Thor,
I have sent 2 general invitations 1 for each game. It should work.
@Thor
I had sent you an invitation with the new preset.
@Thor
I had sent you an invitation with the new preset.
Hello Fergus,
Ok! I have done that. I have 2 questions though.
How do I get read of the old presets? I need a clean everything to start over.
Why the new presets for Apothecary Chess- Modern and Apothecary Chess- Classic (it is how I renamed the games) don't appear on the website in the games to play folder.
I am receiving alerts again for a few weeks now.
It does not seem to work all the time!
Oh!.... That was the point of the diagram!!! Silly me!
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.
I have updated and brushed up the article for this game and the preset now is in working order (here). Thanks to all of you out there contributing with thoughts and especially Fergus for the help with the preset. Have fun guys!
I'd like to modify the names of my apothecary1working preset to apothecary chess modern and apothecary2working preset to apothecary chess classic. If space cannot be used then an underscore is fine.
The last thing I'd like to consider is that I'd like to try an unseen to my knowledge type of symmetry. The jokers will fill a place in the brouhaha squares but mirroring the center of the board like in mirror symmetry while the rest of the pieces have regular symmetry. This has the advantage of populating the board in a balanced way (as many pieces on both sides of the board), although one player will have a king side minor advantage while the other will have a non-king side minor advantage. I'd like to call this twist symmetry. Twist symmetry would mean that we split the pieces of one side in two so that one part has mirror symmetry to the opponent while the other has regular symmetry. This concept resembles the mathematical concept of Chiral symmetry but I'm not sure about a proof that it is the same thing.
https://www.chessvariants.com/play/pbm/diagram-designer.php?submit=Update&code=---jww----%2Fr3cc3r%2F1abngknbq1%2Fpppppppppp%2F10%2F10%2F10%2F10%2FPPPPPPPPPP%2F1ABNGKNBQ1%2FR3CC3R%2F----WWJ---&shape=square&scale=100&group=Apothecary+Chess&set=apothecary-standard&files=a+b+c+d+e+f+g+h+i+j+&ranks=0+1+2+3+4+5+6+7+8+9+10+11&font=Verdana&point=12&cols=10&board=23.10.01.10.01.10.01.10.01.10.01.32.&colors=339933+CCCC11+DD99DD+FFBBFF&bcolor=111199&tcolor=EEEE22&bsize=16&bgimage=maple-walnut.png&nextfile=50+0&nextrank=0+50
@Thor,
Programming the brouhaha squares in game code is quite easy. In C++ or another language for an engine I'm not sure!
@HG,
That one turn delay makes the game possible, and quite fun in my experience! These principles came up from 4 years of testing with human players!
@HG,
Withouht the brouhaha squares the wizard may quickly capture powerfull pieces in the opening. That was the initial idea but it does not work! Also, this way rooks stay conected.
@Thor,Greg&Fergus
Thanks guys for your thoughts on the matter.
So the crux of the matter it is that the dropping of the joker is not needed but the initial position should be given further consideration. What about then adding another brouhaha square for the joker? This would mean a champion more to the side. King in it's original position. King keeps special initial moves.
100 comments displayed
Permalink to the exact comments currently displayed.
I cannot figure out what is going on. To me the preset in question works fine. Any suggestions?