1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
/* This procedure calculates the various betting statistics, such as
quinellas, exactas, trifectas, etc.
*/
void betting() {
int i,j,k; /*counters*/
int exacta[TOTALPLAYERS+1][TOTALPLAYERS+1];
int total; /*running sum*/
nplayers = TOTALPLAYERS;
/*trifecta results*/
/*
for i:= 1 to nplayers do
begin
printf;
printf(' Trifecta results, Win=',i);
printf;
printf(' place show');
write(' ');
for j:=1 to nplayers do
write(j:7);
printf;
for j:=1 to nplayers do
begin
write(j,' ');
for k:= 1 to nplayers do
write(results[i,j,k]:7);
printf;
end;
printf;
printf;
end;
*/
/*trifecta boxing*/
/*
printf(' Trifecta Boxing');
printf;
printf(' x y z payoffs %occurances');
for i := 1 to nplayers do
for j := i+1 to nplayers do
for k := j+1 to nplayers do
begin
total := results[i,j,k] + results
[i,k,j] + results[j,i,k] +
results[j,k,i] + results[k,i,j] + results[k,j,i];
printf(i:3,j:3,k:3,' ',total:7,' ',
(100.0*total)/(ngames):6:3);
end;
printf;
printf;
*/
/*Exacta or perfecta*/
/*
printf(' Exacta Betting');
printf;
printf(' i j payoffs %payoffs');
for i:=1 to nplayers do
for j:=1 to nplayers do
begin
exacta[i,j] := 0;
for k:=1 to nplayers do
exacta[i,j] := exacta[i,j] + results[i,j,k];
printf(i:3,j:3,' ',exacta[i,j],' ',
(100.0*exacta[i,j])/(ngames):6:3);
end;
printf;
printf;
*/
/*quinella*/
/*
printf(' quinella');
printf;
printf(' i j payoffs %payoffs');
for i:=1 to nplayers do
for j:=i to nplayers do
begin
total := exacta[i,j] + exacta[j,i];
printf(i:3,j:3,' ',total,' ',
(100.0*total)/(ngames):6:3);
end;
printf;
printf;
*/
/*length of game*/
/*
printf;
printf;
printf(' length of game');
printf;
printf(' i outcomes %outcome');
*/
total = 0;
for (i=1; i<=MAXLENGTH; i++) {
/*
printf(i:4,' ',length[i],' ',(100.0*length[i]/ngames):6:3);
*/
total = total + length[i]*i;
}
printf("\nThe expected length of a game sans ties is: %6.3f\n",
(float)total/(float)ngames);
printf("\n\n");
/*number of ties*/
/*
printf;
printf;
printf(' number of ties');
printf;
printf(' nplayers frequency %outcome');
for i:=1 to TOTALPLAYERS do
printf(' ',i,' ',nties[i],' ',
(100.0*nties[i])/(2*ngames):6:3);
printf;
printf;
*/
}
|