PraktikumOthello/players/playerlib.h

33 lines
944 B
C
Raw Normal View History

2015-03-07 17:18:50 +01:00
#ifndef PLAYERLIB_H
#define PLAYERLIB_H
2015-03-10 13:54:11 +01:00
const unsigned int fieldHeight=8, fieldWidth=8;
extern char enemyc; //initially 0, contains char of enemy's stone
extern char ownc;
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[fieldWidth*fieldHeight-4]();
};
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 (*)[fieldWidth]);
2015-03-07 17:18:50 +01:00
//adds all hotizontally-forward found moves to movesList
int findHorizontalForwardMoves(cell (*)[fieldWidth], movesList *);
int findHorizontalBackwardMoves(cell (*)[fieldWidth], movesList *);
int findVerticalForwardMoves(cell (*)[fieldWidth], movesList *);
int findVerticalBackwardMoves(cell (*)[fieldWidth], movesList *);
2015-03-07 17:18:50 +01:00
#endif