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 ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order LaterLatest
Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Fri, Feb 9 10:32 PM UTC in reply to Daniel Zacharias from 09:49 PM:

If I change the starting position for a game, would it break existing logs for that game?

Yes, it will unless you change the name of the settings file.


Daniel Zacharias wrote on Sun, Feb 18 12:48 AM UTC:

Could I get help with this?

set wbl (e3 f2);
def other cond == #0 #wbl.0 #wbl.1 cond == #0 #wbl.1 #wbl.0 0;
print fn other e3;

The result is always 0, but I would expect f2.


🕸📝Fergus Duniho wrote on Sun, Feb 18 01:26 AM UTC in reply to Daniel Zacharias from 12:48 AM:

I agree with you that it should produce f2, and that is what it produced when I ran it.


Daniel Zacharias wrote on Sun, Feb 18 01:28 AM UTC in reply to Fergus Duniho from 01:26 AM:

ok, now it does for me too. Thanks anyway.


Diceroller is Fire wrote on Sun, Feb 18 01:19 PM UTC:

How and where to set brouhaha squares?


H. G. Muller wrote on Sun, Feb 18 01:20 PM UTC in reply to Diceroller is Fire from 01:19 PM:

Through the Play-Test Applet?


Diceroller is Fire wrote on Sun, Feb 18 01:21 PM UTC in reply to H. G. Muller from 01:20 PM:

In preset made through Play-test


H. G. Muller wrote on Sun, Feb 18 01:55 PM UTC in reply to Diceroller is Fire from 01:21 PM:

Unfortunately creating holes in the PTA does currently not work, and for a long time I could not repair it, because a wrong classification of the format destroyed the page on any edit. But now that I changed the format to 'text' I can fix things again, so I guess it is high time I do that. In the PTA you would create a brouhaha square by creating a hole and placing a piece on it.

The simplest way to do it now is add a line to the Pre-Game code by hand:

set brouhaha (...);

with ... a space-separated list of the square labels of the squares you want to be brouhaha squares.


Diceroller is Fire wrote on Sun, Feb 18 04:03 PM UTC in reply to H. G. Muller from 01:55 PM:

Where, after which constants/words it should be to work properly? Now it isn’t.


H. G. Muller wrote on Sun, Feb 18 04:11 PM UTC in reply to Diceroller is Fire from 04:03 PM:

Basically anywhere theat is not inside the definition of another array. Just adding it as a line at the bottom should do.

If you want help in making a preset, it would be useful to post a link to it...


H. G. Muller wrote on Sun, Feb 18 05:00 PM UTC in reply to Diceroller is Fire from 04:31 PM:

Well, that works as designed. When you move the Radioactive Queen away from d1, d1 disappears.


Diceroller is Fire wrote on Sun, Feb 18 05:09 PM UTC in reply to H. G. Muller from 05:00 PM:

How to make other squares on 1 rank holes?


H. G. Muller wrote on Sun, Feb 18 07:12 PM UTC in reply to Diceroller is Fire from 05:09 PM:

You have to indicate that in the FEN of the preset. (I think by a dash.)


Diceroller is Fire wrote on Sun, Feb 18 08:04 PM UTC in reply to H. G. Muller from 07:12 PM:

Well, it works! but how to enforce that first white’s move must be by Superpiece?


Daniel Zacharias wrote on Mon, Feb 19 01:35 AM UTC in reply to Diceroller is Fire from Sun Feb 18 08:04 PM:

how to enforce that first white’s move must be by Superpiece

in the pre-game section add setflag firstmove;

and in post-move 1 add

if != #mover S and flag firstmove:
  die "You must move the S on your first turn";
  unsetflag firstmove;
endif;

Daniel Zacharias wrote on Mon, Feb 19 06:56 AM UTC:
if capture and match $old (bl br):
    capture where $dest direction $origin $dest;
endif;

I put this in the post move, but when it runs it captures the piece at $dest rather than the specified location. It works correctly if I change it to

if capture and match $old (bl br):
    set x where $dest direction $origin $dest;
    capture #x;
endif;

but I don't see why it would make a difference


Diceroller is Fire wrote on Mon, Feb 19 07:03 AM UTC in reply to Daniel Zacharias from 01:35 AM:

But how to set firstmove flag only on the first move? Otherwise it doesn’t let White to move anything but S if flag is in Pre-Move section, and entirely anything if is in Pre-Game section.


Daniel Zacharias wrote on Mon, Feb 19 07:41 AM UTC in reply to Diceroller is Fire from 07:03 AM:

Sorry, I really messed that up. This actually seems to work, if you put it in post-move 1. You don't need the flag.

if != #mover S and == movenum 1:
    die "You must move the S on your first turn";
endif;

H. G. Muller wrote on Mon, Feb 19 07:49 AM UTC in reply to Diceroller is Fire from 07:03 AM:

It must be in the Pre-Game section, not the Pre-Move section. It was just that the unset should not have been within the if-clause, but done unconditionally.


Diceroller is Fire wrote on Mon, Feb 19 10:50 AM UTC in reply to Daniel Zacharias from 07:41 AM:

Thanks it works!


Daniel Zacharias wrote on Mon, Feb 19 09:14 PM UTC:

For a multi-part move, does the post-move code run just once for the whole thing or once for each part?


🕸📝Fergus Duniho wrote on Mon, Feb 19 09:23 PM UTC in reply to Daniel Zacharias from 09:14 PM:

For a multi-part move, does the post-move code run just once for the whole thing or once for each part?

Once for the whole thing. To handle multi-part moves, you can rewind the move and handle one part at a time. For details, you can read How to Program Multi-Move Variants for Game Courier or review the code for either Marseillais Chess or Extra Move Chess.


Daniel Zacharias wrote on Mon, Feb 19 09:46 PM UTC in reply to Fergus Duniho from 09:23 PM:

Why doesn't chess need to do that to handle promotions?


🕸📝Fergus Duniho wrote on Mon, Feb 19 09:58 PM UTC in reply to Daniel Zacharias from 09:46 PM:

Why doesn't chess need to do that to handle promotions?

Promotions are a different type of move than regular moves. Instead of moving a piece from one location to another, a promotion changes the last piece to move to another piece. So, it does not change the values of $origin and $dest. To check whether a promotion has happened, you can compare the value of $moved, which was set when the piece moved from one location to another, with what currently occupies the space moved to (space $dest). When they are different, a promotion has happened, and you can deploy code for testing whether it was a legal promotion.


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.