calcHandsChance
This commit is contained in:
@@ -563,15 +563,17 @@ int array[7][3];
|
||||
}
|
||||
|
||||
|
||||
int* CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards)
|
||||
int** CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
int* hand = new int[10];
|
||||
int** hand = new int*[10];
|
||||
int cards[7];
|
||||
int sum = 0;
|
||||
|
||||
for(i=0;i<10;i++) hand[i] = 0;
|
||||
for(i=0;i<10;i++) {
|
||||
for(j=0;j<2;j++) hand[i][j] = 0;
|
||||
}
|
||||
|
||||
cards[0] = playerCards[0];
|
||||
cards[1] = playerCards[1];
|
||||
@@ -595,14 +597,14 @@ int* CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardC
|
||||
if(j!=cards[0] && j!=cards[1] && j!=cards[2] && j!=cards[3] && j!=cards[4]) {
|
||||
cards[5] = i;
|
||||
cards[6] = j;
|
||||
hand[cardsValue(cards,0)/100000000]++;
|
||||
(hand[cardsValue(cards,0)/100000000][0])++;
|
||||
sum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(i=0;i<10;i++) {
|
||||
hand[i] = (int)(((double)hand[i]/(double)sum)*100.0+0.5);
|
||||
hand[i][0] = (int)(((double)hand[i][0]/(double)sum)*100.0+0.5);
|
||||
}
|
||||
|
||||
} break;
|
||||
@@ -611,17 +613,17 @@ int* CardsValue::calcCardsChance(GameState beRoID, int* playerCards, int* boardC
|
||||
for(i=0;i<52;i++) {
|
||||
if(i!=cards[0] && i!=cards[1] && i!=cards[2] && i!=cards[3] && i!=cards[4] && i!=cards[5]) {
|
||||
cards[6] = i;
|
||||
hand[cardsValue(cards,0)/100000000]++;
|
||||
(hand[cardsValue(cards,0)/100000000][0])++;
|
||||
sum++;
|
||||
}
|
||||
}
|
||||
for(i=0;i<10;i++) {
|
||||
hand[i] = (int)(((double)hand[i]/(double)sum)*100.0+0.5);
|
||||
hand[i][0] = (int)(((double)hand[i][0]/(double)sum)*100.0+0.5);
|
||||
}
|
||||
|
||||
} break;
|
||||
case GAME_STATE_RIVER: {
|
||||
hand[cardsValue(cards,0)/100000000] = 100;
|
||||
hand[cardsValue(cards,0)/100000000][0] = 100;
|
||||
} break;
|
||||
default: {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user