Doing a program to see if I get the expected umber of 'sets' (three of a kind) in poker.

Having problems geting the number to align with the point in 'ratio' at the bottom of the

report.

Any idea on an easy way to this?

As an aside I noticed I was hitting very few set with KK in points games however

I was playing those again today today and I got KK twice in quick succession and hit a set each time . Luck evening out I suppose!!

Currently 20th in a 2000 player freroll

Prog

Code:#include <stdio.h> #include <stdlib.h> #include <io.h> #include <fcntl.h> #include <errno.h> FILE *ptr1, *ptr2, *ptr3; int filelist;//not sure what this is. int crds[2][3][13][13]; //count of each hand type float wintots[2][3][13][13];// ammount each hand won int pairs[3][13], pairswithflops[3][13]; int sets[3][13]; int allpairs[3], allpairswithflops[3], allsets[3]; int tots[3]; float tmptot, chipswon=0; char face[13]={'2','3','4','5','6','7','8','9','T','J','Q','K','A'}; char typ[3]={'F','M','P'};// game type freeroll. MMP points or 'P' = paid cash to play int gg,ss, xx, yy, c1, c2, g1,s1, aa,bb;// gg- game type ss= suited unsuited xx = card 1 yy=card2. c1=card11 c2=card2 int f1,f2,f3,f4,f5,x1,x2,x3,x4,x5; //flop1 flop2 ect.....before conversion x1 x2 x3... char var2[350]=""; int count=0; int tmp=0, suittmp=0; float freq;//frequency of occurance of a hand, hands per occurance // int cardnum(int cardchar); main(argc,argv) int argc; char *argv[]; { if ( (ptr2=fopen("hands2.doc","r")) == NULL) { puts("file2 does not exist"); exit(2); /* an early file does not exist */ } do{ /* for each line in dirfile file */ filelist=fscanf(ptr2,"%[^\n]\n",var2); //M JTUB N [7c Qs 3d Jc][Th] 1600.00 <----------format of the input. if (filelist==-1) break; // printf("\n%30.30s",var2); // printf("\n<%c%c%c>",var2[11], var2[14],var2[17] ); xx=var2[2]; yy=var2[3]; gg=var2[0]; ss=var2[4]; x1=var2[11]; x2= var2[14]; x3=var2[17]; sscanf(&var2[29],"%f",&chipswon);//M JTUB N [7c Qs 3d Jc][Th] 1600.00 c1=cardnum(xx); c2=cardnum(yy); switch(gg){ case 'P': g1=2; break; case 'T': g1=2; break; case '1': g1=0; break; case '2': g1=0; break; case '5': g1=0; break; case 'C': g1=1; break; case 'M': g1=1; break; default: printf("\n Invalid game type"); } if (xx==yy) { pairs[g1][c1]++; allpairs[g1]++; if (x1 !=' ') { pairswithflops[g1][c1]++; allpairswithflops[g1]++; } // printf("\npocket pair "); if (xx==x1 || xx==x2 || xx==x3) { // printf("Set!!"); sets[g1][c1]++; allsets[g1]++; } } switch(ss){ case 'U': s1=0; break; case 'S': s1=1; break; default: printf("\n Invalid game type"); } crds[s1][g1][c1][c2]++; wintots[s1][g1][c1][c2]+=chipswon; (tots[g1])++; count++; // if (count++ >=3750){ // printf("\n count %d",count); // break; } while(1); for(s1=0;s1<2;s1++){ for(c1=12;c1>=0;c1--){ if (s1==0) printf(" Freroll unsited Points unsuited Cash Unsuited\n"); else printf(" Freroll Suited Points Suited Cash Suited\n"); for(c2=c1;c2>=0;c2--){ if (c1!=c2) { for(g1=0;g1<3;g1++){ freq=(float)tots[g1]/(crds[s1][g1][c1][c2] + crds[s1][g1][c2][c1] ); // printf("%c Cards %c%c Count %03d Freq %03.0f Perc %3.2f %08.0f ", // typ[g1], face[c1],face[c2], crds[g1][c1][c2], freq, 82.875/freq ,wintots[g1][c1][c2]+ wintots[g1][c2][c1] ); printf(" Cards %c%c %5.0f ", face[c1],face[c2], /* wintots[s1][g1][c1][c2]+ wintots[s1][g1][c2][c1], */ 100 * (wintots[s1][g1][c2][c1] + wintots[s1][g1][c1][c2] ) / (crds[s1][g1][c1][c2] + crds[s1][g1][c2][c1] ) ); } printf("\n"); } if (c1==c2) { for(g1=0;g1<3;g1++){ freq=tots[g1]/(float)crds[0][g1][c1][c2]; // printf("%c Cards %c%c Count %03d Freq %03.0f Perc %3.2f %08.0f ", // typ[g1], face[c1],face[c2], crds[g1][c1][c2], freq, 221/freq,wintots[g1][c1][c2] ); printf(" Cards %c%c %5.0f ", face[c1],face[c2], /* wintots[0][g1][c1][c2],*/ 100 * wintots[0][g1][c1][c2]/ crds[0][g1][c1][c2] ); } printf("\n"); } } printf("\n"); } printf("\n"); } for(g1=0;g1<3;g1++){ if (g1==0) printf("\n Freeroll"); if (g1==1) printf("\n Points"); if (g1==2) printf("\n Cash"); for(c1=12;c1>=0;c1--){ printf("\n Pairs %c%c %3d Pairs with flops %3d Sets made %3d ratio %-5.3f", cardchar(c1), cardchar(c1), pairs[g1][c1], pairswithflops[g1][c1], sets[g1][c1], 100*(float)sets[g1][c1]/pairswithflops[g1][c1] ); } printf("\n Totals. \n Pairs %4d Pairs with flops %4d Sets made %3d ratio %-5.3f\n", allpairs[g1], allpairswithflops[g1], allsets[g1], 100*(float)allsets[g1]/allpairswithflops[g1]); } // printf("\n MAxINT <%d>\n", MAXINT); printf("\n Super Totals. \n Pairs %4d Pairs with flops %4d Sets made %3d ratio %-5.3f\n", allpairs[0] + allpairs[1] + allpairs[2] , allpairswithflops[0] +allpairswithflops[1] + allpairswithflops[2], allsets[0]+ allsets[1] + allsets[2], 100*(float)(allsets[0]+ allsets[1] + allsets[2] )/ ( allpairswithflops[0] +allpairswithflops[1]+allpairswithflops[2] )); printf("\n Statistical change of making a pair on the 'flop' is 12.245%% \n Total hands dealt=%d\n", count); fclose(ptr2); } int cardnum( int cardchar){ int cc; switch(cardchar){ case 'A': cc=12; break; case 'K': cc=11; break; case 'Q': cc=10; break; case 'J': cc=9; break; case 'T': cc=8; break; case '9': cc=7; break; case '8': cc=6; break; case '7': cc=5; break; case '6': cc=4; break; case '5': cc=3; break; case '4': cc=2; break; case '3': cc=1; break; case '2': cc=0; break; default: printf("\n Invalid card 1"); } return cc; } int cardchar( int cardindex){ int cc; switch(cardindex){ case 12: cc='A'; break; case 11: cc='K'; break; case 10: cc='Q'; break; case 9: cc='J'; break; case 8: cc='T'; break; case 7: cc='9'; break; case 6: cc='8'; break; case 5: cc='7'; break; case 4: cc='6'; break; case 3: cc='5'; break; case 2: cc='4'; break; case 1: cc='3'; break; case 0: cc='2'; break; default: printf("\n Invalid card 1"); } return cc; }Code:`Freroll unsited Points unsuited Cash Unsuited Cards AA 3670 Cards AA 3356 Cards AA 1571 Cards AK 394 Cards AK 441 Cards AK 605 Cards AQ 671 Cards AQ 302 Cards AQ 184 Cards AJ 687 Cards AJ -261 Cards AJ 17 Cards AT 611 Cards AT 21 Cards AT -16 Cards A9 7 Cards A9 -27 Cards A9 36 Cards A8 -76 Cards A8 -75 Cards A8 -18 Cards A7 -118 Cards A7 -63 Cards A7 33 Cards A6 -42 Cards A6 -40 Cards A6 -46 Cards A5 -125 Cards A5 44 Cards A5 -17 Cards A4 -73 Cards A4 -64 Cards A4 -88 Cards A3 -192 Cards A3 -2 Cards A3 -50 Cards A2 -105 Cards A2 -34 Cards A2 8 Freroll unsited Points unsuited Cash Unsuited Cards KK 2867 Cards KK 1841 Cards KK 2127 Cards KQ 374 Cards KQ -51 Cards KQ 97 Cards KJ -20 Cards KJ 107 Cards KJ -57 Cards KT -174 Cards KT 27 Cards KT 46 Cards K9 31 Cards K9 6 Cards K9 -20 Cards K8 -23 Cards K8 -27 Cards K8 -1 Cards K7 -30 Cards K7 94 Cards K7 -24 Cards K6 64 Cards K6 -48 Cards K6 -14 Cards K5 -30 Cards K5 -22 Cards K5 -23 Cards K4 -46 Cards K4 -21 Cards K4 -30 Cards K3 -16 Cards K3 -36 Cards K3 -16 Cards K2 -28 Cards K2 -32 Cards K2 -46 Freroll unsited Points unsuited Cash Unsuited Cards QQ 2631 Cards QQ 966 Cards QQ 1531 Cards QJ -352 Cards QJ -3 Cards QJ 2 Cards QT 236 Cards QT -48 Cards QT 74 Cards Q9 52 Cards Q9 0 Cards Q9 -41 Cards Q8 -3 Cards Q8 74 Cards Q8 -27 Cards Q7 -35 Cards Q7 -26 Cards Q7 -17 Cards Q6 -28 Cards Q6 -33 Cards Q6 -43 Cards Q5 -43 Cards Q5 -35 Cards Q5 -38 Cards Q4 -39 Cards Q4 -32 Cards Q4 -59 Cards Q3 -163 Cards Q3 -30 Cards Q3 -40 Cards Q2 1 Cards Q2 -26 Cards Q2 -45 Freroll unsited Points unsuited Cash Unsuited Cards JJ 644 Cards JJ 1682 Cards JJ 859 Cards JT -254 Cards JT 125 Cards JT -19 Cards J9 -98 Cards J9 -62 Cards J9 -27 Cards J8 93 Cards J8 -15 Cards J8 -50 Cards J7 -48 Cards J7 -39 Cards J7 -36 Cards J6 -45 Cards J6 -44 Cards J6 -41 Cards J5 30 Cards J5 -38 Cards J5 -13 Cards J4 -46 Cards J4 -44 Cards J4 -46 Cards J3 -24 Cards J3 -4 Cards J3 -36 Cards J2 -35 Cards J2 -16 Cards J2 -40 Freroll unsited Points unsuited Cash Unsuited Cards TT 1705 Cards TT 210 Cards TT 828 Cards T9 78 Cards T9 -111 Cards T9 -16 Cards T8 74 Cards T8 -56 Cards T8 -47 Cards T7 -82 Cards T7 -33 Cards T7 -53 Cards T6 -44 Cards T6 -8 Cards T6 -43 Cards T5 -25 Cards T5 -33 Cards T5 -59 Cards T4 -154 Cards T4 -39 Cards T4 -46 Cards T3 -33 Cards T3 -13 Cards T3 -56 Cards T2 -31 Cards T2 -24 Cards T2 -44 Freroll unsited Points unsuited Cash Unsuited Cards 99 744 Cards 99 184 Cards 99 208 Cards 98 35 Cards 98 -61 Cards 98 16 Cards 97 2 Cards 97 -34 Cards 97 -25 Cards 96 -3 Cards 96 -39 Cards 96 -53 Cards 95 -38 Cards 95 -33 Cards 95 -36 Cards 94 -3 Cards 94 -28 Cards 94 -55 Cards 93 -50 Cards 93 -24 Cards 93 -40 Cards 92 -18 Cards 92 -41 Cards 92 -43 Freroll unsited Points unsuited Cash Unsuited Cards 88 300 Cards 88 -21 Cards 88 351 Cards 87 43 Cards 87 -19 Cards 87 -9 Cards 86 -4 Cards 86 9 Cards 86 -70 Cards 85 -16 Cards 85 -39 Cards 85 -33 Cards 84 -20 Cards 84 -31 Cards 84 -18 Cards 83 -43 Cards 83 -50 Cards 83 -39 Cards 82 -42 Cards 82 -35 Cards 82 -44 Freroll unsited Points unsuited Cash Unsuited Cards 77 -324 Cards 77 463 Cards 77 254 Cards 76 31 Cards 76 -22 Cards 76 15 Cards 75 -66 Cards 75 -14 Cards 75 -41 Cards 74 -91 Cards 74 -46 Cards 74 -51 Cards 73 -43 Cards 73 -30 Cards 73 -25 Cards 72 -42 Cards 72 -32 Cards 72 -45 Freroll unsited Points unsuited Cash Unsuited Cards 66 32 Cards 66 -126 Cards 66 422 Cards 65 64 Cards 65 -82 Cards 65 -30 Cards 64 -108 Cards 64 -8 Cards 64 -35 Cards 63 20 Cards 63 -38 Cards 63 -45 Cards 62 -25 Cards 62 -33 Cards 62 -52 Freroll unsited Points unsuited Cash Unsuited Cards 55 -125 Cards 55 233 Cards 55 320 Cards 54 -39 Cards 54 -104 Cards 54 -45 Cards 53 -25 Cards 53 -41 Cards 53 -17 Cards 52 -35 Cards 52 -34 Cards 52 -31 Freroll unsited Points unsuited Cash Unsuited Cards 44 -363 Cards 44 109 Cards 44 -24 Cards 43 -46 Cards 43 -49 Cards 43 -16 Cards 42 -47 Cards 42 -46 Cards 42 -44 Freroll unsited Points unsuited Cash Unsuited Cards 33 -133 Cards 33 -109 Cards 33 260 Cards 32 -65 Cards 32 -57 Cards 32 -25 Freroll unsited Points unsuited Cash Unsuited Cards 22 -439 Cards 22 68 Cards 22 289 Freroll Suited Points Suited Cash Suited Cards AA 3670 Cards AA 3356 Cards AA 1571 Cards AK 225 Cards AK 1111 Cards AK 648 Cards AQ 484 Cards AQ 344 Cards AQ 628 Cards AJ 1599 Cards AJ 116 Cards AJ 478 Cards AT 290 Cards AT 233 Cards AT -60 Cards A9 61 Cards A9 28 Cards A9 -38 Cards A8 -21 Cards A8 11 Cards A8 74 Cards A7 -315 Cards A7 -43 Cards A7 16 Cards A6 -447 Cards A6 115 Cards A6 150 Cards A5 761 Cards A5 92 Cards A5 -139 Cards A4 -611 Cards A4 -199 Cards A4 -110 Cards A3 189 Cards A3 71 Cards A3 208 Cards A2 40 Cards A2 -138 Cards A2 -36 Freroll Suited Points Suited Cash Suited Cards KK 2867 Cards KK 1841 Cards KK 2127 Cards KQ 1357 Cards KQ 232 Cards KQ 2 Cards KJ -753 Cards KJ 146 Cards KJ 8 Cards KT 315 Cards KT 89 Cards KT -302 Cards K9 254 Cards K9 -35 Cards K9 200 Cards K8 -460 Cards K8 142 Cards K8 72 Cards K7 146 Cards K7 -4 Cards K7 -8 Cards K6 254 Cards K6 -125 Cards K6 16 Cards K5 -219 Cards K5 -73 Cards K5 -40 Cards K4 -130 Cards K4 -33 Cards K4 -96 Cards K3 -48 Cards K3 -68 Cards K3 -77 Cards K2 -227 Cards K2 -79 Cards K2 -14 Freroll Suited Points Suited Cash Suited Cards QQ 2631 Cards QQ 966 Cards QQ 1531 Cards QJ -2 Cards QJ -397 Cards QJ -137 Cards QT 90 Cards QT -110 Cards QT 81 Cards Q9 -695 Cards Q9 111 Cards Q9 134 Cards Q8 944 Cards Q8 -163 Cards Q8 329 Cards Q7 213 Cards Q7 -30 Cards Q7 27 Cards Q6 -306 Cards Q6 -63 Cards Q6 67 Cards Q5 102 Cards Q5 -26 Cards Q5 -56 Cards Q4 -249 Cards Q4 -47 Cards Q4 -4 Cards Q3 -51 Cards Q3 -83 Cards Q3 -52 Cards Q2 -32 Cards Q2 -73 Cards Q2 56 Freroll Suited Points Suited Cash Suited Cards JJ 644 Cards JJ 1682 Cards JJ 859 Cards JT 633 Cards JT -35 Cards JT 212 Cards J9 32 Cards J9 -178 Cards J9 1 Cards J8 375 Cards J8 133 Cards J8 18 Cards J7 -168 Cards J7 -34 Cards J7 -27 Cards J6 -58 Cards J6 -58 Cards J6 -11 Cards J5 -45 Cards J5 29 Cards J5 -112 Cards J4 -178 Cards J4 -78 Cards J4 3 Cards J3 20 Cards J3 -181 Cards J3 -4 Cards J2 529 Cards J2 -46 Cards J2 6 Freroll Suited Points Suited Cash Suited Cards TT 1705 Cards TT 210 Cards TT 828 Cards T9 316 Cards T9 1 Cards T9 24 Cards T8 51 Cards T8 -47 Cards T8 61 Cards T7 -429 Cards T7 3 Cards T7 -39 Cards T6 -84 Cards T6 -56 Cards T6 -66 Cards T5 -6 Cards T5 -30 Cards T5 -90 Cards T4 -210 Cards T4 -63 Cards T4 0 Cards T3 -60 Cards T3 -83 Cards T3 35 Cards T2 -12 Cards T2 -34 Cards T2 -25 Freroll Suited Points Suited Cash Suited Cards 99 744 Cards 99 184 Cards 99 208 Cards 98 -26 Cards 98 -9 Cards 98 35 Cards 97 312 Cards 97 319 Cards 97 190 Cards 96 -193 Cards 96 -7 Cards 96 10 Cards 95 -138 Cards 95 -56 Cards 95 -5 Cards 94 -14 Cards 94 -60 Cards 94 -63 Cards 93 -3 Cards 93 167 Cards 93 39 Cards 92 -30 Cards 92 -11 Cards 92 -92 Freroll Suited Points Suited Cash Suited Cards 88 300 Cards 88 -21 Cards 88 351 Cards 87 -77 Cards 87 -63 Cards 87 50 Cards 86 168 Cards 86 43 Cards 86 28 Cards 85 128 Cards 85 104 Cards 85 -89 Cards 84 -81 Cards 84 142 Cards 84 43 Cards 83 38 Cards 83 -49 Cards 83 2 Cards 82 -53 Cards 82 -79 Cards 82 -48 Freroll Suited Points Suited Cash Suited Cards 77 -324 Cards 77 463 Cards 77 254 Cards 76 -87 Cards 76 -123 Cards 76 244 Cards 75 68 Cards 75 -90 Cards 75 64 Cards 74 -42 Cards 74 -28 Cards 74 -19 Cards 73 -66 Cards 73 42 Cards 73 -1 Cards 72 134 Cards 72 -56 Cards 72 -40 Freroll Suited Points Suited Cash Suited Cards 66 32 Cards 66 -126 Cards 66 422 Cards 65 -81 Cards 65 -49 Cards 65 -82 Cards 64 -131 Cards 64 -147 Cards 64 132 Cards 63 -295 Cards 63 -104 Cards 63 -127 Cards 62 91 Cards 62 -52 Cards 62 -3 Freroll Suited Points Suited Cash Suited Cards 55 -125 Cards 55 233 Cards 55 320 Cards 54 94 Cards 54 -80 Cards 54 -21 Cards 53 -196 Cards 53 -27 Cards 53 -43 Cards 52 -155 Cards 52 -90 Cards 52 -117 Freroll Suited Points Suited Cash Suited Cards 44 -363 Cards 44 109 Cards 44 -24 Cards 43 38 Cards 43 -127 Cards 43 -142 Cards 42 -100 Cards 42 -77 Cards 42 -26 Freroll Suited Points Suited Cash Suited Cards 33 -133 Cards 33 -109 Cards 33 260 Cards 32 -218 Cards 32 -56 Cards 32 -76 Freroll Suited Points Suited Cash Suited Cards 22 -439 Cards 22 68 Cards 22 289 Freeroll Pairs AA 140 Pairs with flops 113 Sets made 15 ratio 13.274 Pairs KK 124 Pairs with flops 110 Sets made 9 ratio 8.182 Pairs QQ 137 Pairs with flops 111 Sets made 13 ratio 11.712 Pairs JJ 116 Pairs with flops 94 Sets made 8 ratio 8.511 Pairs TT 138 Pairs with flops 109 Sets made 12 ratio 11.009 Pairs 99 120 Pairs with flops 100 Sets made 9 ratio 9.000 Pairs 88 121 Pairs with flops 109 Sets made 6 ratio 5.505 Pairs 77 120 Pairs with flops 109 Sets made 10 ratio 9.174 Pairs 66 127 Pairs with flops 108 Sets made 15 ratio 13.889 Pairs 55 107 Pairs with flops 96 Sets made 14 ratio 14.583 Pairs 44 126 Pairs with flops 108 Sets made 14 ratio 12.963 Pairs 33 119 Pairs with flops 114 Sets made 16 ratio 14.035 Pairs 22 126 Pairs with flops 111 Sets made 17 ratio 15.315 Totals. Pairs 1621 Pairs with flops 1392 Sets made 158 ratio 11.351 Points Pairs AA 129 Pairs with flops 115 Sets made 12 ratio 10.435 Pairs KK 98 Pairs with flops 91 Sets made 5 ratio 5.495 Pairs QQ 109 Pairs with flops 97 Sets made 8 ratio 8.247 Pairs JJ 111 Pairs with flops 98 Sets made 13 ratio 13.265 Pairs TT 113 Pairs with flops 99 Sets made 12 ratio 12.121 Pairs 99 110 Pairs with flops 96 Sets made 11 ratio 11.458 Pairs 88 122 Pairs with flops 98 Sets made 9 ratio 9.184 Pairs 77 104 Pairs with flops 88 Sets made 11 ratio 12.500 Pairs 66 109 Pairs with flops 87 Sets made 8 ratio 9.195 Pairs 55 104 Pairs with flops 91 Sets made 11 ratio 12.088 Pairs 44 107 Pairs with flops 95 Sets made 11 ratio 11.579 Pairs 33 100 Pairs with flops 87 Sets made 11 ratio 12.644 Pairs 22 135 Pairs with flops 111 Sets made 13 ratio 11.712 Totals. Pairs 1451 Pairs with flops 1253 Sets made 135 ratio 10.774 Cash Pairs AA 281 Pairs with flops 233 Sets made 31 ratio 13.305 Pairs KK 266 Pairs with flops 244 Sets made 29 ratio 11.885 Pairs QQ 268 Pairs with flops 225 Sets made 25 ratio 11.111 Pairs JJ 274 Pairs with flops 235 Sets made 35 ratio 14.894 Pairs TT 293 Pairs with flops 241 Sets made 30 ratio 12.448 Pairs 99 256 Pairs with flops 204 Sets made 26 ratio 12.745 Pairs 88 269 Pairs with flops 218 Sets made 30 ratio 13.761 Pairs 77 295 Pairs with flops 237 Sets made 25 ratio 10.549 Pairs 66 304 Pairs with flops 244 Sets made 31 ratio 12.705 Pairs 55 275 Pairs with flops 222 Sets made 34 ratio 15.315 Pairs 44 298 Pairs with flops 250 Sets made 27 ratio 10.800 Pairs 33 290 Pairs with flops 239 Sets made 34 ratio 14.226 Pairs 22 284 Pairs with flops 236 Sets made 35 ratio 14.831 Totals. Pairs 3653 Pairs with flops 3028 Sets made 392 ratio 12.946 Super Totals. Pairs 6725 Pairs with flops 5673 Sets made 685 ratio 12.075 Statistical change of making a pair on the 'flop' is 12.245% Total hands dealt=114994`