Hi.
How do generate 15 random positions in a 2d array and store 'F'.
Example:
#include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
int main()
{
char bloodyBoard[10][10];
for (int i = 0; i < 10; i++)
{
for (int k = 0; k < 10; k++)
{
bloodyBoard[i][k] = 'E'; // store 'E'
cout << bloodyBoard[i][k] << " "; // display board
}
cout << endl;
}
}
I set the 10x10 array to store 'E'.
But afterwards to RNG 15 positions to store 'F' I'm stuck.
Please help!