i have my program outputting a number grid that is nxn. i have it using a 2d array to output my grid but the issue im having is that when the user wants to input a number that is in the nxn grid, the value is not being replaced by either an x or and o. essentially its a big tic tac toe board that takes 5 to win and not 3. so lets say it was a 10x10 board, my program can output this
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
and now it requests the user for a number, lets say 74, but when they enter the number it does not replace the letter 74 on the grid
My thinking is that i have to make another 2d array so that it stores the users input and then outputs the new grid but with the user's input as an x or an o over said number.(my code thus far and i know it doesn't do much else other than output a grid, any help/suggestions on how to fix it would be appreciated tho)
#include <iostream>
using namespace std;
int main()
{
double n;
do {
cout << "Inpute Board size between 10 and 50" << endl;
cin >> n;
}while(n < 10 || n>50);
do{
int point;
int game_board[99][99];
int value(1);
for(int x=0; x<n; x++) {
for(int y=0; y<n; y++) {
game_board[x][y] = value++;
}
}
for(int x=0; x<n; x++) {
cout << endl;
for(int y=0; y<n; y++) {
if(game_board[x][y] <= 9){
cout << game_board[x][y]<< " ";
}
else{
cout<<game_board[x][y]<<" ";
}
}
}
cout << endl;
cin >> point;
}while(true);
system("PAUSE");
return 0;
}