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

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.