Homework 4, Feedback.
What is this?
if (column < width && row < height) {
index = ((row * rowLength) + column);
} else if (column >=width || row >= height) {
index = ((row * rowLength) + column) + 1000;
}
Duplicate code!
coord1 = GetCoord(board);
board[coord1].Flip();
PrintCard(board[coord1].GetCard());
DrawBoard(board);
coord2 = GetCoord(board);
board[coord2].Flip();
PrintCard(board[coord2].GetCard());
DrawBoard(board);
Use those enumerations
When the assignment says "Change and set allow the user to change the coordinate.
These should call the underlying board functions. The coordinate class SHOULD NOT implement any board logic."
Questions for the collective:
void CardT::Random(int maxValue) {
suite = static_cast<SuiteT> (rand() % SUITE_COUNT);
value = rand() % maxValue + 2;
return;
}
Why +2? Do you not like the Ace of whatever?
void SquareT::SetCard(CardT c){
if (cardPresent == false){
card = c;
cardPresent = true;
}
}
Am I not allowed to change a card in the square?
Why this?