old_board.h File Reference

Former board representation. More...

#include "board.h"

Go to the source code of this file.

Classes

class  PieceArray
 Array-like structure to hold pieces. More...
class  OB_Board
 Board representation. More...
class  OB_SimplePlayout
 Simple random playout for old board. More...

Defines

#define OB_EMPTY_SQUARE   0x0U
#define OB_EMPTY   0x0U
#define OB_OFF_BOARD_SQUARE   0x9FU
#define OB_GOLD   0x10U
#define OB_SILVER   0x8U
#define OB_PIECE_OFF_BOARD   0x7U
#define OB_PIECE_ELEPHANT   0x6U
#define OB_PIECE_CAMEL   0x5U
#define OB_PIECE_HORSE   0x4U
#define OB_PIECE_DOG   0x3U
#define OB_PIECE_CAT   0x2U
#define OB_PIECE_RABBIT   0x1U
#define OB_PIECE_EMPTY   0x0U
#define OB_PIECE_MASK   0x7U
#define OB_OWNER_MASK   0x18U
#define OB_NORTH   10
#define OB_SOUTH   -10
#define OB_EAST   1
#define OB_WEST   -1
#define TOP_ROW   8
#define BOTTOM_ROW   1
#define LEFT_COL   1
#define RIGHT_COL   8
#define OB_OWNER(square)   (square & OB_OWNER_MASK)
#define OB_PIECE(square)   (square & OB_PIECE_MASK)
#define OB_OPP(player)   ((16 - player) + 8)
#define PLAYER_TO_INDEX(player)   (player == OB_GOLD ? 0 : 1 )
#define INDEX_TO_PLAYER(index)   (uint) (16-8*index)
#define OB_SQUARE_DISTANCE(s1, s2)   (abs(s1/10 - s2/10) + abs(s1%10 - s2%10))
#define OB_IS_TRAP(index)   (index == 33 || index == 36 || index == 63 || index == 66 )
#define OB_IS_PLAYER(square)   (OB_OWNER(square) == OB_GOLD || OB_OWNER(square) == OB_SILVER )
#define OB_PIECE_NUM   7
#define OB_SQUARE_NUM   100
#define FLAG_BOARD_EMPTY   -1

Typedefs

typedef uint ob_player_t
typedef int ob_square_t
typedef uint ob_piece_t
typedef int FlagBoard [OB_SQUARE_NUM]
typedef uint board_t [OB_SQUARE_NUM]
typedef pair< ob_player_t,
ob_piece_t > 
PiecePair

Variables

const int direction [4]
const int rabbitForward [2]
const int rabbitWinRow [2]
const int trap [4]


Detailed Description

Former board representation.

Board representation using the integer board mechanism. This module is obsolete but still used in test suite to verify functionality of current board module.


Generated on Thu Aug 6 23:29:07 2009 for akimot by  doxygen 1.5.7.1