From df39863877e418271470817c54df62c2d8d04f13 Mon Sep 17 00:00:00 2001 From: Brandon Jackson <1drummer@att.net> Date: Mon, 19 Oct 2015 20:10:56 -0500 Subject: [PATCH] Included Board Class, made a boardToString function --- Board.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Board.h 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(); +};