10 DEFFNS="Lotter7" 20 MODE7 30 VDU23;8202;0;0;0; 40 DIM N%(49) 50 DIM O%(49) 60 DIM P%(49) 70 PROCgetdat 80 ONERROR VDU3:CLOSE#F%:F%=0:IF ERR<>17:REPORT:PRINTERL:END 90 REPEAT 100 C%=T%/W% 110 CLS 120 PRINT'" The Ultimate Lottery Program." 130 PRINT"ƒ The Ultimate Lottery Program." 140 PRINT'"†By C.J.Richardson. For 8-Bit Software."' 150 PRINT"† Program Suggested And" 160 PRINT"† Data Entered By B.Thackeray D3D." 170 PRINT'TAB(13)"ƒ""A Bit Of Fun""" 180 PRINT'TAB(6)"ƒ";STR$(W%);"‚Weeks Of Data Entered." 190 PRINT'" …Average Total Overƒ";STR$(W%);"…Weeks Isƒ";STR$(C%) 200 PRINT'TAB(6)"„ƒ1. Enter Data œ" 210 PRINTTAB(6)"„ƒ2. Main Program œ" 220 PRINTTAB(6)"„ƒ3. Info œ" 230 PRINTTAB(6)"„ƒ4. Print Out/View Data œ" 240 PRINTTAB(6)"„ƒ5. End œ" 250 PRINT'TAB(11)"„ˆƒPress 1-5 œ" 260 PRINT'TAB(6)"„ƒESCAPE To Return Here œ" 270 *FX21 280 REPEAT 290 A$=GET$ 300 UNTILINSTR("12345",A$) 310 IF A$="1"PROCinput 320 IF A$="3"PROCinfo 330 IF A$="4"PROCprintout 340 IF A$="5":END 350 UNTILA$="2" 360 REPEAT 370 REPEAT 380 CLS 390 PROCdispnum 400 PROCdisporder 410 PRINT''"„ƒPress (S)uggested Numbers (P)rint œ"; 420 *FX21 430 REPEAT 440 A$=GET$ 450 IF INSTR("Pp",A$)PROCprint 460 UNTILINSTR("Ss",A$) 470 REPEAT 480 PROCsuggest 490 PRINT'"„ƒPress (S)tatistics (A)gain (P)rint œ"; 500 *FX21 510 REPEAT 520 A$=GET$ 530 IF INSTR("Pp",A$)PROCprint 540 UNTILINSTR("SsAa",A$) 550 UNTILINSTR("Ss",A$) 560 UNTILFALSE 570 END 580 DEFPROCgetdat 590 PRINTTAB(6,11);"Please Wait.ˆCalculating." 600 PRINTTAB(6,12);"ƒPlease Wait.ˆCalculating." 610 F%=OPENIN"UltDat" 620 W%=0 630 T%=0 640 REPEAT 650 W%=W%+1 660 FORL%=1TO7 670 A%=BGET#F% 680 IF L%<>7T%=T%+A% 690 N%(A%)=N%(A%)+1 700 NEXT 710 UNTILEOF#F% 720 CLOSE#F%:F%=0 730 FORL%=1TO49 740 O%(L%)=N%(L%) 750 NEXT 760 FORL%=49 TO 1 STEP-1 770 Q%=0 780 FORI%=1TO49 790 IF O%(I%)>Q%:Q%=O%(I%):R%=I% 800 NEXT 810 P%(L%)=R% 820 O%(R%)=0 830 NEXT 840 ENDPROC 850 DEFPROCinput 860 *FX200,1 870 F%=OPENUP"UltDat" 880 PTR#F%=EXT#F% 890 REPEAT 900 FORL%=1TO49 910 O%(L%)=0 920 NEXT 930 W%=W%+1 940 CLS 950 FORL%=1 TO 7 960 REPEAT 970 REPEAT 980 IF L%<>7 PRINT"‚Enter Week…";STR$(W%);"‚Lottery Numberƒ";STR$(L%) ELSE PRINT"‚Enter Week…";STR$(W%);"‚Bonus Number " 990 INPUT A% 1000 PRINT"†Correct Y/N?" 1010 REPEAT 1020 A$=GET$ 1030 UNTILINSTR("YyNn",A$) 1040 UNTILINSTR("Yy",A$) AND A%>0 AND A%<50 1050 UNTILO%(A%)=0 1060 O%(A%)=1 1070 BPUT#F%,A% 1080 NEXT 1090 REPEAT 1100 PRINT"…Another Week? Y/N" 1110 A$=GET$ 1120 UNTILINSTR("YyNn",A$) 1130 CLS 1140 UNTILINSTR("Nn",A$) 1150 FORL%=1TO49 1160 N%(L%)=0 1170 NEXT 1180 CLOSE#F%:F%=0 1190 PROCgetdat 1200 *FX200 1210 ENDPROC 1220 DEFPROCdispnum 1230 PRINT"„ƒLottery Numbers. Total Appearances. œ" 1240 X%=0 1250 Y%=2 1260 FORI%=1TO49 1270 IF X%=0 VDU31,X%,Y%,134,31,X%,Y%+1,130:X%=X%+1 1280 VDU31,X%,Y% 1290 PRINTSTR$(I%); 1300 VDU31,X%,Y%+1 1310 PRINTSTR$(N%(I%)); 1320 X%=X%+4 1330 IF X%=41 X%=0:Y%=Y%+3:VDU31,X%,Y%,64 1340 NEXT 1350 ENDPROC 1360 DEFPROCdisporder 1370 PRINT''"„ƒOrder Of Appearance. Least First. œ"' 1380 VDU131 1390 FORL%=1TO49 1400 PRINTSTR$(P%(L%)); 1410 IF L%MOD13=0 PRINT:VDU131 ELSE PRINT" "; 1420 NEXT 1430 ENDPROC 1440 DEFPROCsuggest 1450 CLS 1460 PRINT'"„ƒSuggested Lottery Numbers: œ" 1470 PRINT'"ƒAverage Total Over…";STR$(W%);"ƒWeeks Is…";STR$(C%)' 1480 PRINT"‚Number Of …Line† Away From" 1490 PRINT"‚Random Numbers …Total† Average"' 1500 FORL%=6TO0 STEP-1 1510 S%=0 1520 VDU130 1530 FORI%=1TO49 1540 O%(I%)=0 1550 NEXT 1560 PRINTSTR$(6-L%); 1570 PRINT":"; 1580 IF L%<>0PRINT"ƒ"; 1590 FORZ%=0TOL% 1600 IF Z%<>0 PRINTSTRING$(2-LEN(STR$(P%(Z%))),"0")+STR$(P%(Z%));:IF Z%<>L% PRINT" "; ELSE IF Z%=L% PRINT"‚"; 1610 O%(Z%)=1 1620 S%=S%+P%(Z%) 1630 NEXT 1640 IF L%=6 PROCstats:PRINT:NEXT 1650 FORZ%=L%+1TO6 1660 REPEAT 1670 U%=RND(-TIME) 1680 U%=RND(48)+1 1690 UNTILO%(U%)<>1 1700 PRINTSTRING$(2-LEN(STR$(P%(U%))),"0")+STR$(P%(U%));" "; 1710 O%(U%)=1 1720 S%=S%+P%(U%) 1730 NEXT 1740 PROCstats 1750 PRINT 1760 NEXT 1770 ENDPROC 1780 DEFPROCstats 1790 PRINT TAB(23)"…";STR$(S%);TAB(31)"†";STR$ABS(C%-S%) 1800 ENDPROC 1810 DEFPROCprint 1820 FORL%=0TO22 1830 FORI%=0TO39 1840 V%=?(&7C00+(L%*40)+I%) 1850 IF V%<32 OR V%>126 V%=32 1860 VDU2,1,V%,3 1870 NEXT 1880 VDU2,1,13,3 1890 NEXT 1900 ENDPROC 1910 DEFPROCinfo 1920 CLS 1930 PRINT"ƒPRESS SHIFT TO SCROLL THE TEXT." 1940 PRINT 1950 VDU14 1960 PRINT"‚This program will allow you to input" 1970 PRINT"‚the 7 numbers from the lottery" 1980 PRINT"‚each week and choose some numbers" 1990 PRINT"‚using previous numbers. All the" 2000 PRINT"‚numbers that have appeared up to the" 2010 PRINT"‚writing of this program are already" 2020 PRINT"‚entered into the data file ULTDAT." 2030 PRINT 2040 PRINT"ƒThe program is very simple to operate." 2050 PRINT"ƒEntering data requires that you have" 2060 PRINT"ƒthe disc with ULTDAT in the drive. IF" 2070 PRINT"ƒYOU ARE USING DFS, IT IS IMPORTANT" 2080 PRINT"ƒTHAT THIS FILE HAS ROOM TO BE ADDED" 2090 PRINT"ƒTO. Do this by saving this program" 2100 PRINT"ƒ(Lotter7) to a freshly formatted disc" 2110 PRINT"ƒand then copying the datafile ULTDAT" 2120 PRINT"ƒonto the disc. Enter all 6 numbers" 2130 PRINT"ƒplus the bonus number for each week." 2140 PRINT 2150 PRINT"‚The first thing you will see when" 2160 PRINT"‚choosing the second option is a list" 2170 PRINT"‚of the numbers 1 to 49 with, directly" 2180 PRINT"‚below, the number of times that this" 2190 PRINT"‚has appeared. Underneath this list is" 2200 PRINT"‚a list of the numbers 1 to 49 in the" 2210 PRINT"‚order that they have appeared, least" 2220 PRINT"‚first." 2230 PRINT 2240 PRINT"ƒPress P to print out this data. Press" 2250 PRINT"ƒS to view the suggested numbers. This" 2260 PRINT"ƒdisplays 5 rows of numbers. The first" 2270 PRINT"ƒrow consists of 6 numbers chosen" 2280 PRINT"ƒbecause they have not appeared as many" 2290 PRINT"ƒtimes as other numbers. The second row" 2300 PRINT"ƒis made up of 5 numbers chosen in the" 2310 PRINT"ƒabove manner and one chosen at random." 2320 PRINT"ƒWith each progressive row more numbers" 2330 PRINT"ƒare chosen at random until the last row"; 2340 PRINT"ƒwhen all numbers are randomly chosen." 2350 PRINT 2360 PRINT"‚Press P to print the screen. Press A" 2370 PRINT"‚to re-display the screen with fresh" 2380 PRINT"‚random numbers. Press S to go back to" 2390 PRINT"‚the statistics screen." 2400 PRINT 2410 PRINT"ƒRandom numbers are green. Directly" 2420 PRINT"ƒafter the suggested numbers are two" 2430 PRINT"ƒcolumns of numbers. The first column" 2440 PRINT"ƒis the total of the row of numbers." 2450 PRINT"ƒThe second column is the difference" 2460 PRINT"ƒbetween the first column number and" 2470 PRINT"ƒthe average total for all the previous" 2480 PRINT"ƒdata. This is the 'secret' of the" 2490 PRINT"ƒprogram. Press A until the figure in" 2500 PRINT"ƒthe last column is 0." 2510 PRINT 2520 PRINT"‚PRESS A KEY" 2530 PRINT 2540 VDU15 2550 *FX21 2560 REPEATUNTILGET 2570 ENDPROC 2580 DEFPROCprintout 2590 F%=OPENIN"UltDat" 2600 CLS:PRINT'"To Printer Y/N?"' 2610 *FX21 2620 REPEAT 2630 A$=GET$ 2640 UNTILINSTR("YyNn",A$) 2650 IF INSTR("Yy",A$) VDU2 ELSE PRINT"Press SHIFT To Scroll Numbers"':VDU14 2660 A%=1 2670 REPEAT 2680 PRINT"Week ";STR$(A%);TAB(9); 2690 FORL%=1 TO 6 2700 B%=BGET#F% 2710 PRINTSTRING$(2-LEN(STR$(B%)),"0")+STR$(B%);:IF L%<>6PRINT","; 2720 NEXT 2730 B%=BGET#F% 2740 PRINTTAB(28)" Bonus ";STRING$(2-LEN(STR$(B%)),"0")+STR$(B%) 2750 A%=A%+1 2760 UNTILEOF#F% 2770 CLOSE#F%:F%=0 2780 VDU3,15 2790 *FX21 2800 PRINT'"Press A Key" 2810 REPEATUNTILGET 2820 ENDPROC 2830 [0x08] [0x08] [0x08] [0x08] I really have no idea why I write these lottery programs as I am against the lottery by principle. I think that the popularity of the lottery is a sad reflection of the quite sick world that we live in when 1/4 of the world 2840 [0x08] [0x08] [0x08] [0x08] starves and people such as us waste money on "a bit of fun" such as the lottery. 2850 [0x08] [0x08] [0x08] [0x08] It amuses me slightly when I hear the treasury has miscalculated the effect that it would have on the economy (people wasting money and lining a few already rich peoples pockets instead of spending it on cheap tat in the market 2860 [0x08] [0x08] [0x08] [0x08] place). Also, the government takes only 12% of the money instead of the 17.5% they were taking on it when people spent it on tat. I would much sooner give my pennies directly to my chosen charity. I reckon they should have 2870 [0x08] [0x08] [0x08] [0x08] given the contract to Richard Branson of Branson Pickles. Great with a salad. Having said all that, I am in a syndicate at work forking out ten bob a week. I did not want to, but decided (what a whimp) that there would be far less 2880 [0x08] [0x08] [0x08] [0x08] hassle from workmates if I was "in". A previous (aborted) attempt at a pools syndicate at work that I refused to join taught me. Comments such as "When we win you will want some of it" and various other related pathetic ramblings 2890 [0x08] [0x08] [0x08] [0x08] do get to you in the end no matter how thick you are (thick skinned?). Oooh, look at me now. Look at the time. Must dash.