Here is my attempt so far. I am wondering if someone can look this over and just let me know if i'm even on the right track. I have a few concerns;
1; My random number generator I believe is flawed because it just goes from one to 4 in order and it displays like a hundred of each, I believe I can fix that pretty easily but I'm wondering if it's in the right spot at ;east.
2. I don't know how to allow the column to go into row 9 and make it win only if it's at row three.
3. How am I going to make it print only the winning games coordinates to the screen?
Thank you guys for your help!
Code:
#include<iostream>
#include<ctime>
using namespace std;
int main()
{
int row[8] = {1, 2, 3, 4, 5, 6, 7, 8};
int column[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int rowstart = 3;
int columnstart = 2;
int r, k, c, e;
for(int i = 0; i < 500; i++)
{
r = rowstart;
c = columnstart;
while(r < 8 || c < 8)
{
srand(time(NULL));
k = rand() % 5;
switch(k)
{
case 1:
column[c+1];
case 2:
row[r - 1];
case 3:
column[c - 1];
case 4:
row[r + 1];
cout << k << endl;
}
}
}
system("pause");
return 0;
}