I have a chess board with rows and columns in a class as below.
class ChessBoard
{
public:
int getWidth() const;
int getHeight() const;
PieceType getPiece(int x, int y) const;
void setPiece(int x, int y, PieceType Piece);
};
I then make the board as;
ChessBoard& board;
Later on I wish to access a certain tile on the board within two for loops and I'm not sure how to do it.
for(i=0;i<=ColMax, i++){//column1-->columnMax
for(j=0;j<=rowMax-1,j++){//row1-->rowMax
board.PieceType.i.j // Is this the correct way to access a square?