I have to general random number with rolling a dice (6 sides) for 4 players.
[code]
while (maxScore<100)
{
for (p=0; p<player_num; p++)
{
dieVal=rand()%dice+1;
cout<<"Die Value is : "<<dieVal<<" ";
score[p]=+dieVal;
cout<<"Player "<<p+1<<" at the cell of "<<score[p]<<endl;
}
maxScore=0;
if (maxScore<score[p])
maxScore=score[p];
cout<<"Player "<<p+1<<" has the maximum score of "<<maxScore<<endl;
}
cout<<"Player "<<p+1<<" reached the maximum score of "<<n*n<<endl;
** It only generates random number with one time. I need to general random number and sum up the number to see any of 4 player gets 100 first. Please help.
Die Value is : 6
Player 1 at the cell of 1958809960
Player 1 reached the maximum score of 1958809960
Player 2 reached the maximum score of 4247373
Player 3 reached the maximum score of 4249184
--------------------------------
Process exited after 0.01979 seconds with return value 0
Press any key to continue . . .