Im basically trying to code a grid based game, which im doing tick tack toe. its also based of a lesson of arrays. im so lost and would really appreciate help :( this is what i have so far
#include <iostream>
using namespace std;
void Board(char gridGame [3][3]){
for (int i = 0; i <= 2; i++){
for (int j = 0; j <= 2; j++){
cout << gridGame[i][j] << "|";
}
cout << endl;
}
}
int main(){
char gridGame [3][3] = {};
int column = 0;
int row = 0;
bool player1turn = true;
bool running = true;
while (running) {
if (player1turn){
cout << "Player 1, which COLUMN would you like to go? ";
cin >> column;
column--;
cout << "player 1, which ROW would you like to go? ";
cin >> row;
row--;
if (gridGame[column][row] == '\0'){
gridGame[column][row] = 'X';
}
}
Board(gridGame);
if (!player1turn){
cout << "Player 2, which COLUMN would you like to go? ";
cin >> column;
column--;
cout << "player 2, which ROW would you like to go? ";
cin >> row;
row--;
if (gridGame[column][row] == '\0'){
gridGame[column][row] = 'O';
}
}
Board(gridGame);
}
}