Classes | Namespaces | Macros | Typedefs | Functions | Variables
BitBoard.h File Reference

This file contains the declaration of class BitBoard. More...

#include <cstdint>
#include "Index.h"
Include dependency graph for BitBoard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cwchess::BitBoardData
 The POD base type of class BitBoard. More...
 
class  cwchess::BitBoard
 A one-boolean-per-square chessboard. More...
 

Namespaces

 cwchess
 A namespace for all chess related objects that are not related to the GUI.
 

Macros

#define DEBUG_BITBOARD_INITIALIZATION   0
 

Typedefs

typedef uint64_t cwchess::mask_t
 The type of an internal BitBoard mask. More...
 

Functions

mask_t cwchess::index2mask (Index index)
 Convert Index to a mask_t.
 
mask_t cwchess::colrow2mask (int col, int row)
 Convert a col, row pair to a mask_t.
 
Index cwchess::mask2index (mask_t mask)
 Convert a single bit mask into it's Index. More...
 
bool cwchess::operator== (BitBoardData b1, BitBoardData b2)
 
bool cwchess::operator!= (BitBoardData b1, BitBoardData b2)
 
BitBoardData cwchess::operator| (BitBoardData x, BitBoardData y)
 Calculate the union of two bit board constants.
 
BitBoardData cwchess::operator& (BitBoardData x, BitBoardData y)
 Calculate the intersection of two bit board constants.
 
BitBoardData cwchess::operator^ (BitBoardData x, BitBoardData y)
 Calculate the union minus the intersection of two bit board constants.
 
BitBoardData cwchess::operator~ (BitBoardData x)
 Calculate the inverse of the bitboard constant.
 

Variables

BitBoardData const cwchess::a1 = { CW_MASK_T_CONST(0x1) }
 The square a1.
 
BitBoardData const cwchess::b1 = { CW_MASK_T_CONST(0x2) }
 The square b1.
 
BitBoardData const cwchess::c1 = { CW_MASK_T_CONST(0x4) }
 The square c1.
 
BitBoardData const cwchess::d1 = { CW_MASK_T_CONST(0x8) }
 The square d1.
 
BitBoardData const cwchess::e1 = { CW_MASK_T_CONST(0x10) }
 The square e1.
 
BitBoardData const cwchess::f1 = { CW_MASK_T_CONST(0x20) }
 The square f1.
 
BitBoardData const cwchess::g1 = { CW_MASK_T_CONST(0x40) }
 The square g1.
 
BitBoardData const cwchess::h1 = { CW_MASK_T_CONST(0x80) }
 The square h1.
 
BitBoardData const cwchess::a2 = { CW_MASK_T_CONST(0x100) }
 The square a2.
 
BitBoardData const cwchess::b2 = { CW_MASK_T_CONST(0x200) }
 The square b2.
 
BitBoardData const cwchess::c2 = { CW_MASK_T_CONST(0x400) }
 The square c2.
 
BitBoardData const cwchess::d2 = { CW_MASK_T_CONST(0x800) }
 The square d2.
 
BitBoardData const cwchess::e2 = { CW_MASK_T_CONST(0x1000) }
 The square e2.
 
BitBoardData const cwchess::f2 = { CW_MASK_T_CONST(0x2000) }
 The square f2.
 
BitBoardData const cwchess::g2 = { CW_MASK_T_CONST(0x4000) }
 The square g2.
 
BitBoardData const cwchess::h2 = { CW_MASK_T_CONST(0x8000) }
 The square h2.
 
BitBoardData const cwchess::a3 = { CW_MASK_T_CONST(0x10000) }
 The square a3.
 
BitBoardData const cwchess::b3 = { CW_MASK_T_CONST(0x20000) }
 The square b3.
 
BitBoardData const cwchess::c3 = { CW_MASK_T_CONST(0x40000) }
 The square c3.
 
BitBoardData const cwchess::d3 = { CW_MASK_T_CONST(0x80000) }
 The square d3.
 
BitBoardData const cwchess::e3 = { CW_MASK_T_CONST(0x100000) }
 The square e3.
 
BitBoardData const cwchess::f3 = { CW_MASK_T_CONST(0x200000) }
 The square f3.
 
BitBoardData const cwchess::g3 = { CW_MASK_T_CONST(0x400000) }
 The square g3.
 
BitBoardData const cwchess::h3 = { CW_MASK_T_CONST(0x800000) }
 The square h3.
 
BitBoardData const cwchess::a4 = { CW_MASK_T_CONST(0x1000000) }
 The square a4.
 
BitBoardData const cwchess::b4 = { CW_MASK_T_CONST(0x2000000) }
 The square b4.
 
BitBoardData const cwchess::c4 = { CW_MASK_T_CONST(0x4000000) }
 The square c4.
 
BitBoardData const cwchess::d4 = { CW_MASK_T_CONST(0x8000000) }
 The square d4.
 
BitBoardData const cwchess::e4 = { CW_MASK_T_CONST(0x10000000) }
 The square e4.
 
BitBoardData const cwchess::f4 = { CW_MASK_T_CONST(0x20000000) }
 The square f4.
 
BitBoardData const cwchess::g4 = { CW_MASK_T_CONST(0x40000000) }
 The square g4.
 
BitBoardData const cwchess::h4 = { CW_MASK_T_CONST(0x80000000) }
 The square h4.
 
BitBoardData const cwchess::a5 = { CW_MASK_T_CONST(0x100000000) }
 The square a5.
 
BitBoardData const cwchess::b5 = { CW_MASK_T_CONST(0x200000000) }
 The square b5.
 
BitBoardData const cwchess::c5 = { CW_MASK_T_CONST(0x400000000) }
 The square c5.
 
BitBoardData const cwchess::d5 = { CW_MASK_T_CONST(0x800000000) }
 The square d5.
 
BitBoardData const cwchess::e5 = { CW_MASK_T_CONST(0x1000000000) }
 The square e5.
 
BitBoardData const cwchess::f5 = { CW_MASK_T_CONST(0x2000000000) }
 The square f5.
 
BitBoardData const cwchess::g5 = { CW_MASK_T_CONST(0x4000000000) }
 The square g5.
 
BitBoardData const cwchess::h5 = { CW_MASK_T_CONST(0x8000000000) }
 The square h5.
 
BitBoardData const cwchess::a6 = { CW_MASK_T_CONST(0x10000000000) }
 The square a6.
 
BitBoardData const cwchess::b6 = { CW_MASK_T_CONST(0x20000000000) }
 The square b6.
 
BitBoardData const cwchess::c6 = { CW_MASK_T_CONST(0x40000000000) }
 The square c6.
 
BitBoardData const cwchess::d6 = { CW_MASK_T_CONST(0x80000000000) }
 The square d6.
 
BitBoardData const cwchess::e6 = { CW_MASK_T_CONST(0x100000000000) }
 The square e6.
 
BitBoardData const cwchess::f6 = { CW_MASK_T_CONST(0x200000000000) }
 The square f6.
 
BitBoardData const cwchess::g6 = { CW_MASK_T_CONST(0x400000000000) }
 The square g6.
 
BitBoardData const cwchess::h6 = { CW_MASK_T_CONST(0x800000000000) }
 The square h6.
 
BitBoardData const cwchess::a7 = { CW_MASK_T_CONST(0x1000000000000) }
 The square a7.
 
BitBoardData const cwchess::b7 = { CW_MASK_T_CONST(0x2000000000000) }
 The square b7.
 
BitBoardData const cwchess::c7 = { CW_MASK_T_CONST(0x4000000000000) }
 The square c7.
 
BitBoardData const cwchess::d7 = { CW_MASK_T_CONST(0x8000000000000) }
 The square d7.
 
BitBoardData const cwchess::e7 = { CW_MASK_T_CONST(0x10000000000000) }
 The square e7.
 
BitBoardData const cwchess::f7 = { CW_MASK_T_CONST(0x20000000000000) }
 The square f7.
 
BitBoardData const cwchess::g7 = { CW_MASK_T_CONST(0x40000000000000) }
 The square g7.
 
BitBoardData const cwchess::h7 = { CW_MASK_T_CONST(0x80000000000000) }
 The square h7.
 
BitBoardData const cwchess::a8 = { CW_MASK_T_CONST(0x100000000000000) }
 The square a8.
 
BitBoardData const cwchess::b8 = { CW_MASK_T_CONST(0x200000000000000) }
 The square b8.
 
BitBoardData const cwchess::c8 = { CW_MASK_T_CONST(0x400000000000000) }
 The square c8.
 
BitBoardData const cwchess::d8 = { CW_MASK_T_CONST(0x800000000000000) }
 The square d8.
 
BitBoardData const cwchess::e8 = { CW_MASK_T_CONST(0x1000000000000000) }
 The square e8.
 
BitBoardData const cwchess::f8 = { CW_MASK_T_CONST(0x2000000000000000) }
 The square f8.
 
BitBoardData const cwchess::g8 = { CW_MASK_T_CONST(0x4000000000000000) }
 The square g8.
 
BitBoardData const cwchess::h8 = { CW_MASK_T_CONST(0x8000000000000000) }
 The square h8.
 
BitBoardData const cwchess::file_a = a1|a2|a3|a4|a5|a6|a7|a8
 The a-file.
 
BitBoardData const cwchess::file_b = b1|b2|b3|b4|b5|b6|b7|b8
 The b-file.
 
BitBoardData const cwchess::file_c = c1|c2|c3|c4|c5|c6|c7|c8
 The c-file.
 
BitBoardData const cwchess::file_d = d1|d2|d3|d4|d5|d6|d7|d8
 The d-file.
 
BitBoardData const cwchess::file_e = e1|e2|e3|e4|e5|e6|e7|e8
 The e-file.
 
BitBoardData const cwchess::file_f = f1|f2|f3|f4|f5|f6|f7|f8
 The f-file.
 
BitBoardData const cwchess::file_g = g1|g2|g3|g4|g5|g6|g7|g8
 The g-file.
 
BitBoardData const cwchess::file_h = h1|h2|h3|h4|h5|h6|h7|h8
 The h-file.
 
BitBoardData const cwchess::rank_1 = a1|b1|c1|d1|e1|f1|g1|h1
 The first rank.
 
BitBoardData const cwchess::rank_2 = a2|b2|c2|d2|e2|f2|g2|h2
 The second rank.
 
BitBoardData const cwchess::rank_3 = a3|b3|c3|d3|e3|f3|g3|h3
 The third rank.
 
BitBoardData const cwchess::rank_4 = a4|b4|c4|d4|e4|f4|g4|h4
 The fourth rank.
 
BitBoardData const cwchess::rank_5 = a5|b5|c5|d5|e5|f5|g5|h5
 The fifth rank.
 
BitBoardData const cwchess::rank_6 = a6|b6|c6|d6|e6|f6|g6|h6
 The sixth rank.
 
BitBoardData const cwchess::rank_7 = a7|b7|c7|d7|e7|f7|g7|h7
 The seventh rank.
 
BitBoardData const cwchess::rank_8 = a8|b8|c8|d8|e8|f8|g8|h8
 The eighth rank.
 
BitBoardData const cwchess::bdl_1 = h8
 The black diagonal from h8 to h8.
 
BitBoardData const cwchess::bdl_2 = f8|g7|h6
 The black diagonal from f8 to h6.
 
BitBoardData const cwchess::bdl_3 = d8|e7|f6|g5|h4
 The black diagonal from d8 to h4.
 
BitBoardData const cwchess::bdl_4 = b8|c7|d6|e5|f4|g3|h2
 The black diagonal from b8 to h2.
 
BitBoardData const cwchess::bdl_5 = a7|b6|c5|d4|e3|f2|g1
 The black diagonal from a7 to g1.
 
BitBoardData const cwchess::bdl_6 = a5|b4|c3|d2|e1
 The black diagonal from a5 to e1.
 
BitBoardData const cwchess::bdl_7 = a3|b2|c1
 The black diagonal from a3 to c1.
 
BitBoardData const cwchess::bdl_8 = a1
 The black diagonal from a1 to a1.
 
BitBoardData const cwchess::bdr_1 = a7|b8
 The black diagonal from a7 to b8.
 
BitBoardData const cwchess::bdr_2 = a5|b6|c7|d8
 The black diagonal from a5 to d8.
 
BitBoardData const cwchess::bdr_3 = a3|b4|c5|d6|e7|f8
 The black diagonal from a3 to f8.
 
BitBoardData const cwchess::bdr_4 = a1|b2|c3|d4|e5|f6|g7|h8
 The black diagonal from a1 to h8.
 
BitBoardData const cwchess::bdr_5 = c1|d2|e3|f4|g5|h6
 The black diagonal from c1 to h6.
 
BitBoardData const cwchess::bdr_6 = e1|f2|g3|h4
 The black diagonal from e1 to h4.
 
BitBoardData const cwchess::bdr_7 = g1|h2
 The black diagonal from g1 ti h2.
 
BitBoardData const cwchess::wdr_1 = a8
 The white diagonal from a8 to a8.
 
BitBoardData const cwchess::wdr_2 = a6|b7|c8
 The white diagonal from a6 to c8.
 
BitBoardData const cwchess::wdr_3 = a4|b5|c6|d7|e8
 The white diagonal from a4 to e8.
 
BitBoardData const cwchess::wdr_4 = a2|b3|c4|d5|e6|f7|g8
 The white diagonal from a2 to g8.
 
BitBoardData const cwchess::wdr_5 = b1|c2|d3|e4|f5|g6|h7
 The white diagonal from b1 to h7.
 
BitBoardData const cwchess::wdr_6 = d1|e2|f3|g4|h5
 The white diagonal from d1 to h5.
 
BitBoardData const cwchess::wdr_7 = f1|g2|h3
 The white diagonal from f1 to h3.
 
BitBoardData const cwchess::wdr_8 = h1
 The white diagonal from h1 to h1.
 
BitBoardData const cwchess::wdl_1 = g8|h7
 The white diagonal from g8 to h7.
 
BitBoardData const cwchess::wdl_2 = e8|f7|g6|h5
 The white diagonal from e8 to h5.
 
BitBoardData const cwchess::wdl_3 = c8|d7|e6|f5|g4|h3
 The white diagonal from c8 to h3.
 
BitBoardData const cwchess::wdl_4 = a8|b7|c6|d5|e4|f3|g2|h1
 The white diagonal from a8 to h1.
 
BitBoardData const cwchess::wdl_5 = a6|b5|c4|d3|e2|f1
 The white diagonal from a6 to f1.
 
BitBoardData const cwchess::wdl_6 = a4|b3|c2|d1
 The white diagonal from a4 to d1.
 
BitBoardData const cwchess::wdl_7 = a2|b1
 The white diagonal from a2 to b1.
 

Detailed Description

This file contains the declaration of class BitBoard.

Definition in file BitBoard.h.


Copyright © 2006 - 2010 Carlo Wood.  All rights reserved.