diff --git a/Board.h b/Board.h new file mode 100644 index 0000000..cad2497 --- /dev/null +++ b/Board.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +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 viewPossibleMoves(); + string myToUpper(string input); + void displayPossibleMoves(vector input); + void undo(Board& tablero); + void interpret(string input, Board& tablero); + void snapshot(vector& inputVec, Board inputBoard); + void easyAI(); + string boardToString(); +};