DECLARE SUB NewFrame (WinnerMarket, Percentage!) DECLARE SUB WorkNewOdds (Percentage!, ProfitOdds$) ' Written : 26 Sept 1991 ' Language : MicroSoft QuickBasic 4.5 ' Author : Keith Farrell ' VARIABLES CONST UnitstoBet = 100 ' ~~~~~~~~~ CONST MaxHorse = 20 Yellow = 14: White = 7 KEY(1) ON KEY(2) ON WinnerMarket = 1 ' if you want to be a winner WinnerMarket ' should be less than 1 - the more it IS ' less than one the more you will win - ' but the lesser likely you will meet such odds DIM OrigOdds$(MaxHorse), OrigPerc(MaxHorse), FrameOdds$(MaxHorse) DIM FramePerc(MaxHorse), ToBet(MaxHorse) ' PROGRAM ' ~~~~~~~ COLOR (White) CLS PRINT , "HORSE ODDS" PRINT : PRINT Another$ = "Y" Horse = 0 PRINT " Enter Odds and I will find the NEAREST equivalent that I have" PRINT "in my set of tables - as well as telling you the exact" PRINT "probability of success of course - this is for later extension." ' INPUT SECTION ' ~~~~~~~~~~~~~ ON KEY(1) GOSUB Help ON KEY(2) GOSUB Info DO FOR ScreenLine = 10 TO 23 LOCATE ScreenLine, 50: PRINT STRING$(30, 32); NEXT ScreenLine Horse = Horse + 1 LOCATE 15, 34: PRINT " " LOCATE 16, 34: PRINT " " LOCATE 24, 1: PRINT STRING$(70, 32); LOCATE 18, 1: PRINT STRING$(40, 32) LOCATE 10, 10 PRINT "Horse #"; Horse: PRINT : PRINT : PRINT PRINT Horse; "'"; " ODDS" PRINT , " - Left of Colon :"; : INPUT "", LeftOdds PRINT , " - Right of Colon :"; : INPUT "", RightOdds Percentage! = (RightOdds / (LeftOdds + RightOdds)) * 100 LeftOdds$ = STR$(LeftOdds): RightOdds$ = STR$(RightOdds) OrigOdds$(Horse) = LeftOdds$ + " :" + RightOdds$ OrigPerc(Horse) = Percentage! LOCATE 24, 10 PRINT "Is there another horse "; LOCATE 24, 50: COLOR (Yellow): PRINT "F1"; COLOR (White): PRINT " : Help"; LOCATE 24, 60: COLOR (Yellow): PRINT "F2"; COLOR (White): PRINT " : Info "; DO Another$ = UCASE$(INKEY$) LOOP UNTIL Another$ <> "" LOOP UNTIL Another$ = "N" ' CALCULATIONS ' ~~~~~~~~~~~~ Calc: TotalOld = 0: TotalNew = 0 FOR Count = 1 TO Horse Percentage! = OrigPerc(Count) CALL NewFrame(WinnerMarket, Percentage!) FramePerc(Count) = Percentage! CALL WorkNewOdds(Percentage!, ProfitOdds$) FrameOdds$(Count) = ProfitOdds$ TotalOld = TotalOld + OrigPerc(Count) TotalNew = TotalNew + FramePerc(Count) NEXT Count FOR Count = 1 TO Horse ToBet(Count) = (UnitstoBet * FramePerc(Count)) / TotalNew NEXT Count ' SCREEN TABLE ' ~~~~~~~~~~~~ temp: CLS COLOR 14 LOCATE 1, 1: PRINT "Old Odds"; PRINT TAB(12); "Old %"; COLOR 10: PRINT TAB(21); CHR$(179); : COLOR 3 PRINT TAB(25); "New odds"; PRINT TAB(35); "New %"; PRINT TAB(45); "My Frame :"; WinnerMarket * 100; "%" COLOR 10: PRINT TAB(21); CHR$(179); : COLOR 3 COLOR 3 FOR Count = 1 TO Horse LOCATE 2 + Count, 1: PRINT OrigOdds$(Count); PRINT TAB(12); USING "##.##"; OrigPerc(Count); COLOR 10: PRINT TAB(21); CHR$(179); : COLOR 3 PRINT TAB(25); FrameOdds$(Count); PRINT TAB(35); USING "##.##"; FramePerc(Count); PRINT TAB(45); USING "##.##"; ToBet(Count); : PRINT " Units" NEXT Count COLOR 2 PRINT TAB(12); "~~~~~~~~~"; PRINT TAB(35); "~~~~~~~~~" COLOR 14 PRINT TAB(12); TotalOld; TAB(35); TotalNew LOCATE 20, 5: PRINT "New Market % (1-100 whole number) - (0 to end)" INPUT WinnerMarket: WinnerMarket = WinnerMarket / 100 IF WinnerMarket = 0 THEN GOTO TheEnd ELSE GOTO Calc END IF ' SUBROUTINES '~~~~~~~~~~~~~ Help: FOR ScreenLine = 10 TO 23 LOCATE ScreenLine, 50: PRINT STRING$(30, 32); NEXT ScreenLine LOCATE 10, 50: PRINT STRING$(29, 196) LOCATE 23, 50: PRINT STRING$(29, 196) LOCATE 10, 50: PRINT CHR$(218) LOCATE 10, 79: PRINT CHR$(191) LOCATE 23, 50: PRINT CHR$(192) LOCATE 23, 79: PRINT CHR$(217) FOR ScreenLine = 11 TO 22 LOCATE ScreenLine, 50: PRINT CHR$(179) LOCATE ScreenLine, 79: PRINT CHR$(179) NEXT ScreenLine LOCATE 12, 55: PRINT "Left of Colon - in the" LOCATE 13, 55: PRINT "case of 2:1 then 2" LOCATE 15, 55: PRINT "Right of Colon - in the" LOCATE 16, 55: PRINT "case of 2:1 then 1" LOCATE 18, 55: PRINT "Preprocess Odds-On types" LOCATE 19, 55: PRINT "ie 2:1 ON is really 1:2" RETURN Info: FOR ScreenLine = 10 TO 23 LOCATE ScreenLine, 50: PRINT STRING$(30, 32); NEXT ScreenLine LOCATE 10, 50: PRINT STRING$(29, 196) LOCATE 23, 50: PRINT STRING$(29, 196) LOCATE 10, 50: PRINT CHR$(218) LOCATE 10, 79: PRINT CHR$(191) LOCATE 23, 50: PRINT CHR$(192) LOCATE 23, 79: PRINT CHR$(217) FOR ScreenLine = 11 TO 22 LOCATE ScreenLine, 50: PRINT CHR$(179) LOCATE ScreenLine, 79: PRINT CHR$(179) NEXT ScreenLine LOCATE 12, 55: PRINT "(c) Keith Farrell 1991" LOCATE 13, 55: PRINT "" LOCATE 15, 55: PRINT "" LOCATE 16, 55: PRINT "" LOCATE 18, 55: PRINT "" LOCATE 19, 55: PRINT "" RETURN TheEnd: KEY(1) OFF KEY(2) OFF SUB NewFrame (WinnerMarket, Percentage!) Percentage! = Percentage! * WinnerMarket END SUB SUB WorkNewOdds (Percentage!, ProfitOdds$) ' table of odds according to `encyclopedia ' of gambling' by Peter Arnold, COLLINS books Accuracy = 10000 Percentage! = CLNG(Percentage! * Accuracy) / Accuracy ' The number of points of accuracy is ' tied in with those figures in the CASE ' statement. If you want to increase the ' amount of accuracy you will have to up- ' date the CASE expressions SELECT CASE Percentage! CASE .0001 TO .9901 ProfitOdds$ = "100-1" CASE .9902 TO 1.4925 ProfitOdds$ = " 66-1" CASE 1.4926 TO 1.9608 ProfitOdds$ = " 50-1" CASE 1.9609 TO 2.439 ProfitOdds$ = " 40-1" CASE 2.4391 TO 2.9412 ProfitOdds$ = " 33-1" CASE 2.9413 TO 3.4483 ProfitOdds$ = " 28-1" CASE 3.4484 TO 3.8462 ProfitOdds$ = " 25-1" CASE 3.8463 TO 4.3478 ProfitOdds$ = " 22-1" CASE 4.3479 TO 4.7619 ProfitOdds$ = " 20-1" CASE 4.762 TO 5.2632 ProfitOdds$ = " 18-1" CASE 5.2633 TO 5.8824 ProfitOdds$ = " 16-1" CASE 5.8825 TO 6.25 ProfitOdds$ = " 15-1" CASE 6.2501 TO 6.6667 ProfitOdds$ = " 14-1" CASE 6.6668 TO 7.1428 ProfitOdds$ = " 13-1" CASE 7.1429 TO 7.6923 ProfitOdds$ = " 12-1" CASE 7.6924 TO 8.3333 ProfitOdds$ = " 11-1" CASE 8.3334 TO 9.0909 ProfitOdds$ = " 10-1" CASE 9.091 TO 10! ProfitOdds$ = " 9-1" CASE 10.0001 TO 10.5263 ProfitOdds$ = " 17-2" CASE 10.5264 TO 11.1111 ProfitOdds$ = " 8-1" CASE 11.1112 TO 11.7647 ProfitOdds$ = " 15-2" CASE 11.7647 TO 12.5 ProfitOdds$ = " 7-1" CASE 12.501 TO 13.3333 ProfitOdds$ = " 13-2" CASE 13.3334 TO 14.2857 ProfitOdds$ = " 6-1" CASE 14.2858 TO 15.3846 ProfitOdds$ = " 11-2" CASE 15.3847 TO 16.6667 ProfitOdds$ = " 5-1" CASE 16.6668 TO 18.1818 ProfitOdds$ = " 9-2" CASE 18.1819 TO 20! ProfitOdds$ = " 4-1" CASE 20.0001 TO 22.2222 ProfitOdds$ = " 7-2" CASE 22.2223 TO 25! ProfitOdds$ = " 3-1" CASE 25.0001 TO 26.6667 ProfitOdds$ = " 11-4" CASE 26.6668 TO 28.5714 ProfitOdds$ = " 5-2" CASE 28.5715 TO 30.7692 ProfitOdds$ = " 9-4" CASE 30.7693 TO 33.3333 ProfitOdds$ = " 2-1" CASE 33.3334 TO 34.7826 ProfitOdds$ = " 15-8" CASE 34.7827 TO 36.3636 ProfitOdds$ = " 7-4" CASE 36.3637 TO 38.0952 ProfitOdds$ = " 13-8" CASE 38.0953 TO 40! ProfitOdds$ = " 6-4" CASE 40.0001 TO 42.1053 ProfitOdds$ = " 11-8" CASE 42.1053 TO 44.4444 ProfitOdds$ = " 5-4" CASE 44.4445 TO 45.4545 ProfitOdds$ = " 6-5" CASE 45.4546 TO 47.619 ProfitOdds$ = " 11-10" CASE 47.6191 TO 48.7805 ProfitOdds$ = " 21-20" CASE 487806 TO 50! ProfitOdds$ = " 1-1 Evens" CASE 50.0001 TO 51.2195 ProfitOdds$ = " 20-21" CASE 51.2196 TO 52.381 ProfitOdds$ = " 10-11" CASE 52.3811 TO 54.5455 ProfitOdds$ = " 5-6" CASE 54.5456 TO 55.5556 ProfitOdds$ = " 4-5" CASE 55.5557 TO 57.8947 ProfitOdds$ = " 8-11" CASE 57.8948 TO 60! ProfitOdds$ = " 4-6" CASE 60.0001 TO 61.9048 ProfitOdds$ = " 8-13" CASE 61.9049 TO 63.6364 ProfitOdds$ = " 4-7" CASE 63.6365 TO 66.6667 ProfitOdds$ = " 1-2" CASE 66.6668 TO 69.2308 ProfitOdds$ = " 4-9" CASE 69.2309 TO 71.4286 ProfitOdds$ = " 2-5" CASE 71.4287 TO 73.3333 ProfitOdds$ = " 4-11" CASE 73.3334 TO 75! ProfitOdds$ = " 1-3" CASE 75.0001 TO 76.9231 ProfitOdds$ = " 30-100" CASE 76.9232 TO 77.7778 ProfitOdds$ = " 2-7" CASE 77.7779 TO 80! ProfitOdds$ = " 1-4" CASE 80.0001 TO 81.8182 ProfitOdds$ = " 2-9" CASE 81.8183 TO 83.3333 ProfitOdds$ = " 1-5" CASE 83.3334 TO 85.7143 ProfitOdds$ = " 1-6" CASE 85.7144 TO 87.5 ProfitOdds$ = " 1-7" CASE 87.5001 TO 88.8889 ProfitOdds$ = " 1-8" CASE 88.881 TO 90.9091 ProfitOdds$ = " 1-10" CASE 90.9092 TO 95.2381 ProfitOdds$ = " 1-20" CASE 95.2382 TO 96.1538 ProfitOdds$ = " 1-25" CASE 96.1539 TO 97.0588 ProfitOdds$ = " 1-33" CASE 97.0589 TO 97.561 ProfitOdds$ = " 1-40" CASE 97.5611 TO 98.0392 ProfitOdds$ = " 1-50" CASE 98.0393 TO 99.0099 ProfitOdds$ = " 1-100" CASE ELSE ProfitOdds$ = "Not found" END SELECT END SUB