Advertisement
electricmaster

PassHandsUp()

Feb 22nd, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1.     /// <summary>
  2.     /// Every player will give their hand to the next player
  3.     /// </summary>
  4.     public void PassHandsUp() {
  5.         int j;
  6.         int k = 0;
  7.         // if we push the 0th hand to the correct position, the offset
  8.         // will move the others into the correct spot as well
  9.         for (int i = 0; i < Players.Length - 1; i++) {
  10.             j = k;
  11.             if (Clockwise) {
  12.                 if (j == Players.Length - 1) break; // we're done
  13.                 if (k == Players.Length - 1) k = 0;
  14.                 else k++;
  15.                 SwapHands(Players[j], Players[k]);
  16.             }
  17.             else {
  18.                 if (j == 1) break; // we're done
  19.                 if (k == 0) k = Players.Length - 1;
  20.                 else k--;
  21.                 SwapHands(Players[j], Players[k]);
  22.         }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement