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