alg1_search.c File Reference

#include "belofte.h"
#include "alg1_search.h"
#include "alg1_moves.h"
#include "alg1_eval.h"
#include "alg1_book.h"
#include "alg1_board.h"

Defines

#define pieceopenline(x, y, z, a)   if(pieceseesopen((x),(y),(z),(a))) { isAttack++; }
#define pieceseesdirm(x, y, z, a, b, c)   if(pieceseesmore((x),(y),(z),(a),(b),(c))) { isAttack++; }
#define pieceseesone(x, y, z)   if(m1_board.m_fields[(z)]==((y)?TO_BLACK(x):TO_WHITE(x))) { isAttack++; }
 test if after executing the move, the king is in check the king to test will be of the same colour as the colour moving the piece we will first apply the move, then see if the king jumps to any of the opposing colours

Functions

int fill_movelist (const enum tColour nColour, const t_boolean bQuieuscience, const enum tFillMoves bFill)
 fill all possible moves in the movelist
t_boolean isInCheck (const t_boolean bEvaluateForWhite)
 is the position in check
unsigned int isUnderAttack (const posid iPiecePos, const t_boolean bEvaluateForWhite)
unsigned int isUnderMinorAttack (const posid iPiecePos, const t_piece cPiece, const t_boolean bEvaluateForWhite)
 see if the piece gets attached by a minor piece, needed for evaluation
void normalize_movelist (void)
 normalize the movelist to a 8x8 board
int search_apply_move (const char *szMove)
void search_constructor (void)
 function called once for engine construction
void search_init (void)
 function called once for new game, here the board position is copied from the board into the engine calling this function will cause ep, rock and repetition and 50 moves flags to be reset
void search_printablemove (const int iSelectedMove, char *szMove)
int search_root (t_depth iDepth, char *szMove, int iLenMove)
 return 0 in case of some problem return 1 in case of ok

Variables

int curply
t_alg1_board m1_board
t_alg1_board m1_boardmapper
t_alg1_moves m1_movelist
st_history m_boardhistory [MAX_GAME_LENGTH]
int post_mode
int time_left

Define Documentation

#define pieceopenline x,
y,
z,
 )     if(pieceseesopen((x),(y),(z),(a))) { isAttack++; }
 

#define pieceseesdirm x,
y,
z,
a,
b,
 )     if(pieceseesmore((x),(y),(z),(a),(b),(c))) { isAttack++; }
 

#define pieceseesone x,
y,
 )     if(m1_board.m_fields[(z)]==((y)?TO_BLACK(x):TO_WHITE(x))) { isAttack++; }
 

test if after executing the move, the king is in check the king to test will be of the same colour as the colour moving the piece we will first apply the move, then see if the king jumps to any of the opposing colours


Function Documentation

int fill_movelist const enum tColour  nColour,
const t_boolean  bQuieuscience,
const enum tFillMoves  bFill
 

fill all possible moves in the movelist

t_boolean isInCheck const t_boolean  bEvaluateForWhite  ) 
 

is the position in check

unsigned int isUnderAttack const posid  iPiecePos,
const t_boolean  bEvaluateForWhite
 

unsigned int isUnderMinorAttack const posid  iPiecePos,
const t_piece  cPiece,
const t_boolean  bEvaluateForWhite
 

see if the piece gets attached by a minor piece, needed for evaluation

void normalize_movelist void   ) 
 

normalize the movelist to a 8x8 board

int search_apply_move const char *  szMove  ) 
 

void search_constructor void   ) 
 

function called once for engine construction

void search_init void   ) 
 

function called once for new game, here the board position is copied from the board into the engine calling this function will cause ep, rock and repetition and 50 moves flags to be reset

void search_printablemove const int  iSelectedMove,
char *  szMove
 

int search_root t_depth  iDepth,
char *  szMove,
int  iLenMove
 

return 0 in case of some problem return 1 in case of ok


Variable Documentation

int curply
 

t_alg1_board m1_board
 

t_alg1_board m1_boardmapper
 

t_alg1_moves m1_movelist
 

struct st_history m_boardhistory[MAX_GAME_LENGTH]
 

int post_mode
 

int time_left
 


Generated on Tue Jan 31 00:14:05 2006 for BelofteDoc by  doxygen 1.4.6