Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Tic-Tac-Toe/AI.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46 lines (33 sloc)
827 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef AI_H | |
#define AI_H | |
#include <iostream> | |
#include <stdlib.h> | |
#include <time.h> | |
#include "Grid.h" | |
class AI | |
{ | |
public: | |
AI(); | |
AI(Grid *grid); | |
void aiTurn(); | |
char getSymbol(); | |
void setSymbol(char playerSymbol); | |
void setDifficulty(); | |
void setTargetGrid(Grid *grid); | |
private: | |
enum difficultyScale{Normal = 1, Impossible = 2}; | |
void normalAITurn(); | |
void impossibleAITurn(); | |
// Moves for impossible difficulty AI to use | |
int impMoveWin(); | |
int impMoveBlock(); | |
int impMoveCentral(); | |
int impMoveOppCorner(); | |
int impMoveCorner(); | |
int impMoveSide(); | |
Grid *gridPtr; | |
int difficulty = 0; | |
char symbol = ' '; | |
char opponentSymbol = ' '; | |
}; | |
#endif // AI_H |