38 lines
1.2 KiB
C
38 lines
1.2 KiB
C
#ifndef PLAYERLIB_H
|
|
#define PLAYERLIB_H
|
|
|
|
const int fieldSize=8;
|
|
|
|
extern char enemyc; //initially 0, contains char of enemy's stone
|
|
extern char ownc;
|
|
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[100](); //eigentlich maximal 8*8-4 Lösungen, aber manche doppelt? -> Reserve
|
|
};
|
|
|
|
//returns the character used for the enemy's stones
|
|
extern char getEnemyChar(char);
|
|
//reads the stateBuffer string into a 2d matrix
|
|
extern int readStateBuffer(char*, cell (*)[fieldSize]);
|
|
|
|
//adds all hotizontally-forward found moves to movesList
|
|
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 *);
|
|
|
|
#endif
|