Author: Dezhi Zhao
Date: 09:01:58 08/29/98
Go up one level in this thread
On August 28, 1998 at 16:50:31, David Eppstein wrote: >On August 28, 1998 at 13:38:03, Dezhi Zhao wrote: >>Neither 9x9 nor 9x10 is of power of 2. So a mask must be used to mask off >>the unused bits after each shift operation or before any logical tests. >>In any case you cannot get the same efficiency as chess programmers. > >I think this power of two thing is a red herring. Even for an 8x8 board you have >to mask so your pieces don't think they can wrap around from one side of the >board to the other. > >My program is for a game with a 5x9 board and bitboards work just fine for it. >(In fact, because 5x9 is not a power of two, I get some extra slack: I >use a 6x10 subarray of bits to represent the board, where one row and column are >always empty, allowing me to not have to mask so much, and I still have six bits >extra to use as flags.) > >I get the impression (not having played it) that Shogi suffers from the same >problem as chess wrt bitboards though: lots of different kinds of pieces and >special rules such as castling and en-passant. Bitboards really shine in games >where all or most pieces are the same and the rules are more uniform (e.g. >checkers). But I think that power of two is more than a red herring. 8x8 board has another important property, i.e. symmetry. Both columns and rows are power of two. 0x88 method as described in your web page comes to my mind, as an example that power of two and symmetry may be further exploited in bitboards. I understand that in chess you have to use boundary mask to prevent wrap-around. This also prompts that *sometimes* I can combine the boundary mask and the unused-bit mask into one mask, but not all of time. The smallest Shogi or Xiangqi bitboard is at least 3 * 32-bit words. You have to write your own &, |, <<, >> and == operators that will somewhat slow you down. And Find First One will slow down further. Dezhi Zhao Best Regards
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.