Ok I really need help on this. Im a beginner in C++. I have been assigned the task of creating a gameboard that has 3 columns and 5 rows. Each row consist of 1 2 3. We were told not to use arrays cause that may make it harder. Ive already begun but now im stuck. I need help on keeping player choices on the gameboard and alternating player turns. Any advice would help!!!!
I'm not sure why using arrays would make it harder for you, but with your problem it seems that to keep the choices on the board you will need each block to be a variable e.g.
1 2 3
int columnOne_RowOne;
int columnTwo_RowOne;
etc.
But that would be much longer than a simple array or group of arrays if you want to avoid a 2D array.
1 2 3 4
int rowOne[3];
int rowTwo[3];
int rowThree[3];
etc.
For your switching players issue you could use a loop to bring them all under one segment or put players turns into their own separate methods:
1 2 3 4 5 6 7 8 9
int main() {
// Variables and all the rest
while (gameNotEnded()) {
PlayerOne();
PlayerTwo();
}
}
This is just the way I would start off approaching the problem, not the perfect way.