From aa50abcaff12fb86de18de3aa13a85a39fbca446 Mon Sep 17 00:00:00 2001 From: Alexander Huddleston Date: Tue, 27 Oct 2015 14:49:03 -0500 Subject: [PATCH] Fixing moves. --- Board.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Board.cpp b/Board.cpp index 44e5ee9..fbdf90c 100755 --- a/Board.cpp +++ b/Board.cpp @@ -198,7 +198,7 @@ void Board::move(moves jugada){ int row = 8 - (jugada.row); int column = charToIntColumn(jugada.column); - cout << row << " " << column << "\n\n"; + //cout << row << " " << column << "\n\n"; if (row > 8 || row < 0 || column > 8 || column < 0) { cout<<"ERROR: index out of bound."<getX() << piece->getY() << "\n\n"; if (piece->getType() != turn) { cout<<"ERROR: attempting to move the wrong side's piece.\n"; } else { if (jugada.moveType == "FWD") { - if(isPiece(row--, column)) { - if(getPiece(row--, column)->getType() != piece->getType()) { - getPiece(row--, column)->isTaken(); - piece->moveFwd(); - } - else { - cout << "Invalid move, there is a piece there.\n"; - return; - } + if(piece->getType() == 'O') { + row--; + } + else { + row++; + } + if(isPiece(row, column)) { + cout << "Invalid move, there is a piece there.\n"; + return; } else { piece->moveFwd();