is there a 10x8 equivalent of 0x88
Moderators: hgm, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
is there a 10x8 equivalent of 0x88
because of the release of Winboard_F I begin to think about writing a program capable of playing 10x8 chess variants. My current toy uses 0x88 technique for move generation.
I'd like to knowe if there is a 10x8 equivalent of 0x88 technique?
regards,
pawel koziol
I'd like to knowe if there is a 10x8 equivalent of 0x88 technique?
regards,
pawel koziol
-
Aleks Peshkov
- Posts: 845
- Joined: Sun Nov 19, 2006 8:16 pm
- Location: Russia
Re: is there a 10x8 equivalent of 0x88
You may use 14x16(16x16) board with board frame similar to known 12x16(16x16) if you rotate 10x8 to 8x10 coordinates.
- Zach Wegner
- Posts: 1922
- Joined: Wed Mar 08, 2006 11:51 pm
- Location: Earth
- Contact:
Re: is there a 10x8 equivalent of 0x88
Nothing completely equivalent, because the number of files is not a power of 2. The closest I can think of is putting the board sideways, having the bit pattern of a square like this: ffff0rrr. Then you would have to do a test like this: ((sq & 0x08) || (sq & 0xA) == 0xA). I'd recommend just using mailbox with this rotated board and 16 ranks in order to use the unique difference rule.PK wrote:because of the release of Winboard_F I begin to think about writing a program capable of playing 10x8 chess variants. My current toy uses 0x88 technique for move generation.
I'd like to knowe if there is a 10x8 equivalent of 0x88 technique?
regards,
pawel koziol
-
GothicChessInventor
Re: is there a 10x8 equivalent of 0x88
We use the same technique in Crafty just applied to an 80-square board. If you change all of the 256-based references to 1024-based, then adjust all of the index matrices for rotated bitboard lookups, you are halfway there.PK wrote:because of the release of Winboard_F I begin to think about writing a program capable of playing 10x8 chess variants. My current toy uses 0x88 technique for move generation.
I'd like to knowe if there is a 10x8 equivalent of 0x88 technique?
regards,
pawel koziol
- hgm
- Posts: 22274
- Joined: Fri Mar 10, 2006 9:06 am
- Location: Amsterdam
- Full name: H G Muller
- Contact:
Re: is there a 10x8 equivalent of 0x88
Pure 0x88 is needlessly slow anyway. The fastest mailbox technique to represent an NxM board is a (2N+1)x(M+4) board, filling the 'virtual' part of the board with guard pieces that test positive for both colors, and thus block any move that goes over the edge without the need for any dedicated testing for this condition at all.
-
mageofmaple
Re: is there a 10x8 equivalent of 0x88
For an alternate method, you can see an example of bitboard move generation for the 10x8 board in the source code for ChessV (http://www.chessv.com).
The class BitBoard96 supports bitboard functions for any board with 96 squares or less (but for boards with 64 squares or less, you should use the BitBoard64 class instead.)
To see the code for move generation, see the functions GenerateMoves and GenerateCaptures in the CapablancaGame class (in the directory Games/10x8.)
Feel free to ask me if you have any questions about how it works.
Greg
The class BitBoard96 supports bitboard functions for any board with 96 squares or less (but for boards with 64 squares or less, you should use the BitBoard64 class instead.)
To see the code for move generation, see the functions GenerateMoves and GenerateCaptures in the CapablancaGame class (in the directory Games/10x8.)
Feel free to ask me if you have any questions about how it works.
Greg
Re: is there a 10x8 equivalent of 0x88
I was in the process of writing a longer post saying about the same thing, but now I don't think I will bother.
BTW, doesn't (2N - 1)x(M + 4) also work? Or is there some particular reason for using the (2N + 1) dimension instead?
BTW, doesn't (2N - 1)x(M + 4) also work? Or is there some particular reason for using the (2N + 1) dimension instead?
- hgm
- Posts: 22274
- Joined: Fri Mar 10, 2006 9:06 am
- Location: Amsterdam
- Full name: H G Muller
- Contact:
Re: is there a 10x8 equivalent of 0x88
Yes indeed, I am afraid the + was a typo.rjgibert wrote:I was in the process of writing a longer post saying about the same thing, but now I don't think I will bother.
BTW, doesn't (2N - 1)x(M + 4) also work? Or is there some particular reason for using the (2N + 1) dimension instead?
2N-1 is the minimum needed to get unambiguous vectors from the difference between two on-board squares. For an 8x8 board in practice I use 12x16 (compatible with 0x88), i.e. 2N, for the ease of extracting file from the square number (to have easy tests for edge Pawns). The M+4 is determined by the largest stide a piece can have. In FIDE chess that is the Knight, that can do 2 ranks at a time. With Camels or Zebras on the board you would need M+6.
Re: is there a 10x8 equivalent of 0x88
When you do this, you are making a trade off. With 2N - 1 guaranteed to be an odd number, it is then simpler and faster to determine whether a given square is white or black i.e. sq&1 works. Wouldn't this be the more useful of the 2 operations?hgm wrote:For an 8x8 board in practice I use 12x16 (compatible with 0x88), i.e. 2N, for the ease of extracting file from the square number (to have easy tests for edge Pawns).
Re: is there a 10x8 equivalent of 0x88
Thanks all of You!
Unfortunately I don't feel up to writing a bitboard program yet, and what's more I'm handicapped by using Delphi, so C programs are not too helpful for me. That is, I can read (rather stammer) through them, and it's not enough to get the feel of bitboards.
So it's either mailbox or corrupted 0x88 in the form of 0x08 together with 0x0A.
By the way: hgm, I always thought that the whole point of 0x88 is not to read any table to check if we are already outside the board. can You tell me why it's slower? After all in exchange for a couple of xors (for a Rook averaging to 4, for a Bishop to 3 point something) You save one table lookup. But You are probably right, since Joker beats Hopeless.
Unfortunately I don't feel up to writing a bitboard program yet, and what's more I'm handicapped by using Delphi, so C programs are not too helpful for me. That is, I can read (rather stammer) through them, and it's not enough to get the feel of bitboards.
So it's either mailbox or corrupted 0x88 in the form of 0x08 together with 0x0A.
By the way: hgm, I always thought that the whole point of 0x88 is not to read any table to check if we are already outside the board. can You tell me why it's slower? After all in exchange for a couple of xors (for a Rook averaging to 4, for a Bishop to 3 point something) You save one table lookup. But You are probably right, since Joker beats Hopeless.
