Add files via upload

This commit is contained in:
agsNeto20
2022-05-11 17:44:45 +02:00
committed by GitHub
commit e2ef1fa590
17 changed files with 2780 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#include <iostream>
#include <fstream>
#include <ctime>
#ifndef CMVM_H
#define CMVM_H
#include "cboard.h"
using namespace std;
class CMvM
{
private:
CBoard *board;
char current_player;
int difficulty1;
int difficulty2;
public:
CMvM(int = 1, int = 1, char = 'O');
~CMvM();
// GAME
void playGame(); // main method
void gameOver(); // roll the credits
void showGame() const; // show game events
void switchPlayer(); // switch between players
// PLAYERS MECHANINCS
int computerMakePlay();
// ALGORITHMS
int randomPlay(); // returns random play
int winNextPlay(); // returns next win move, if not, -1
int defendNextPlay() ; // returns next defensive move, if not, -1
int bestPlay(); // returns the best play possible
// FILES
void saveGame() const; // saves game into file
bool loadGame(); // loads game from file (if any)
void clearFile() const; // clears file
};
#endif // CMVM_H