Included Board Class, made a boardToString function
This commit is contained in:
parent
9d209a61a0
commit
df39863877
1 changed files with 46 additions and 0 deletions
46
Board.h
Normal file
46
Board.h
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
struct moves {
|
||||||
|
int row;
|
||||||
|
char column;
|
||||||
|
string moveType;
|
||||||
|
|
||||||
|
moves(int linea, int columna, string m) {
|
||||||
|
row = linea;
|
||||||
|
column = columna;
|
||||||
|
moveType = m;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Board {
|
||||||
|
char boardArray [8][8];
|
||||||
|
char turn = 'O';
|
||||||
|
|
||||||
|
public:
|
||||||
|
Board();
|
||||||
|
char elementAt(int r, int k) { return boardArray[r][k]; }
|
||||||
|
void modifyAt(int r, int k, char input) { boardArray[r][k] = input; }
|
||||||
|
moves parse(string input);
|
||||||
|
char getTurn() { return turn; }
|
||||||
|
bool isGameOver();
|
||||||
|
void changeTurns();
|
||||||
|
void displayBoard();
|
||||||
|
int charToIntColumn(char input);
|
||||||
|
char intToCharColumn(int input);
|
||||||
|
void move(string inputMove);
|
||||||
|
void move(moves jugada);
|
||||||
|
bool isThisMovePossible(int r, int c, string moveType);
|
||||||
|
vector<moves> viewPossibleMoves();
|
||||||
|
string myToUpper(string input);
|
||||||
|
void displayPossibleMoves(vector<moves> input);
|
||||||
|
void undo(Board& tablero);
|
||||||
|
void interpret(string input, Board& tablero);
|
||||||
|
void snapshot(vector<Board>& inputVec, Board inputBoard);
|
||||||
|
void easyAI();
|
||||||
|
string boardToString();
|
||||||
|
};
|
Reference in a new issue