Does anyone now how to create a game id for tictactoe,i.e each new game that is played is given a game id.
help
Could you do something based on the current time? See: http://www.cplusplus.com/reference/clibrary/ctime/time/ If you had two subsequent runs it would be very unlikely that they got the exact same ID.
can't you just use a function :
int generateGameID(){
static int i = 0;
++i;
return i;
}
And use that inside you game :
do{
int currId = generateGameID();
while(gameIsNotOver){
runGame(currId)
}
}while( someCondition );
Or did I misread your post?
Or did I misread your post?
I was wondering whether or not I had, too. It seemed to me like he wanted a "global" count of how many games had been played. I thought about writing out a binary file that kept track but I presume that's probably not in the scope of the assignment.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.