Check out Atomic Chess, our featured variant for November, 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

Earlier Reverse Order LaterLatest
Capablanca Random Chess. Randomized setup for Capablanca chess. (10x8, Cells: 80) [All Comments] [Add Comment or Rating]
Greg Strong wrote on Thu, Feb 24, 2005 04:49 PM UTC:Excellent ★★★★★

Very nice! The author has done an excellent job of defining a Fischer randomization system for Capablanca's Chess (actually this piece mix goes back to the 1600s with D. Pietro Carrera -- see Carrera's Chess.) It is obvious to me that the design has been carefully considered from both a game-designer's perspective and a software developer's perspective.

I'm not sure I like the idea of renaming the pieces, though. There are already too many different names for these pieces, and I think the goal should be to standardize the names, and I believe Capablanca's names of Archbishop and Chancellor are probably the best choices.


David Paulowich wrote on Thu, Feb 24, 2005 06:34 PM UTC:
'The champion has the combined moves of rook and knight. The centaur has the combined moves of bishop and knight.' - D. Pietro Carrera, 1617 <p>So the earliest variant gives the name Centaur to the other piece! Also, many people here follow Adrian King in calling the man-horse piece (K+N) a Centaur.

Robert Fischer wrote on Thu, Feb 24, 2005 06:37 PM UTC:Excellent ★★★★★
Nice to see you moving forward with your dream.
Best regards!

💡📝Reinhard Scharnagl wrote on Fri, Feb 25, 2005 02:50 AM UTC:
To Greg Strong: of course you are right with your historical hints. There
might be some remarks to be added in the CRC description. The CRC text
should be extended, if there would be enough interested readers.

To Greg Strong and David Paulowich: indeed there are more traditional
names for C (Chancellor) and A (Archbishop). But those names do not
correspond to the pieces: nor to their gaits nor to their symbols. I have
tried to design more intuitive gait related symbols and noticed, that the
names would not be helpful for newcomers to the Capablanca extended piece
set. So I proposed names (partially already used differently in other
context) to enhance the readability of CRC board positions to interested
people. But that approach is only a suggestion, carefully keeping the same
initial letters e.g. to stay compatible within X-FEN.

To all posters here at CRC until now: thank you for your interest and
encouraging words!

Charles Gilman wrote on Sat, Feb 26, 2005 07:48 AM UTC:Good ★★★★
Good to see someone taking up the suggestion inspired by Grotesque Chess. I'm not keen on the names here either, my favourites being Marshal and Cardinal, but I'm getting used to such 'agreements to differ'.

David Paulowich wrote on Sat, Feb 26, 2005 01:23 PM UTC:
Sometimes I wish Christian Freeling had used 'Marshalls' and 'Capablancas' in Grand Chess. Naming the pieces after two grandmasters would save us from endlessly debating the spelling of Marshal(l).

Larry Smith wrote on Sat, Feb 26, 2005 05:00 PM UTC:
Just a small aesthetic observation about the graphic for the Archangel. 
Swords being short-range weapons, angels are also known to carry spears
which have longer range.

To carry over the motif from the Centaur, it could be a horseshoe with two
crossed spears.

Or the angelic theme might be further emphasized with a pair of wings and
two crossed spears.

💡📝Reinhard Scharnagl wrote on Sat, Feb 26, 2005 06:22 PM UTC:
To Larry Smith: I have asked some interested people to send me some icon proposals. They should be not too complicated, differ sufficiently from existing and be related to the pieces' gaits. But I have not got some really convincing. Nevertheless if one has an exiting idea ...

Larry Smith wrote on Sun, Feb 27, 2005 01:09 AM UTC:
Reinhard, I've worked up an example with two crossed spears and a pair of
wings flanking a halo.  You should be able to view it below:

http://users3.ev1.net/~llsmith/home/angel_w.gif

🕸Fergus Duniho wrote on Sun, Feb 27, 2005 08:12 PM UTC:
I'm working on a Game Courier preset for this game, but I've hit a snag. So far, I have code that creates a random position, and I have code for checking whether all Pawns are protected, and I can also check the Levenshtein distance between a given setup and Gothic Chess. The problem is that PHP, which Game Courier is written in, gives it only 30 seconds to find a valid setup, and in each test, it has run out of time before finding one. So what I need is some shortcut for either selecting valid setups or screening out invalid ones. What might be ideal is to have a database of valid setups, each keyed to a single number, and then Game Courier could just pick a single random number, fetch the corresponding setup, and skip the tedious iterative process of randomly placing pieces until a valid setup is found. Another possibility would be to filter out a number of bad setups with wildcard filters, which would be faster than checking whether each Pawn is defended, but it would require appropriate filters. Does anyone have anything I could use without having to do all the preparation work myself?

Greg Strong wrote on Sun, Feb 27, 2005 08:23 PM UTC:
Fischer Random Chess has the 960 legal starting positions numbered, and has
the details on how to find a position from it's number, and how to find
the number based on the position.  Capablanca Random Chess could benefit
from such a system.  Besides making it easier to identify starting
positions, it would also solve Fergus' present dilema.  If a position can
be determined from a position number, all that would be required is
generation a random number in the valid range.

For a good description of how FRC identifies positions by number, see:
http://frcec.tripod.com/fischerrandomchessstartingpositions/

Larry Smith wrote on Sun, Feb 27, 2005 08:37 PM UTC:
Why does each Pawn need to be defended at the initial set-up?

This seems to be an arbitrary rule.  There are many good Chess games where
each and every Pawn is not defended at the start.

In fact, these un-defended Pawns can create a nice area of early
contention in play.

Is there an actual 'flawed' setup, resulting in the loss of the game for
one or the other player?

💡📝Reinhard Scharnagl wrote on Sun, Feb 27, 2005 10:50 PM UTC:
To Larry L. Smith: Well I know, that e.g. Shogi starts with three undefended pawns. Nevertheless the game has survived for long. But proposing new chess variants is mostly running against immense critic. So there are voices, which claims that most of the randomized positions were unplayable. I do not believe that at all, but I think it could help, to select just those positions, which are positionally more balanced. That lead to write down the additional rule of initially placing the Archbishop and Queen on different colored squares and to select only positions with all pawns defended. Of course this will reduce the genuine 48,000 possibilities to some more than 20,000. But this is still enough to avoid any creation of big opening libraries. So applying the rule might be skipped, but using it would help to make the variant more attractive to critic chess enthusiasts. Thus it has become part of my proposal.

💡📝Reinhard Scharnagl wrote on Sun, Feb 27, 2005 11:07 PM UTC:
To Greg Strong and Fergus Duniho: I have not awaited, that CRC would cause that quick your experiments to create those starting positions. Because of that I have not yet published a procedure, which would show how Smirf managed that problem and how to standardize the number to position relation. It obviously is not well known, that it has been me, who invented and introduced the numbering schema for Chess960. Beside of that numeric relation I have worked out a two table look up scheme which is fitting on to one single page to be used in chess clubs to have all Chess960 starting positions immediately at hands. For CRC a solution is of course not that easy. But if you are interested in that, I could post code snippets, where those positions are created from a given number. When Smirf is starting, it quickly creates an array of valid position numbers by probing all 48,000 and filtering the valid into an array of some more than 20,000 entries, what overmore allows to index those array with a short int, which is good for some pseudo random number generators, selecting later a randomized valid starting position. Another solution could be to use 6000 char constants, where the mass of 48,000 bits could be used to encode the precalculated validity of the appropriate number.

💡📝Reinhard Scharnagl wrote on Sun, Feb 27, 2005 11:57 PM UTC:
//=====================================
// CRC / Chess960 Position Generator
//=====================================
// reference implementation (C) 2005 by
// Reinhard Scharnagl, Munich, Germany
//=====================================

#include < string.h>
#include < stdio.h>

#define TXT_LIM 160

static char FenZone[TXT_LIM];

// insert a symbol into FEN-String 
// -------------------------------
// color could be:
// col <  0 => not specified
// col == 0 => bright square
// col == 1 => dark square
void PlaceIntoFEN
  (int cntFree, char symbol, int fieldColor)
{
  for (int pos = 0, free = 0; ; ++pos) {
    if (fieldColor < 0 || ((fieldColor ^ pos) & 1)) {
      if (!FenZone[pos] && cntFree == free++) {
        FenZone[pos] = symbol;
        break;
      }
    }
  }
}

// generating of FEN strings
// -------------------------
// nr could be
// nr >= 0 creating Chess960 position (1 ... 960)
// nr <  0 creating CRC position    (1 ... 48000)
const char *GetFen(int nr)
{
  // knight distributions over 5 free squares
  static const int knight_pos[10] = {
     3, // xx--- (binary encoded)
     5, // x-x--
     9, // x--x-
    17, // x---x
     6, // -xx--
    10, // -x-x-
    18, // -x--x
    12, // --xx-
    20, // --x-x
    24  // ---xx
  };

  // clear the working area
  int bit, pos = TXT_LIM;
  while (--pos >= 0) { FenZone[pos] = '\0'; }

  // test whether CRC is requested
  bool istCRC = (nr <= 0);

  if (istCRC) {
    nr = -nr;
    bool q_first = ((nr % 2) != 0);
    nr /= 2;
    PlaceIntoFEN(nr % 5, q_first ? 'q' : 'a', 0);
    nr /= 5;
    PlaceIntoFEN(nr % 5, q_first ? 'a' : 'q', 1);
    nr /= 5;
  }

  PlaceIntoFEN(nr % 4, 'b', 0);
  nr /= 4;
  PlaceIntoFEN(nr % 4, 'b', 1);
  nr /= 4;
  PlaceIntoFEN(nr % 6, istCRC ? 'c' : 'q', -1);
  nr /= 6;
  pos = knight_pos[nr % 10];
  for (bit = 5; --bit >= 0; ) {
    if ((pos & (1 << bit)) != 0)
      PlaceIntoFEN(bit, 'n', -1);
  }

  PlaceIntoFEN(2, 'r', -1);
  PlaceIntoFEN(1, 'k', -1);
  PlaceIntoFEN(0, 'r', -1);

  int width = istCRC ? 10 : 8;
  char *pC = &FenZone[width];
  *pC++ = '/';
  for (pos = width; --pos >= 0; ) {
    *pC++ = 'p';
  }
  for (pos = 4; --pos >= 0; ) {
    *pC++ = '/';
    *pC++ = (char)('0' + width % 10);
  }
  *pC++ = '/';
  for (pos = width; --pos >= 0; ) {
    *pC++ = 'P'; 
  }
  *pC++ = '/';
  for (pos = 0; pos < width; ++pos) {
    *pC++ = FenZone[pos] ^ ('a'^'A');
  }
  strcpy(pC, ' w KQkq - 0 1');

  return FenZone;
}

// test output
int main(void) {
  puts('first Chess960 positions');
  for (int nrFRC = 0; ++nrFRC <= 5; ) {
    puts(GetFen(nrFRC));
  }

  puts('first CRC positions');
  for (int nrCRC = 0; ++nrCRC <= 5; ) {
    puts(GetFen(-nrCRC));
  }

  return 0;
}

🕸Fergus Duniho wrote on Mon, Feb 28, 2005 01:18 AM UTC:
Reinhard, if you could provide me with a list of all valid CRC positions, I could store it as an array and use it for randomly selecting a position. You can email it to me at the address found by clicking on my name.

🕸Fergus Duniho wrote on Mon, Feb 28, 2005 01:36 AM UTC:
It looks like I won't need a list. It was timing out on me before because a bug was causing an infinite loop. It was checking for 'not ATTACKEDBYW' instead of 'not fn ATTACKEDBYW', which means it was applying 'not' to the function name instead of to the function itself. This gave the same result every time, leading to an infinite loop. As soon as I fixed the bug, it worked, and it gave me a position with all Pawns defended. But I think I will still optimize this by created a special DEFENDED function that more quickly checks whether a Pawn has a defender. As for comparing the setup to the Gothic Chess setup, I was thinking of calculating the Levenshtein Distance (which is the minimal number of characters you have to replace, insert or delete to transform one string into another) and rejecting any with a distance of 3 or closer. This would be making use of PHP's levenshtein function, which I have passed along to GAME Code. Or should I simply count the number of positions that are the same?

Mark Thompson wrote on Mon, Feb 28, 2005 02:11 AM UTC:
Just curious, why 3 or fewer? Rather than zero?

💡📝Reinhard Scharnagl wrote on Mon, Feb 28, 2005 08:38 AM UTC:
To Mark Thompson: three always is a good number. We have so much possible
positions in CRC, so it does not hurt to skip some to avoid any conflicts
with Gothic Chess. Live and let live.

To Fergus Duniho: it seems as if you would use a very complex method to
detect invalid starting positions. I will add a more simple method in
short to the reference code I have posted here yesterday. Thus one will be
able to see, that generating valid CRC positions only is neither a run time
problem nor too complex to be programmed.

💡📝Reinhard Scharnagl wrote on Mon, Feb 28, 2005 09:18 AM UTC:
//========================================
// Valid CRC / Chess960 Position generator
//========================================
// Reference Implementation, (C) 2005 by
// Reinhard Scharnagl, Munich, Germany
//----------------------------------------
// Correction 2005-Feb-28 (GC-Nearness)
//========================================

#include < string.h>
#include < stdio.h>

#define TXT_LIM 160

static char FenZone[TXT_LIM];

// insert a symbol into FEN-String 
// -------------------------------
// color could be:
// col <  0 => not specified
// col == 0 => bright square
// col == 1 => dark square
void PlaceIntoFEN
  (int cntFree, char symbol, int fieldColor)
{
  for (int pos = 0, free = 0; ; ++pos) {
    if (fieldColor < 0 || ((fieldColor ^ pos) & 1)) {
      if (!FenZone[pos] && cntFree == free++) {
        FenZone[pos] = symbol;
        break;
      }
    }
  }
}

// generating of FEN strings
// -------------------------
// nr could be
// nr >= 0 creating Chess960 position (1 ... 960)
// nr <  0 creating CRC position    (1 ... 48000)
const char *GetFen(int nr)
{
  // knight distributions over 5 free squares
  static const int knight_pos[10] = {
     3, // xx--- (binary encoded)
     5, // x-x--
     9, // x--x-
    17, // x---x
     6, // -xx--
    10, // -x-x-
    18, // -x--x
    12, // --xx-
    20, // --x-x
    24  // ---xx
  };

  // clear the working area
  int bit, pos = TXT_LIM;
  while (--pos >= 0) { FenZone[pos] = '\0'; }

  // test whether CRC is requested
  bool isCRC = (nr <= 0);

  if (isCRC) {
    nr = -nr;
    bool q_first = ((nr % 2) != 0);
    nr /= 2;
    PlaceIntoFEN(nr % 5, q_first ? 'q' : 'a', 0);
    nr /= 5;
    PlaceIntoFEN(nr % 5, q_first ? 'a' : 'q', 1);
    nr /= 5;
  }

  PlaceIntoFEN(nr % 4, 'b', 0);
  nr /= 4;
  PlaceIntoFEN(nr % 4, 'b', 1);
  nr /= 4;
  PlaceIntoFEN(nr % 6, isCRC ? 'c' : 'q', -1);
  nr /= 6;
  pos = knight_pos[nr % 10];
  for (bit = 5; --bit >= 0; ) {
    if ((pos & (1 << bit)) != 0)
      PlaceIntoFEN(bit, 'n', -1);
  }

  PlaceIntoFEN(2, 'r', -1);
  PlaceIntoFEN(1, 'k', -1);
  PlaceIntoFEN(0, 'r', -1);

  int width = isCRC ? 10 : 8;
  char *pC = &FenZone[width];
  *pC++ = '/';
  for (pos = width; --pos >= 0; ) {
    *pC++ = 'p';
  }
  for (pos = 4; --pos >= 0; ) {
    *pC++ = '/';
    if (width >= 10) {
      *pC++ = '1';
    }
    *pC++ = (char)('0' + width % 10);
  }
  *pC++ = '/';
  for (pos = width; --pos >= 0; ) {
    *pC++ = 'P'; 
  }
  *pC++ = '/';
  for (pos = 0; pos < width; ++pos) {
    *pC++ = FenZone[pos] ^ ('a'^'A');
  }
  strcpy(pC, ' w KQkq - 0 1');

  return FenZone;
}

// check if FEN is valid for CRC
// -----------------------------
bool IsValidCRC(const char *pFen) 
{
  // to be avoided GC position
  static const char *gcArray = 'rnbqckabnr';
  // pawn covering pieces (like a rook)
  static const char *covNear = 'rcqk';
  // pawn covering pieces (like a bishop)
  static const char *covDiag = 'baqk';
  // pawn covering pieces (like a knight)
  static const char *covDist = 'nac';

  int size = (int)(strchr(pFen, '/') - pFen);
  int diff = 0;
  for (int n = size; --n >= 0; ) {
    // different to GC?
    if (pFen[n] != gcArray[n]) {
      ++diff;
    }
    // unprotected pawns?
    if (strchr(covNear, pFen[n]))
      continue;
    if ((n+1) < size && strchr(covDiag, pFen[n+1]))
      continue;
    if ((n-1) >=   0 && strchr(covDiag, pFen[n-1]))
      continue;
    if ((n+2) < size && strchr(covDist, pFen[n+2]))
      continue;
    if ((n-2) >=   0 && strchr(covDist, pFen[n-2]))
      continue;
    return false;
  }
  // GC-near position?
  if (diff < 3 && size == (int)strlen(gcArray)) {
    return false;
  }

  return true;
}

// test output
// -----------
int main(void)
{
  puts('\nfirst Chess960 positions');
  for (int nrFRC = 0; ++nrFRC <= 10; ) {
    printf('(%03d) %s\n',
      nrFRC, GetFen(nrFRC));
  }

  puts('\nfirst CRC positions');
  int cntValid = 0;
  for (int nrCRC = 0; ++nrCRC <= 48000; ) {
    const char *pFEN = GetFen(-nrCRC);
    bool valid = IsValidCRC(pFEN); 
    if (nrCRC <= 32) {
      printf('(%05d %s) %s\n',
        nrCRC, valid ? 'ok' : '--', pFEN);
    }
    if (valid) {
      ++cntValid;
    }
  }

  printf('\n%d valid CRC arrays\n', cntValid);

  return 0;
}

💡📝Reinhard Scharnagl wrote on Mon, Feb 28, 2005 01:47 PM UTC:
<pcode> Results of the CRC reference code:<br> <br> first Chess960 positions<br> (001) bqnbnrkr/pppppppp/8/8/8/8/PPPPPPPP/BQNBNRKR w KQkq - 0 1<br> (002) bqnnrbkr/pppppppp/8/8/8/8/PPPPPPPP/BQNNRBKR w KQkq - 0 1<br> (003) bqnnrkrb/pppppppp/8/8/8/8/PPPPPPPP/BQNNRKRB w KQkq - 0 1<br> (004) qbbnnrkr/pppppppp/8/8/8/8/PPPPPPPP/QBBNNRKR w KQkq - 0 1<br> (005) qnbbnrkr/pppppppp/8/8/8/8/PPPPPPPP/QNBBNRKR w KQkq - 0 1<br> (006) qnbnrbkr/pppppppp/8/8/8/8/PPPPPPPP/QNBNRBKR w KQkq - 0 1<br> (007) qnbnrkrb/pppppppp/8/8/8/8/PPPPPPPP/QNBNRKRB w KQkq - 0 1<br> (008) qbnnbrkr/pppppppp/8/8/8/8/PPPPPPPP/QBNNBRKR w KQkq - 0 1<br> (009) qnnbbrkr/pppppppp/8/8/8/8/PPPPPPPP/QNNBBRKR w KQkq - 0 1<br> (010) qnnrbbkr/pppppppp/8/8/8/8/PPPPPPPP/QNNRBBKR w KQkq - 0 1<br> <br> first CRC positions<br> (00001 --) aqbbcnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/AQBBCNNRKR w KQkq - 0 1<br> (00002 ok) qbbacnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/QBBACNNRKR w KQkq - 0 1<br> (00003 --) abbqcnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/ABBQCNNRKR w KQkq - 0 1<br> (00004 ok) qbbcnanrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/QBBCNANRKR w KQkq - 0 1<br> (00005 ok) abbcnqnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/ABBCNQNRKR w KQkq - 0 1<br> (00006 --) qbbcnnrakr/pppppppppp/10/10/10/10/PPPPPPPPPP/QBBCNNRAKR w KQkq - 0 1<br> (00007 --) abbcnnrqkr/pppppppppp/10/10/10/10/PPPPPPPPPP/ABBCNNRQKR w KQkq - 0 1<br> (00008 --) qbbcnnrkra/pppppppppp/10/10/10/10/PPPPPPPPPP/QBBCNNRKRA w KQkq - 0 1<br> (00009 --) abbcnnrkrq/pppppppppp/10/10/10/10/PPPPPPPPPP/ABBCNNRKRQ w KQkq - 0 1<br> (00010 --) baqbcnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BAQBCNNRKR w KQkq - 0 1<br> (00011 --) bqabcnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BQABCNNRKR w KQkq - 0 1<br> (00012 ok) bbqacnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBQACNNRKR w KQkq - 0 1<br> (00013 --) bbaqcnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBAQCNNRKR w KQkq - 0 1<br> (00014 ok) bbqcnanrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBQCNANRKR w KQkq - 0 1<br> (00015 ok) bbacnqnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBACNQNRKR w KQkq - 0 1<br> (00016 --) bbqcnnrakr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBQCNNRAKR w KQkq - 0 1<br> (00017 ok) bbacnnrqkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBACNNRQKR w KQkq - 0 1<br> (00018 --) bbqcnnrkra/pppppppppp/10/10/10/10/PPPPPPPPPP/BBQCNNRKRA w KQkq - 0 1<br> (00019 ok) bbacnnrkrq/pppppppppp/10/10/10/10/PPPPPPPPPP/BBACNNRKRQ w KQkq - 0 1<br> (00020 --) bacbqnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BACBQNNRKR w KQkq - 0 1<br> (00021 ok) bqcbannrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BQCBANNRKR w KQkq - 0 1<br> (00022 --) bbcaqnnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCAQNNRKR w KQkq - 0 1<br> (00023 ok) bbcqannrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCQANNRKR w KQkq - 0 1<br> (00024 ok) bbcnqanrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNQANRKR w KQkq - 0 1<br> (00025 ok) bbcnaqnrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNAQNRKR w KQkq - 0 1<br> (00026 ok) bbcnqnrakr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNQNRAKR w KQkq - 0 1<br> (00027 ok) bbcnanrqkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNANRQKR w KQkq - 0 1<br> (00028 --) bbcnqnrkra/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNQNRKRA w KQkq - 0 1<br> (00029 ok) bbcnanrkrq/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCNANRKRQ w KQkq - 0 1<br> (00030 ok) bacbnnqrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BACBNNQRKR w KQkq - 0 1<br> (00031 ok) bqcbnnarkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BQCBNNARKR w KQkq - 0 1<br> (00032 ok) bbcannqrkr/pppppppppp/10/10/10/10/PPPPPPPPPP/BBCANNQRKR w KQkq - 0 1<br> <br> 21821 valid CRC arrays<br> </pcode>

🕸Fergus Duniho wrote on Mon, Feb 28, 2005 03:55 PM UTC:
<P>Reinhard Scharnagl wrote:</P> <BLOCKQUOTE> it seems as if you would use a very complex method to detect invalid starting positions. I will add a more simple method in short to the reference code I have posted here yesterday. Thus one will be able to see, that generating valid CRC positions only is neither a run time problem nor too complex to be programmed. </BLOCKQUOTE> <P>No, my method is not so complex, and once I fixed the infinite loop bug, there were no run time problems. I have since modified it to your exact specifications, but here is how the method you're commenting on worked.</P> <OL> <LI> Clear the first rank.</LI> <LI> Select a random setup per your instructions.</LI> <LI> Check whether each Pawn is defended, and if any is undefended, start over.</LI> <LI> Generate a string of the setup and calculate its Levenshtein Distance from the setup for Gothic Chess. If the Levenshtein Distance is too small, start over. </OL> <P>The Levenshtein Distance is the minimal number of operations it takes to change one string into another, counting insertions, deletions, and substitutions as operations. Your instructions use the Hamming Distance, which is the number of substitutions it takes to change one string into another string of the same length. Although calculation of the Levenshtein Distance is more complicated than calculation of the Hamming Distance, I don't have to worry about that, because it is handled by a PHP function. Since almost all setups will pass, using the Levenshtein Distance doesn't cause any appreciable increase in time.</P> <P>Using the Hamming Distance, as your instructions use, has the advantage of being easier for humans to calculate, but as long as computers do the calculations, the more sophisticated Levenshtein Distance might be preferable. Whenever they are unequal, the Levenshtein Distance will be smaller than the Hamming Distance. This would be useful if you want to avoid setups that differ from Gothic Chess not only by a couple substitutions but also by moving one piece in a way that shifts much of the lineup one space left or right but keeps most of the order intact. For example, 'BRNBQCKANR' has all Pawns defended, and its Hamming Distance from Gothic Chess is 8, but its Levenshtein Distance is 2, because I got it by simply deleting a Bishop and inserting it on the left side.</P> <P>Your reference code has answered one question I had. I wasn't sure whether you meant to exclude setups whose Hamming Distance from Gothic Chess was less than three or less than or equal to three. From your code, it looks like less than three. So you're excluding any setup with a Hamming Distance of two or less. Given the same pieces, you will never have a Hamming Distance of only 1. So what you are excluding is limited to only setups that differ by switching the places of two pieces.</P> <P>The preset I made currently uses the Hamming Distance and follows your instructions to the letter for generating a random position and excluding invalid setups. If you ever decide that you would rather use the Levenshtein Distance, all I will have to do is replace the hamming operator with the levenshtein operator in my code.</P>

💡📝Reinhard Scharnagl wrote on Mon, Feb 28, 2005 04:24 PM UTC:
To Fergus Duniho: you are obviously unsure on the grade of distinctness
between valid CRC arrays and the GC starting position. So let us do a
historic approach and try to calculate the distance between GC and
historic 10x8 starting arrays as from Carrera, Bird or Capablanca. I think
that there are more than three reported arrays from those people. 

When it has been possible to patent GC being only slightly different to
those positions, it should be sufficient to demand only the smallest 
there occurring distance. Comparing the GC array 'RNBQCKABNR' to one
reported as from Bird 'RNBCQKABNR' there is a Hamming distance of only
two. But I am not sure, if this Bird's array has been specified that way
- I am missing still the original source. If the smallest distance indeed
should be greater than three, the code I have supplied has to be changed
appropriately.

May be variant experts could help to solve that question doubtlessly.

🕸Fergus Duniho wrote on Mon, Feb 28, 2005 04:42 PM UTC:
<BLOCKQUOTE> you are obviously unsure on the grade of distinctness between valid CRC arrays and the GC starting position. </BLOCKQUOTE> <BLOCKQUOTE> Comparing the GC array 'RNBQCKABNR' to one reported as from Bird 'RNBCQKABNR' there is a Hamming distance of only two. </BLOCKQUOTE> <P>That is correct. In this instance, the Levenshtein Distance is also 2.</P> <P>Based on this, I see three options for you.</P> <OL> <LI> Exclude just the Gothic Chess setup.</LI> <LI> Exclude any setup whose Hamming Distance from Gothic Chess is 2 or less.</LI> <LI> Exclude any setup whose Levenshtein Distance from Gothic Chess is 2 or less.</LI> </OL> <P>Each subsequent option excludes more setups than the previous one. Your CRC proposal currently uses the second of these options.</P>

💡📝Reinhard Scharnagl wrote on Mon, Feb 28, 2005 05:39 PM UTC:
To Fergus Duniho: Well, if that is indeed the historic array of Bird, then
a Hamming distance of at least three (as I have specified) would be more
than sufficient. So I would not change that demanded difference of three.


I would like to keep the Hamming distance, because shifting a group of
pieces has an immense effect on the properties of a starting array. And I
think that the so created valid CRC arrays obviously are distinct from
GC.

25 comments displayed

Earlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.