Subj : texas holdem To : comp.programming From : bob Date : Thu Oct 06 2005 09:24 am Please let me know if you see anything wrong with my code to determine the probability of a 2 and 3 unsuited winning, losing, or tying in Texas Holdem. For some reason, it returns wrong numbers. void nicesimone(Card card1, Card card2) { int wins=0, losses=0, draws=0; Card cards[9]; cards[0] = card1; cards[1] = card2; int card1num = card1.getcardnum(); int card2num = card2.getcardnum(); int c1, c2, c3, c4, c5, c6, c7; for (c1 = 0; c1 < 52-6; c1++) for (c2 = c1+1; c2 < 52-5; c2++) for (c3 = c2+1; c3 < 52-4; c3++) for (c4 = c3+1; c4 < 52-3; c4++) for (c5 = c4+1; c5 < 52-2; c5++) for (c6 = c5+1; c6 < 52-1; c6++) for (c7 = c6+1; c7 < 52-0; c7++) { if (c1 == card1num || c2 == card1num || c3 == card1num || c4 == card1num || c5 == card1num || c6 == card1num || c7 == card1num) continue; if (c1 == card2num || c2 == card2num || c3 == card2num || c4 == card2num || c5 == card2num || c6 == card2num || c7 == card2num) continue; cards[2] = Card(c1); cards[3] = Card(c2); cards[4] = Card(c3); cards[5] = Card(c4); cards[6] = Card(c5); cards[7] = Card(c6); cards[8] = Card(c7); int compscore = getscore(cards+2); int playerscore = getscore(cards); if (playerscore > compscore) wins++; else if (playerscore < compscore) losses++; else draws++; } cout << "wins: " << wins << " losses: " << losses << " draws: " << draws << endl; int total = wins+losses+draws; cout << "win: " << float(wins)/float(total) << endl; cout << "losses: " << float(losses)/float(total) << endl; cout << "draws: " << float(draws)/float(total) << endl; } nicesimone(Card(TWO, SPADES), Card(THREE, CLUBS)); .