There isn't that much context; it is in a subroutine, and sqr and piece are 'my' variables, which should pretty much decouple it from the remaining code:
sub GetSquares toshuffle:
my sqr piece;
// determine the squares the pieces in the given set are on.
// the result is left in 3 global arrays:
set left array; // on left board half
set light array; // as well as sorted by shade
set dark array;
printr $space;
for (sqr, piece) $space:
print . iter . #piece #sqr;
if match #piece #toshuffle:
if < * 2 file #sqr lastfile: // left half
push left #sqr;
endif;
if & 1 + file #sqr rank #sqr: // distinguish by shade
push dark #sqr;
else:
push light #sqr;
endif;
endif;
next;
print "got it";
endsub;
This routine is in the shuffle.txt file included in the preset Aurelian posted the link to 5 postings ago in this subject thread. That preset calls the routine ShuffleSetup (at the very bottom of the Pre-Game section), which eventually calls this routine. If you click that link it directly tries to execute the preset, which immediately exits after printing the $space array, and "iter0". It never gets to the "got it".
There isn't that much context; it is in a subroutine, and sqr and piece are 'my' variables, which should pretty much decouple it from the remaining code:
This routine is in the shuffle.txt file included in the preset Aurelian posted the link to 5 postings ago in this subject thread. That preset calls the routine ShuffleSetup (at the very bottom of the Pre-Game section), which eventually calls this routine. If you click that link it directly tries to execute the preset, which immediately exits after printing the $space array, and "iter0". It never gets to the "got it".