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
|
int AImove(int &x, string &a1, string &a2, string &a3, string &a4, string &a5, string &a6,string &a7,string &a8, string &a9,)
{
int score;
string a01, b2,c3,d4,e5,f6,g7,h8,i9;
srand((unsigned)time(0)); //seed
int Random; //declare creature type
if (score < 10)
{
Random = (rand()%4+1);
switch(Random)
{
case 1:
b2 = "O";
return b2;
case 2:
d4 = "O";
return d4;
case 3:
f6 = "O";
return f6;
case 4:
h8 = "O";
return h8;
}
}
if (score > 10)
{
if(score < 20)
{
e5 = "O";
return e5;
}
if (score > 20)
{
Random = (rand()%4+1);
switch(Random)
{
case 1:
a01 = "O";
return a01;
case 2:
c3 = "O";
return c3;
case 3:
g7 = "O";
return g7;
case 4:
i9 = "O";
return i9;
}
}
}
}
|