Round Counter in (Game in C++)

So i just startet with programming and I am trying to make a minigame. One part of the minigame is a round counter. 1 Round = 2 turns (Player 1, Player 2)

How can i write a function that gets bigger every time it is Player1's turn?

So
Round1:
-Player1
-Player2

Round2: (Game sees its Player1's turn and adds 1 to Roundnumber)
...

I tried to to it with "if or else" functions which failed and couldnt find the right "loop" for that problem.

Thanks in advance.

I tried to to it with "if or else" functions which failed

Showing us your code, even if it fails, will help us to be able to help you. Our crystal balls are not working.

And PLEASE use code tags, they make source code easier to read and comment on.

http://www.cplusplus.com/articles/jEywvCM9/
something like:

1
2
3
4
5
6
7
8
9
int roundct = 0;
while(waiting for a winner or something)
{
    p1.turn();
    p2.turn();
    roundct++; //round counter.  
}
do something with roundct;  //you can also use it in the loop, with a condition, 
//or the while's condition even eg end if roundct > 100  


Last edited on
Topic archived. No new replies allowed.