For a linear order it would be fairly straight forward. Game starts, set turn int to 1. when turn is complete add 1 to the turn int, when the next turn is setting up check which number it is to allow the correct player to take control, if the number is larger than the amount of players then reset to 1.
If you wanted non linear ordering you would probably add the player numbers to an array at the beginning of a cycle in an order that complies with your requirements, then keep getting the next one of the array for each turn, once you reach the end you restart your procedure.