As a school project I'm writing a C program that is a dice game with two players. I think I have most of the logic of the game worked out but I'm having problems knowing how to handle the switching between two players when a condition is met, and keeping the separate totals for each player. For example, I'm wanting to write the code for playerX, where X is player 1 or 2. How do write it so I'm not hard coding it for 1 or 2, but that the program executes for 1 then 2 and back and forth until a final condition is met (someone wins)?
Thank you for any help,