2015-03-07 17:18:50 +01:00
|
|
|
#ifndef PLAYERLIB_H
|
|
|
|
#define PLAYERLIB_H
|
|
|
|
|
2015-03-11 23:29:56 +01:00
|
|
|
const int fieldSize=8;
|
2015-03-11 23:26:52 +01:00
|
|
|
|
2015-03-08 19:16:27 +01:00
|
|
|
extern char enemyc; //initially 0, contains char of enemy's stone
|
2015-03-11 11:28:20 +01:00
|
|
|
extern char ownc;
|
2015-03-10 13:54:11 +01:00
|
|
|
struct cell {
|
|
|
|
char content = '.';
|
|
|
|
unsigned short int timesVisited = 0;
|
|
|
|
};
|
2015-03-11 11:28:20 +01:00
|
|
|
struct move {
|
|
|
|
unsigned int turnRow;
|
|
|
|
unsigned int turnCol;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct movesList {
|
|
|
|
unsigned int movesNumber = 0;
|
2015-03-11 23:26:52 +01:00
|
|
|
move *list = new move[100](); //eigentlich maximal 8*8-4 Lösungen, aber manche doppelt? -> Reserve
|
2015-03-11 11:28:20 +01:00
|
|
|
};
|
|
|
|
|
2015-03-07 17:18:50 +01:00
|
|
|
//returns the character used for the enemy's stones
|
2015-03-08 18:40:31 +01:00
|
|
|
extern char getEnemyChar(char);
|
2015-03-10 13:54:11 +01:00
|
|
|
//reads the stateBuffer string into a 2d matrix
|
2015-03-11 23:29:56 +01:00
|
|
|
extern int readStateBuffer(char*, cell (*)[fieldSize]);
|
2015-03-07 17:18:50 +01:00
|
|
|
|
2015-03-11 15:52:48 +01:00
|
|
|
//adds all hotizontally-forward found moves to movesList
|
2015-03-11 23:29:56 +01:00
|
|
|
int findHorizontalForwardMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findHorizontalBackwardMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findVerticalForwardMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findVerticalBackwardMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findDiagonalTopLeftMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findDiagonalBottomRightMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findDiagonalBottomLeftMoves(cell (*)[fieldSize], movesList *);
|
|
|
|
int findDiagonalTopRightMoves(cell (*)[fieldSize], movesList *);
|
2015-03-11 15:52:48 +01:00
|
|
|
|
2015-03-07 17:18:50 +01:00
|
|
|
#endif
|