[英]How to have a turn by turn management in C?
I want to make a game; 我想做一个游戏; say there are 50 turns and up to 4 players. 说有50个回合,最多4个玩家。 How should the code manage the turn by turn? 代码应如何依次管理?
For 2 player I think it is that: 对于2位玩家,我认为是:
if (nbr_gamers == 2)
{
if ((turn % 2) == 0)
player = 1;
else
player = 0;
}
where the turn is the position of turn. 转弯是转弯的位置。 Is that about right? 那是对的吗?
尝试这个 :
player = turn % nbr_gamers;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.