🕸💡📝Fergus Duniho wrote on Sun, Nov 1, 2009 03:03 AM UTC:
I have now modified the store and restore commands to use labels. For backwards compatibility, they can be used without labels. When used without a label, they use the default label of 'last'. When used with labels, you can use them to keep a running record of past positions. Before each move, for example, you could have a preset automatically make a new label based on the turn number and whose turn it is to move, then have players remember the convention used for labels to restore the position to what it was on a previous turn. Or you could write a subroutine that takes two arguments, such as turn and side to move, to generate the right label and use it with the restore command. Here's some sample code:
Pre-Game
set turn 1;
sub gobackto side turn:
set label join #side #turn;
restore #label;
endsub;
Pre-Move 1:
set label join White #turn;
store #label;
Pre-Move 2:
set label join Black #turn;
store #label;
inc turn;
I have now modified the store and restore commands to use labels. For backwards compatibility, they can be used without labels. When used without a label, they use the default label of 'last'. When used with labels, you can use them to keep a running record of past positions. Before each move, for example, you could have a preset automatically make a new label based on the turn number and whose turn it is to move, then have players remember the convention used for labels to restore the position to what it was on a previous turn. Or you could write a subroutine that takes two arguments, such as turn and side to move, to generate the right label and use it with the restore command. Here's some sample code:
Pre-Game Pre-Move 1: Pre-Move 2: