So we have to design a game board that looks like this: this is an example of the game board of size 4:
ABCDE
0+ + +
1
2+ + +
3
4+ + +
When asked for user input for example (d2) or (i3) to print a '-' or '|' between pluses or in the spaces..
I need to create a function that reads the input and place it in the right place depending on the letter and number... How can I 'separate' letter from the number? and then print the char? Thanks a lot in advance.
void make_game_baord(char array[12], int user_input)
{
for (int i = 0; i <((user_input * 2)+1); i++)
{
if (i < 10)
{
cout << " " << i;
}
else if (i >= 10)
{
cout << i;
}
for (int j = 0; j <= user_input; j++)
{
int x = i % 2;
if ( x == 0)
{
cout << "+" << " ";
}
}
cout << endl;
}
}
int main()
{
cout << "Please enter the game baord size (1 to 12): ";
int user_input;
cin >> user_input;
char board_game [12];
print_game_baord(board_game, user_input);
make_game_baord(board_game, user_input);
return 0;
]