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 29 04:13 PM UTC in reply to Aurelian Florea from 08:25 AM:

You can create a user-defined array with the same value as $legalmoves, edit that array, then use setsystem to change the value of $legalmoves to your edited array. Alternately, you can use push to add each legal move you want to keep to a new array, then use setsystem to assign this new array to legalmoves. Here's an example I did in the Pre-Game code just to test it:

// Assign usual legal moves to White Pawns
for f range a h:
  set from join #f 2;
  set to1 join #f 3;
  set to2 join #f 4;
  setlegal #from #to1;
  setlegal #from #to2;
next;

// Keep all legal moves except the e Pawn's double move
set lglmvs ();
for v $legalmoves:
  if != #v "P e2-e4":
    push lglmvs #v;
  endif;
next;

setsystem legalmoves #lglmvs;