Bellow is the test code.

Expected result from my Mac PPC, and Windows XP Pentium 4 tests
8c 7h
7c 2h
9s 5d Jh
  p      win  loss  tie
  1      124      96     770
  2      124     770      96

Results from Mac Intel
8c 7h
7c 2h
9s 5d Jh
  p      win  loss  tie 
  1       24     594     372
  2       24     372     594 


int main( int argc, char *argv[] ) {
    int i;
        int numPlayers = 2;
        int numWinners;
        int cardIndex;
        int win[MAX_PLAYERS];
        int lose[MAX_PLAYERS];
        int tie[MAX_PLAYERS];
        HandVal maxHand;
        HandVal handval[MAX_PLAYERS];
    CardMask commonCards;
        CardMask evalCards;
        CardMask tmpCards;
        CardMask deadCards;
        CardMask playerCards[MAX_PLAYERS];
        
        StdDeck_CardMask_RESET(commonCards);
    for (i = 0; i < MAX_PLAYERS; i++) {
        StdDeck_CardMask_RESET(playerCards[i]);
                win[i] = 0;
                lose[i] = 0;
                tie[i] = 0;
    }
        
        StdDeck_stringToCard("7h", &cardIndex);
        CardMask_SET(playerCards[0], cardIndex);
        StdDeck_stringToCard("8c", &cardIndex);
        CardMask_SET(playerCards[0], cardIndex);
        printf("%s \n", Deck_maskString(playerCards[0]));
        
        StdDeck_stringToCard("7c", &cardIndex);
        CardMask_SET(playerCards[1], cardIndex);
        StdDeck_stringToCard("2h", &cardIndex);
        CardMask_SET(playerCards[1], cardIndex);
        printf("%s \n", Deck_maskString(playerCards[1]));
        
        StdDeck_stringToCard("5d", &cardIndex);
        CardMask_SET(commonCards, cardIndex);
        StdDeck_stringToCard("9s", &cardIndex);
        CardMask_SET(commonCards, cardIndex);
        StdDeck_stringToCard("jh", &cardIndex);
        CardMask_SET(commonCards, cardIndex);           
        printf("%s \n", Deck_maskString(commonCards));
        
        CardMask_OR(deadCards, playerCards[0], playerCards[1]);
        CardMask_OR(deadCards, deadCards, commonCards);
        
        ENUMERATE_N_CARDS_D(evalCards, 2, deadCards,
                {               
                        numWinners = 0;
                        maxHand = HandVal_NOTHING;
                                                                
                        for (i = 0; i < numPlayers; i++) {
                                CardMask_OR(tmpCards, playerCards[i], 
commonCards);
                                CardMask_OR(tmpCards, tmpCards, evalCards);
                                //printf("%i   %s \n", i, 
Deck_maskString(tmpCards));
                                handval[i] = Hand_EVAL_N(tmpCards, 7);
                                                                        
                                if (handval[i] > maxHand) {
                                        maxHand = handval[i];
                                } else if (handval[i] == maxHand) {
                                        ++numWinners;                           
        
                                }
                        }
                                                                
                        for (i = 0; i < numPlayers; i++) {
                                if (handval[i] == maxHand) {
                                        if (numWinners == 1) {
                                                ++win[i];
                                        } else {
                                                ++tie[i];
                                        }
                                }else {
                                        ++lose[i];
                                }
                        }
                });
        
    
    printf("  p      win  loss  tie  \n");
    for (i=0; i < numPlayers; i++) {
        printf("  %i  %7ld %7ld %7ld \n",
                           (i + 1),
                           win[i],
                           lose[i],
                           tie[i]);
    }
        return 0;
}

 
On Monday, October 08, 2007, at 12:04PM, "Loic Dachary" <[EMAIL PROTECTED]> 
wrote:
>[EMAIL PROTECTED] writes:
>
>> Hi
>>
>> Unfortunately only my friend has an Intel Mac therefore it is a bit
>> tricky to be 100% sure what is going on.  Also I can't run configure
>> and install on his machine due to it is about 12 hours flight hours
>> away ;-)
>
>  :-)
>
>> Maybe I am setting the XCode compiler flags wrong, or I am setting the 
>> Universal binary settings wrong.
>> My first idea is that the endian #define or t_ tables are generated with the 
>> wrong endian.
>
>  I very much doubt endianess is a problem because poker-eval has been 
>reported to work on various architectures. See the builds at
>
>http://buildd.debian.org/build.php?pkg=poker-eval
>
>
>> The symptom is:
>> ENUMERATE_N_CARDS_D returns wrong results, example to many ties.
>
>  I need a more detailed bug report to help you. Which code, what input
>what output.
>
>  Cheers,
>
>-- 
>+33 1 76 60 72 81  Loic Dachary mailto:[EMAIL PROTECTED]
>http://dachary.org/loic/gpg.txt sip:[EMAIL PROTECTED]
>Latitude: 48.86962325498033 Longitude: 2.3623046278953552
>
>

_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users

Reply via email to