Home * Engines * CPW-Engine * Constants

This page contains constants used to handle 0x88 board representation. On the page CPW-Engine_0x88_math You can see how those constants can be used.

/* square numbers according to the 0x88 scheme */
 
#define A1 0
#define B1 1
#define C1 2
#define D1 3
#define E1 4
#define F1 5
#define G1 6
#define H1 7
 
#define A2 16
#define B2 17
#define C2 18
#define D2 19
#define E2 20
#define F2 21
#define G2 22
#define H2 23
 
#define A3 32
#define B3 33
#define C3 34
#define D3 35
#define E3 36
#define F3 37
#define G3 38
#define H3 39
 
#define A4 48
#define B4 49
#define C4 50
#define D4 51
#define E4 52
#define F4 53
#define G4 54
#define H4 55
 
#define A5 64
#define B5 65
#define C5 66
#define D5 67
#define E5 68
#define F5 69
#define G5 70
#define H5 71
 
#define A6 80
#define B6 81
#define C6 82
#define D6 83
#define E6 84
#define F6 85
#define G6 86
#define H6 87
 
#define A7 96
#define B7 97
#define C7 98
#define D7 99
#define E7 100
#define F7 101
#define G7 102
#define H7 103
 
#define A8 112
#define B8 113
#define C8 114
#define D8 115
#define E8 116
#define F8 117
#define G8 118
#define H8 119
 
/* row identifiers */
 
#define ROW_1   ( A1 >> 4 )
#define ROW_2   ( A2 >> 4 )
#define ROW_3   ( A3 >> 4 )
#define ROW_4   ( A4 >> 4 )
#define ROW_5   ( A5 >> 4 )
#define ROW_6   ( A6 >> 4 )
#define ROW_7   ( A7 >> 4 )
#define ROW_8   ( A8 >> 4 )
 
/* column identifiers */
 
#define COL_A  ( A1 & 7 )
#define COL_B  ( B1 & 7 )
#define COL_C  ( C1 & 7 )
#define COL_D  ( D1 & 7 )
#define COL_E  ( E1 & 7 )
#define COL_F  ( F1 & 7 )
#define COL_G  ( G1 & 7 )
#define COL_H  ( H1 & 7 )
 
/* vectors */
 
#define NORTH  16
#define NN    ( NORTH + NORTH )
#define SOUTH  -16
#define SS    ( SOUTH + SOUTH )
#define EAST  1
#define WEST  -1
#define NE    17
#define SW    -17
#define NW    15
#define SE    -15
 

What links here?


Up one Level