Comments/Ratings for a Single Item
Thank you!
@HG
I need your help to fix this preset that was coded using the Play-test applet: Cetina Random Chess. Originally it was fine but something happened that ruined it. The software warns:
Syntax Error on line 977h1 f1 b1 g1 e1 c1 a1 is not a valid expression, because h1 is not a recognized piece, coordinate, command, or subroutine.
Thank you before hand for your attention.

Since I did not change anything to the shuffle.txt include file for ages, it is likely that it stopped working because Fergus changed something. So
@Fergus:
Do you have any idea why the GAME-code line
eval merge #dark "shuffle"; // to shuffle all the remaining
stopped working? It is so long ago I wrote this that I don't recall anymore what it was supposed to do, but I guess the merge operator was supposed to cook up a GAME-code statement 'shuffle ARRAYOFSQUARES', that should then be executed by the eval. In order to shuffle the pieces on those squares.
The error message in Carlos' preset:
h1 f1 b1 g1 e1 c1 a1 is not a valid expression
suggests that the second operand (the literal string "shuffle") is somehow ignored.
Since I did not change anything to the shuffle.txt include file for ages, it is likely that it stopped working because Fergus changed something.
I don't see any include file by that name.
Do you have any idea why the GAME-code line
eval merge #dark "shuffle"; // to shuffle all the remaining
This is using the eval command to turn the result of the expression merge #dark "shuffle"
into a command. In test code that just assigns this to a variable, I get a copy of the #dark array without the keyword shuffle in the array. I suppose the intention was to pass the contents of the #dark array as arguments to the shuffle command, as it would not take an array as an argument.
The word shuffle was placed in quotation marks to prevent it from being evaluated as a function, but it appears this no longer works. When I tried the spelling shuphle, merge returned an array that included the word. While putting it in quotation makes did not work, this code did work:
eval merge #dark join "shuf" "fle";
Using some recent changes to the language, this code would also work:
shuffle {list #dark};
And I have now modified the shuffle command so that this works:
shuffle #dark;

OK, I changed it to simply use this new 'shuffle #dark' (and similarly in 3 other place), and now Carlos' preset appears to work again.
Whenever you try to establish a new setup, the same position appears, which clearly indicates that the shuffle function is not actually working.
Whenever you try to establish a new setup, the same position appears, which clearly indicates that the shuffle function is not actually working.
The problem was with my new code. I had to begin the for loop at 0 instead of 1, and that fixed it.
Okay. The preset is now correctly shuffling the different setups. However, the bishops conversion rule is not working properly.
I'm testing two presets:
The conversion rule is failing on both.
I edited the #1 recently from the source code corresponding to the interactive diagram that HG inserted on the page that shows the game rules.
I edited the #2 several years ago directly from the Play-test applet.
Now then,
the #1 says in the Post-Move 1:
gosub HandleMove false;
and in the Post-Move 2:
gosub HandleMove true;
while the #2 says in the post-Move 1:
gosub HandleMove false;
if == B #mover and not flag #ori:
set wstart cond checkleap #ori #desti 0 1 1 2;
endif;
and in the Post-Move 2:
gosub HandleMove true;
if == b #mover and not flag #ori:
set bstart cond checkleap #ori #desti 0 1 1 2;
endif;
How and why did this difference arise? Why does the conversion rule fail on both presets?
Fergus & HG:
I just checked a third preset called Cetran Chess 1 (which is essentially identical to the ones mentioned before) and it turns out to be working perfectly fine. This one has the following code in the Pre-Game section that those ones lack:
0
1 99 1 1 3 // pure bishop(598)
1 99 1 -1 3
1 99 -1 -1 3
1 99 -1 1 3
0);def B cond #0 (cond flag var ss 598 cond == 1 var wstart 598 cond var wstart 124 104) 0;
def b cond #0 (cond flag var ss 598 cond == 1 var bstart 598 cond var bstart 124 104) 0;
So there is no problem to solve anymore and therefore I am infinitely grateful to you both.
10 comments displayed
Permalink to the exact comments currently displayed.
This is indeed something that cannot be done through the Applet, but which can be specified in the HTML for an Interactive Diagram. With the promoChoice parameter you can specify several 'promotion sets', separated by slashes. For each piece that promotes you can then specify a morph parameter to indicate where it promotes, and a digit 1-9 would indicate which of the extra promotion sets should be offered as choice there. (For the first set the square in the morph value should be set to *.)