Once again I need some help with the game courier programming.
I am attempting once again to write rule enforcing presets for my 2 apothecary games.
In my first presets, which I use as basis for development, I had written a short code meant to choose out of the 24 legal initial positions.
Next there is an explanation about what the code is supposed to do.
As I have written in my article apothecary 1&2 have 24 initial possible position which can be chosen by 2 throws of coins and a throw of dice. The first coin throw would decide the placement of the major pieces. If it is centralized (on the d,e&g files) this should be 1 otherwise (on the b,e&i files) it should be 0. The dice throw then decides which of the 6 permutations of pieces occupy the 3 designated fields on the files decided by the first coin (they occupy the 2nd rank for white and the 9th rank for black). The second coin should decide if the bishops occupy the remaining files closer to the king (bishops in) when the coin is 1 or closer to the edge (bishops out). Take note that the fields on the a and j files (ahead of the rooks) are empty.
In order to achieve that I had used the following code for apothecary 1 (for 2 there is just a piece naming difference so far):
empty b2 c2 d2 e2 g2 h2 i2 b9 c9 d9 e9 g9 h9 i9
set coin1 rand 0 1;
set coin2 rand 0 1;
if == coin2 0:
drop Q any b2 e2 i2;
drop A any b2 e2 i2;
drop G any b2 e2 i2;
copy b2 b9;
copy e2 e9;
copy i2 i9;
flip b9 e9 i9;
else:
drop Q any d2 e2 g2;
drop A any d2 e2 g2;
drop G any d2 e2 g2;
copy d2 d9;
copy e2 e9;
copy g2 g9;
flip d9 e9 g9;
endif;
if == coin1 0:
drop N last b2 c2 d2;
drop N first g2 h2 i2;
drop n last b9 c9 d9;
drop n first g9 h9 i9;
drop B last b2 c2 d2;
drop B first g2 h2 i2;
drop b last b9 c9 d9;
drop b first g9 h9 i9;
else:
drop B last b2 c2 d2;
drop B first g2 h2 i2;
drop b last b9 c9 d9;
drop b first g9 h9 i9;
drop N last b2 c2 d2;
drop N first g2 h2 i2;
drop n last b9 c9 d9;
drop n first g9 h9 i9;
endif;
My questions are:
1. How do I know that the preset sets a new random seed, if it does, as I do not seem to find any mention on that in the developer guide besides the constants chapter (by the way the link to fisher random chess from the developer's guide seems to be wrong although I could find the game through game courier->games to play-> the letter F->...)?
2. How would I test that the distribution among the 24 position is constant? The play button (playing with myself) yields the same results always?
Hello everybody!
Once again I need some help with the game courier programming.
I am attempting once again to write rule enforcing presets for my 2 apothecary games.
In my first presets, which I use as basis for development, I had written a short code meant to choose out of the 24 legal initial positions.
Next there is an explanation about what the code is supposed to do.
As I have written in my article apothecary 1&2 have 24 initial possible position which can be chosen by 2 throws of coins and a throw of dice. The first coin throw would decide the placement of the major pieces. If it is centralized (on the d,e&g files) this should be 1 otherwise (on the b,e&i files) it should be 0. The dice throw then decides which of the 6 permutations of pieces occupy the 3 designated fields on the files decided by the first coin (they occupy the 2nd rank for white and the 9th rank for black). The second coin should decide if the bishops occupy the remaining files closer to the king (bishops in) when the coin is 1 or closer to the edge (bishops out). Take note that the fields on the a and j files (ahead of the rooks) are empty.
In order to achieve that I had used the following code for apothecary 1 (for 2 there is just a piece naming difference so far):
empty b2 c2 d2 e2 g2 h2 i2 b9 c9 d9 e9 g9 h9 i9
set coin1 rand 0 1;
set coin2 rand 0 1;
if == coin2 0:
drop Q any b2 e2 i2;
drop A any b2 e2 i2;
drop G any b2 e2 i2;
copy b2 b9;
copy e2 e9;
copy i2 i9;
flip b9 e9 i9;
else:
drop Q any d2 e2 g2;
drop A any d2 e2 g2;
drop G any d2 e2 g2;
copy d2 d9;
copy e2 e9;
copy g2 g9;
flip d9 e9 g9;
endif;
if == coin1 0:
drop N last b2 c2 d2;
drop N first g2 h2 i2;
drop n last b9 c9 d9;
drop n first g9 h9 i9;
drop B last b2 c2 d2;
drop B first g2 h2 i2;
drop b last b9 c9 d9;
drop b first g9 h9 i9;
else:
drop B last b2 c2 d2;
drop B first g2 h2 i2;
drop b last b9 c9 d9;
drop b first g9 h9 i9;
drop N last b2 c2 d2;
drop N first g2 h2 i2;
drop n last b9 c9 d9;
drop n first g9 h9 i9;
endif;
My questions are:
1. How do I know that the preset sets a new random seed, if it does, as I do not seem to find any mention on that in the developer guide besides the constants chapter (by the way the link to fisher random chess from the developer's guide seems to be wrong although I could find the game through game courier->games to play-> the letter F->...)?
2. How would I test that the distribution among the 24 position is constant? The play button (playing with myself) yields the same results always?
Thanks!