Check out Alice Chess, our featured variant for June, 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

Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Wed, May 22 02:27 PM UTC in reply to Aurelian Florea from 09:43 AM:

It's the "set many" line that is causing the screen to go blank. I modified your code to this, and the screen went blank after I moved one Black piece.

sub blackInitialHandle:
 set tm thismove;
 set source1 join char thismove 2 char thismove 3;
 set dest1 join char thismove 5 join char thismove 6 char thismove 7;
 set source2 join char thismove 11 char thismove 12;
 set dest2 join char thismove 14 join char thismove 15 char thismove 16;
 move #source1 #dest1;
 move #source2 #dest2;
 set many ok 1 promo 0 ori #source1 desti #dest1 mover space #dest1;
die "ok: " #ok "promo: " #promo "ori: " #ori "desti: " #desti "mover: " #mover;
endsub;

The problem is that "set many" does not work with expressions. Each value assigned to a variable must be a scalar value or a variable value. When I changed your code to this, it did work:

sub blackInitialHandle:
 set source1 join char thismove 2 char thismove 3;
 set dest1 join char thismove 5 join char thismove 6 char thismove 7;
 set source2 join char thismove 11 char thismove 12;
 set dest2 join char thismove 14 join char thismove 15 char thismove 16;
 move #source1 #dest1;
 move #source2 #dest2;
 set many ok 1 promo 0 ori #source1 desti #dest1;
 set mover space #dest1;
endsub;

However, since it handled only one piece at a time, there are still pieces in the middle of the board, and they are now able to move normally, which is not what you want.