Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.

Enter Your Reply

The Comment You're Replying To
Aurelian Florea wrote on Tue, Oct 16, 2018 08:33 AM UTC:

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!


Edit Form
Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.