Re: Chess boards & connections.



In article <1145555339.841442.203250@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, dynamics writes:
Trying to calculate if I can write a Chess AI.

I need to define all possible boards.

I have a total of 64 different pieces, 16 for Black
and 16 for White to start, and since each pawn
can be promoted, to either a Queen or Knight, a

They can't be promoted to a bishop or a rook?

further 16 for B&W's 8 pawns for another 32.

There are 65 locations on the board, 8*8 + 1 for
non-existance called the side bar.

So I dimension an Array, (64,65) where the 64
provides the *serial number* for all possible
pieces and each of those can be in 65 locations,
providing 64*65=4160 boards.

Nope.

Place the first of the 64 pieces. How many choices for a square do
you have? 65. Now, for each of those possibilities, you have 64 choices
for placing the second piece. So, two pieces already uses up your 4160
boards. If you place a third piece, you'll have 63 available squares
for each of those 4160 possibilities, or 65*64*63 = 262080. To place
64 pieces on 65 squares -- even with disallowing two pieces on the same
square from the start -- you're going to have 65! possible boards.

I'd say that, since each player can only have 16 pieces at any time,
you number the pieces 1-16 (or 0-15 if you prefer), and keep track of
what type of piece (Q, K, Kt, p, etc.) each one is. This way, you only
have 32 pieces to deal with. Then, you probably should get rid of your
"sidebar" and just not necessarily have all of the pieces included in
the board at any time.

This strategy will reduce the number of configurations to (64!)/(32!)
time some multiplier based upon how many duplicate pieces a player
has.

(I'll skip using exclusion right now, like two pieces
can't occupy the same square, but all that means
is there are < 4160 possible boards).

Nope. Like I pointed out above, even if you build in "exclusion" from
the start, you'll need to add a lot of zeros to the right of "4160"

--
Michael F. Stemper
#include <Standard_Disclaimer>
Indians scattered on dawn's highway bleeding;
Ghosts crowd the young child's fragile eggshell mind.

.



Relevant Pages

  • Re: Stepping By Divisors -- Grid Game
    ... Choose a player to go first. ... player places a 1 in any square of the grid, ... as to the game itself: I think you need to ensure an equal number ... announcing any positive integer divisor of that number ...
    (rec.games.abstract)
  • Re: Doppel-game
    ... This game seems to be familiar. ... fill in any one randomly chosen square of the ... a player fills in a square that is ... let the direction from {the previously filled-in ...
    (sci.math)
  • Enumeration:A Game Of Coprimality On A Grid
    ... In the top row of the grid and in the grid's left-most ... Only one integer is in each square, and a player can only ... that are coprime to the number of the ROW of the ...
    (sci.math)
  • Enumeration:A Game Of Coprimality On A Grid
    ... In the top row of the grid and in the grid's left-most ... Only one integer is in each square, and a player can only ... that are coprime to the number of the ROW of the ...
    (rec.puzzles)
  • Re: Perception and AI (and log messages)
    ... player to interpret and exploit. ... is the position of the monster and position of the player. ... Create FOV object based on dungeon, monster position, view radius ... If interesting object on square ...
    (rec.games.roguelike.development)