Check out Grant Acedrex, our featured variant for April, 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

Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Wed, Nov 24, 2021 07:34 AM UTC in reply to Fergus Duniho from 02:07 AM:

Yes, it is from the GAME code. But is seems the GAME code is right about this: Daniel says below that the initial position is all wrong, and indeed contains no royal.

This is a shuffle game, so it calls the general shuffle code in the Pre-Game section. This performs the shuffling, and stores the result in a constant. So that later invocations of the preset will use that same shuffle. A new shuffle is only made when the constant is not defined. This works fine in Play mode.

Can it be that the constant for remembering the initial position gets corrupted when an invitation is accepted?

For reference, below is the basic principle of the shuffling, by the routine ShuffleSetup called from the Pre-Game code:

sub ShuffleSetup:
  // performs the shuffles described in the above arrays
  if isconst startshuffle:        // shuffle has already been determined
    setsystem space startshuffle; // retrieve it
  else:                           // new game; must shuffle
    ... // shuffle the initial setup in $space
    setconst startshuffle $space;        // save the shuffle for persistent use
  endif;
endsub;