PraktikumOthello/players/playerlib.h

39 lines
1.3 KiB
C

#ifndef PLAYERLIB_H
#define PLAYERLIB_H
const int fieldHeight=8;
const int fieldWidth=fieldHeight; //spätere Annahme: Feld quadratisch
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 (*)[fieldWidth]);
//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 *);
int findDiagonalTopLeftMoves(cell (*)[fieldWidth], movesList *);
int findDiagonalBottomRightMoves(cell (*)[fieldWidth], movesList *);
int findDiagonalBottomLeftMoves(cell (*)[fieldWidth], movesList *);
int findDiagonalTopRightMoves(cell (*)[fieldWidth], movesList *);
#endif