PraktikumOthello/players/playerlib.h

46 lines
1 KiB
C
Raw Normal View History

2015-03-07 17:18:50 +01:00
#ifndef PLAYERLIB_H
#define PLAYERLIB_H
const int fieldSize=8, maxMoves=100; // =fieldHeight=fieldWidth
extern unsigned int endgame;
2015-03-11 23:26:52 +01:00
2015-03-10 13:54:11 +01:00
struct cell {
char content = '.';
unsigned short int timesVisited = 0;
};
struct move {
unsigned int turnRow;
unsigned int turnCol;
};
struct movesList {
unsigned int movesNumber = 0;
move *list = new move[maxMoves](); //eigentlich maximal 8*8-4 Lösungen, aber manche doppelt? -> Reserve
};
struct gameTree{
int evaluation;
move nodeMove;
gameTree *childMove = NULL;
unsigned int numChildMoves=0;
};
struct evalMove{
int evaluation;
move m;
};
2015-03-07 17:18:50 +01:00
//returns the character used for the enemy's stones
extern char getEnemyChar(char);
2015-03-10 13:54:11 +01:00
//reads the stateBuffer string into a 2d matrix
extern int readStateBuffer(char*, cell (*)[fieldSize], unsigned int *, unsigned int *);
2015-03-07 17:18:50 +01:00
//iterates through field in all directions, stores moves into movesList
int findMoves(cell (*)[fieldSize], movesList *, char);
//returns 1 if move on corner field
int isCornerField(move);
2015-03-12 17:09:34 +01:00
//returns 1 if move on C or C field
int isCOrXField(move);
2015-03-07 17:18:50 +01:00
#endif