28 #ifndef GROOVIE_LOGIC_OTHELLO_H 29 #define GROOVIE_LOGIC_OTHELLO_H 31 #include "common/random.h" 32 #include "common/system.h" 41 byte _boardstate[8][8];
45 return a._score > b._score;
52 void run(byte *scriptVariables);
55 int scoreEdge(byte (&board)[8][8],
int x,
int y,
int slopeX,
int slopeY);
60 void writeBoardToVars(
Freeboard *board, byte *vars);
61 void readBoardStateFromVars(byte *vars);
63 void checkPossibleMove(
Freeboard *board,
Freeboard (&boards)[30], int8 **lineSpot,
int &numPossibleMoves,
int moveSpot, byte player, byte opponent);
65 int aiRecurse(
Freeboard *board,
int depth,
int parentScore,
int opponentBestScore);
68 uint makeMove(
Freeboard *freeboard, uint8 x, uint8 y);
70 void opInit(byte *vars);
72 void opPlayerMove(byte *vars);
74 void opAiMove(byte *vars);
83 const int _depths[60];
85 const int _movesLateGame;
87 const int8 _lookupPlayer[3];
88 const int8 _scores[3][4];
89 const int8 _edgesScores[112];
90 const int _cornersScores[105];
93 int8 *_linesStorage[484];
94 int8 _lineStorage[2016];
101 #endif // GROOVIE_LOGIC_OTHELLO_H