Advertisement
Guest User

PokerDraw

a guest
Apr 24th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1.     //drawPayouts is where the results are stored.  drawArray is where all condenced hands, plus their weight are stored.
  2.     void LoopCondencedHands() {
  3.         for (int i = 0; i < drawPayouts.Length; i++)
  4.         {
  5.             //Five cards
  6.             drawPayouts[i][array0[HandIndex5(drawArray[i])]]++;
  7.  
  8.             //Four Cards
  9.             //Use array1[0] because all lengths are the same.
  10.             for (int j = 0; j < array1[0].Length; j++)
  11.             {
  12.                 //Check all five ways of playing four cards.
  13.                 //Use "* drawArray[i][5]" to count the weight.
  14.                 drawPayouts[i][j] += (array1[j][HandIndex4(drawArray[i][0], drawArray[i][1], drawArray[i][2], drawArray[i][3])] * drawArray[i][5]);
  15.                 drawPayouts[i][j] += array1[j][HandIndex4(drawArray[i][0], drawArray[i][1], drawArray[i][2], drawArray[i][4])] * drawArray[i][5];
  16.                 drawPayouts[i][j] += array1[j][HandIndex4(drawArray[i][4], drawArray[i][1], drawArray[i][2], drawArray[i][3])] * drawArray[i][5];
  17.                 drawPayouts[i][j] += array1[j][HandIndex4(drawArray[i][0], drawArray[i][4], drawArray[i][2], drawArray[i][3])] * drawArray[i][5];
  18.                 drawPayouts[i][j] += array1[j][HandIndex4(drawArray[i][0], drawArray[i][1], drawArray[i][4], drawArray[i][3])] * drawArray[i][5];
  19.                 //If this is the value of holding all five cards, subtract one.
  20.                 if (array0[HandIndex5(drawArray[i])] == j)
  21.                     { drawPayouts[i][j]--; }
  22.             }
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement