10REM: LOONEY-SCROLL VERSION-UP-DATED
20*KEY6 CHAIN"LOONEY"|M
30*KEY7 VDU14|M SAVE"LOONEY"|M LISTO
7|M LIST|M
40*KEY8 RUN|M
50*KEY9 MODE135|M|N *FX4|M *FX200|M L
ISTO 7|M LIST|M
60*FX15,0
70REM: b%=Number (1 TO 49) picked
time
80REM: d%=No. of times computer has
picked a number
90REM: e%=No. of numbers between 1
and 49 still to be picked
100REM: T%=TIME
110:
120:
1000REM: ***
1010MODE135:CLS:VDU23;8202;0;0;0;
1020ON ERROR PROCerror
1030PROCtitle1:PROCintro
1040CLS:PROCchoice:PROCspeed
1050b%=0:d%=0:e%=49
1060IF choice%=1 THEN PROCtitle2
1070IF choice%=2 THEN PROCtitle3
1080IF choice%=3 THEN PROCtitle4
1090PROCstrings
1100PROCpicking
1110T%=TIME:REPEAT
1120PROCnumthistime
1130PROCtimetaken
1140PROCnumsleft
1150IF choice%=1 AND e%=6 THEN PRINTTAB
(11,23)" Press any key ":A=GET:GOTO1040
1160IF choice%=2 AND e%=8 THEN PRINTTAB
(11,23)" Press any key ":A=GET:GOTO1040
1170IF choice%=3 AND e%=10 THEN PRINTTA
B(11,23)" Press any key ":A=GET:GOTO104
0
1180PROCmainprog
1190UNTIL FALSE
1200GOTO1040
1210END
1220:
1230:
2000REM: ***
2010DEFPROCmainprog
2020t%=t%+1
2030IF b%=1 AND f1%=1 PRINTTAB(1,4)" "
TAB(1,5)" ":e%=e%-1:f1%=2
2040IF b%=2 AND f2%=1 PRINTTAB(5,4)" "
TAB(5,5)" ":e%=e%-1:f2%=2
2050IF b%=3 AND f3%=1 PRINTTAB(9,4)" "
TAB(9,5)" ":e%=e%-1:f3%=2
2060IF b%=4 AND f4%=1 PRINTTAB(13,4)"
" TAB(13,5)" ":e%=e%-1:f4%=2
2070IF b%=5 AND f5%=1 PRINTTAB(17,4)"
" TAB(17,5)" ":e%=e%-1:f5%=2
2080IF b%=6 AND f6%=1 PRINTTAB(21,4)"
" TAB(21,5)" ":e%=e%-1:f6%=2
2090IF b%=7 AND f7%=1 PRINTTAB(25,4)"
" TAB(25,5)" ":e%=e%-1:f7%=2
2100IF b%=8 AND f8%=1 PRINTTAB(29,4)"
" TAB(29,5)" ":e%=e%-1:f8%=2
2110IF b%=9 AND f9%=1 PRINTTAB(32,4)"
" TAB(32,5)" ":e%=e%-1:f9%=2
2120IF b%=10 AND f10%=1 PRINTTAB(36,4)"
" TAB(36,5)" ":e%=e%-1:f10%=2
2130IF b%=11 AND f11%=1 PRINTTAB(1,6)"
" TAB(1,7)" ":e%=e%-1:f11%=2
2140IF b%=12 AND f12%=1 PRINTTAB(4,6)"
" TAB(4,7)" ":e%=e%-1:f12%=2
2150IF b%=13 AND f13%=1 PRINTTAB(8,6)"
" TAB(8,7)" ":e%=e%-1:f13%=2
2160IF b%=14 AND f14%=1 PRINTTAB(12,6)"
" TAB(12,7)" ":e%=e%-1:f14%=2
2170IF b%=15 AND f15%=1 PRINTTAB(16,6)"
" TAB(16,7)" ":e%=e%-1:f15%=2
2180IF b%=16 AND f16%=1 PRINTTAB(20,6)"
" TAB(20,7)" ":e%=e%-1:f16%=2
2190IF b%=17 AND f17%=1 PRINTTAB(24,6)"
" TAB(24,7)" ":e%=e%-1:f17%=2
2200IF b%=18 AND f18%=1 PRINTTAB(28,6)"
" TAB(28,7)" ":e%=e%-1:f18%=2
2210IF b%=19 AND f19%=1 PRINTTAB(32,6)"
" TAB(32,7)" ":e%=e%-1:f19%=2
2220IF b%=20 AND f20%=1 PRINTTAB(36,6)"
" TAB(36,7)" ":e%=e%-1:f20%=2
2230IF b%=21 AND f21%=1 PRINTTAB(1,8)"
" TAB(1,9)" ":e%=e%-1:f21%=2
2240IF b%=22 AND f22%=1 PRINTTAB(4,8)"
" TAB(4,9)" ":e%=e%-1:f22%=2
2250IF b%=23 AND f23%=1 PRINTTAB(8,8)"
" TAB(8,9)" ":e%=e%-1:f23%=2
2260IF b%=24 AND f24%=1 PRINTTAB(12,8)"
" TAB(12,9)" ":e%=e%-1:f24%=2
2270IF b%=25 AND f25%=1 PRINTTAB(16,8)"
" TAB(16,9)" ":e%=e%-1:f25%=2
2280IF b%=26 AND f26%=1 PRINTTAB(20,8)"
" TAB(20,9)" ":e%=e%-1:f26%=2
2290IF b%=27 AND f27%=1 PRINTTAB(24,8)"
" TAB(24,9)" ":e%=e%-1:f27%=2
2300IF b%=28 AND f28%=1 PRINTTAB(28,8)"
" TAB(28,9)" ":e%=e%-1:f28%=2
2310IF b%=29 AND f29%=1 PRINTTAB(32,8)"
" TAB(32,9)" ":e%=e%-1:f29%=2
2320IF b%=30 AND f30%=1 PRINTTAB(36,8)"
" TAB(36,9)" ":e%=e%-1:f30%=2
2330IF b%=31 AND f31%=1 PRINTTAB(1,10)"
" TAB(1,11)" ":e%=e%-1:f31%=2
2340IF b%=32 AND f32%=1 PRINTTAB(4,10)"
" TAB(4,11)" ":e%=e%-1:f32%=2
2350IF b%=33 AND f33%=1 PRINTTAB(8,10)"
" TAB(8,11)" ":e%=e%-1:f33%=2
2360IF b%=34 AND f34%=1 PRINTTAB(12,10)
" " TAB(12,11)" ":e%=e%-1:f34%=2
2370IF b%=35 AND f35%=1 PRINTTAB(16,10)
" " TAB(16,11)" ":e%=e%-1:f35%=2
2380IF b%=36 AND f36%=1 PRINTTAB(20,10)
" " TAB(20,11)" ":e%=e%-1:f36%=2
2390IF b%=37 AND f37%=1 PRINTTAB(24,10)
" " TAB(24,11)" ":e%=e%-1:f37%=2
2400IF b%=38 AND f38%=1 PRINTTAB(28,10)
" " TAB(28,11)" ":e%=e%-1:f38%=2
2410IF b%=39 AND f39%=1 PRINTTAB(32,10)
" " TAB(32,11)" ":e%=e%-1:f39%=2
2420IF b%=40 AND f40%=1 PRINTTAB(36,10)
" " TAB(36,11)" ":e%=e%-1:f40%=2
2430IF b%=41 AND f41%=1 PRINTTAB(1,12)"
" TAB(1,13)" ":e%=e%-1:f41%=2
2440IF b%=42 AND f42%=1 PRINTTAB(4,12)"
" TAB(4,13)" ":e%=e%-1:f42%=2
2450IF b%=43 AND f43%=1 PRINTTAB(8,12)"
" TAB(8,13)" ":e%=e%-1:f43%=2
2460IF b%=44 AND f44%=1 PRINTTAB(12,12)
" " TAB(12,13)" ":e%=e%-1:f44%=2
2470IF b%=45 AND f45%=1 PRINTTAB(16,12)
" " TAB(16,13)" ":e%=e%-1:f45%=2
2480IF b%=46 AND f46%=1 PRINTTAB(20,12)
" " TAB(20,13)" ":e%=e%-1:f46%=2
2490IF b%=47 AND f47%=1 PRINTTAB(24,12)
" " TAB(24,13)" ":e%=e%-1:f47%=2
2500IF b%=48 AND f48%=1 PRINTTAB(28,12)
" " TAB(28,13)" ":e%=e%-1:f48%=2
2510IF b%=49 AND f49%=1 PRINTTAB(33,12)
" " TAB(33,13)" ":e%=e%-1:f49%=2
2520IF speed%=1 PROCnumthistime
2530IF speed%=2 THEN FOR X=1 TO 2000:NE
XT X:PROCnumthistime
2540IF speed%=3 PRINTTAB(11,23)" Press
any key ":A=GET:PROCnumthistime
2550IF speed%=3 PRINTTAB(11,23)" Press
any key ":PRINTTAB(0,22)SPC(40):A=GET:P
ROCnumthistime
2560ENDPROC
2570:
2580:
3000REM: ***
3010DEFPROCstrings
3020PRINTTAB(2,3)CHR$131CHR$157CHR$129"
These numbers not yet picked:- "CHR$156
3030a1$="01 02 03 04 05 06 07 08
09 10":a2$="11 12 13 14 15 16 1
7 18 19 20":a3$="21 22 23 24 25
26 27 28 29 30":a4$="31 32 33 34
35 36 37 38 39 40":a5$="41 42 43
44 45 46 47 48 49"
3040PRINTTAB(0,4)CHR$141;a1$ TAB(0,5)CH
R$141;a1$TAB(0,6)CHR$141;a2$ TAB(0,7)CHR
$141;a2$ TAB(0,8)CHR$141;a3$ TAB(0,9)CHR
$141;a3$ TAB(0,10)CHR$141;a4$ TAB(0,11)C
HR$141;a4$ TAB(0,12)CHR$141;a5$ TAB(0,13
)CHR$141;a5$
3050f1%=1:f2%=1:f3%=1:f4%=1:f5%=1:f6%=1
:f7%=1:f8%=1:f9%=1:f10%=1:f11%=1:f12%=1:
f13%=1:f14%=1:f15%=1:f16%=1:f16%=1:f17%=
1:f18%=1:f19%=1:f20%=1:f21%=1:f22%=1:f23
%=1:f24%=1:f25%=1:f26%=1:f27%=1:f28%=1:f
29%=1:f30%=1:f31%=1:f32%=1:f33%=1
3060f34%=1:f35%=1:f36%=1:f37%=1:f38%=1:
f39%=1:f40%=1:f41%=1:f42%=1:f43%=1:f44%=
1:f45%=1:f46%=1:f47%=1:f48%=1:f49%=1
3070ENDPROC
3080:
3090:
4000REM: ***
4010DEFPROCspeed:CLS
4020IF choice%=1 PROCtitle2
4030IF choice%=2 PROCtitle3
4040IF choice%=3 PROCtitle4
4050PRINTTAB(0,4)CHR$141"Press 1 for NO
RMAL Computer speed - "TAB(0)CHR$141"Pre
ss 1 for NORMAL Computer speed - "
4060PRINTTAB(12)CHR$141"(FAST !)"TAB(12
)CHR$141"(FAST !)"''
4070PRINTTAB(0)CHR$141"Press 2 for MEDI
UM speed"TAB(0)CHR$141"Press 2 for MEDIU
M speed"''
4080PRINTTAB(0)CHR$141"Press 3 for SLOW
MOTION (The Computer"TAB(0)CHR$141"Pres
s 3 for SLOW MOTION (The Computer"
4090PRINTTAB(0)CHR$141"waits for you to
press a key for a new"TAB(0)CHR$141"wai
ts for you to press a key for a new"
4100PRINTTAB(0)CHR$141"number.)"TAB(0)C
HR$141"number.)"'
4110PRINTTAB(10)CHR$141" PRESS 1, 2 or
3"TAB(10)CHR$141" PRESS 1, 2 or 3":A=GET
4120IF A=49 THEN speed%=1
4130IF A=50 THEN speed%=2
4140IF A=51 THEN speed%=3
4150CLS:ENDPROC
4160:
4170:
5000REM: ***
5010DEFPROCchoice
5020PROCtitle1
5030PRINTTAB(0,5)CHR$141"Press 1 for LO
TTERY numbers Program"TAB(0)CHR$141"Pres
s 1 for LOTTERY numbers Program"'
5040PRINTTAB(0)CHR$141"Press 2 for POOL
S numbers Program to"TAB(0)CHR$141"Press
2 for POOLS numbers Program to"
5050PRINTTAB(0)CHR$141"pick 8 numbers"T
AB(0)CHR$141"pick 8 numbers"'
5060PRINTTAB(0)CHR$141"Press 3 for POOL
S numbers Program to"TAB(0)CHR$141"Press
3 for POOLS numbers Program to"
5070PRINTTAB(0)CHR$141"pick 10 numbers
for an 8 from 10 perm"TAB(0)CHR$141"pick
10 numbers for an 8 from 10 perm"'
5080PRINTTAB(0)CHR$141"Press 4 to QUIT
the Program"TAB(0)CHR$141"Press 4 to QUI
T the Program"'
5090PRINTTAB(7)CHR$141CHR$131CHR$157CHR
$132"Press 1, 2, 3 or 4 "CHR$156:PRINTT
AB(7)CHR$141CHR$131CHR$157CHR$132"Press
1, 2, 3 or 4 "CHR$156
5100A=GET
5110IF A=49 choice%=1:CLS:ENDPROC
5120IF A=50 choice%=2:CLS:ENDPROC
5130IF A=51 choice%=3:CLS:ENDPROC
5140IF A=52 choice%=4:CLS
5150IF A=52 PRINTTAB(3,10)CHR$141" O.K.
GOODBYE. I HOPE YOU WIN!"TAB(3,11)CHR$1
41" O.K. GOODBYE. I HOPE YOU WIN!":FOR X
=1 TO 4000:NEXT X:CHAIN"UTILITY2"
5160ENDPROC
5170:
5180:
6000REM: ***
6010DEFPROCintro
6020PRINTTAB(4,4)" I have often heard p
eople say -"''" 'My numbers never se
em to come"'" up on the Lottery/P
ools'"'
6030PRINTTAB(4)"It has prompted me to c
arry out"'"this programming exercise."'
6040PRINTTAB(4)"The result does NOT gua
rantee a win"'"but it is just as random
as using the"'"proverbial pin - and stan
ds just as "'"much chance of giving a wi
nning line!"'
6050PRINTTAB(4)"(Obviously, there are e
asier ways "'"of picking 6, 8 or 10 numb
ers from 49,"'"but I would not have had
the fun (?) of"'"making this Program!!!)
"'
6060PRINTTAB(10,22)CHR$141" PRESS ANY
KEY"TAB(10,23)CHR$141" PRESS ANY KEY":A
=GET:CLS
6070PROCtitle1
6080PRINTTAB(1,4)"First you will be ask
ed if you want"'"the Program for the LOT
TERY or for the"'" POOLS and then the sp
eed at which you"'"want the Program TO R
UN."'
6090PRINTTAB(1)"The Computer will pick
(at random):-"''" 43 out of 49 numbers
for the LOTTERY"'" Program, OR"
6100PRINTTAB(2)" 41 out of 49 numbers (
for a single"'" line POOLS entry) OR"
6110PRINTTAB(2)" 39 out of 49 numbers (
for an 8 from"'" 10 POOLS perm)"'
6120PRINTTAB(0)" leaving 6, 8 or 10 num
bers NOT picked"'
6130PRINTTAB(0)CHR$135CHR$157CHR$129" T
HOSE 6, 8 or 10 NUMBERS ARE THE "CHR$15
6
6140PRINTTAB(0)CHR$135CHR$157CHR$129"
RANDOM NUMBERS FOR YOUR ENTRY "CHR$15
6
6150PRINTTAB(10,23)" PRESS ANY KEY":A=
GET:CLS:ENDPROC
6160ENDPROC
6170:
6180:
7000REM: ***
7010DEFPROCtitle1
7020PRINTTAB(4,0)CHR$141CHR$131CHR$157C
HR$132"LOONEY NUMBERS SELECTOR "CHR$156
:PRINTTAB(4)CHR$141CHR$131CHR$157CHR$132
"LOONEY NUMBERS SELECTOR "CHR$156:ENDPR
OC
7030:
7040:
7050REM: ***
7060DEFPROCtitle2
7070PRINTTAB(5,0)CHR$141CHR$132CHR$157C
HR$131"LOONEY LOTTERY NUMBERS "CHR$156:
PRINTTAB(5)CHR$141CHR$132CHR$157CHR$131"
LOONEY LOTTERY NUMBERS "CHR$156:ENDPROC
7080:
7090:
7100REM: ***
7110DEFPROCtitle3
7120PRINTTAB(6,0)CHR$141CHR$132CHR$157C
HR$134"LOONEY POOLS NUMBERS "CHR$156:PR
INTTAB(6)CHR$141CHR$132CHR$157CHR$134"LO
ONEY POOLS NUMBERS "CHR$156:PRINTTAB(7)
CHR$132CHR$157CHR$134"(For one-line entr
y) "CHR$156:ENDPROC
7130:
7140:
7150REM: ***
7160DEFPROCtitle4
7170PRINTTAB(6,0)CHR$141CHR$132CHR$157C
HR$135"LOONEY POOLS NUMBERS "CHR$156:PR
INTTAB(6)CHR$141CHR$132CHR$157CHR$135"LO
ONEY POOLS NUMBERS "CHR$156:PRINTTAB(7)
CHR$132CHR$157CHR$135"(For 8 from 10 Per
m) "CHR$156:ENDPROC
7180:
7190:
8000REM: ***
8010DEFPROCpicking
8020IF choice%=1 PRINTTAB(0,15)CHR$135C
HR$157CHR$132" Computer is picking 43
random "CHR$156TAB(0,16)CHR$135CHR
$157CHR$132" numbers between 1 and 4
9. "CHR$156
8030IF choice%=2 PRINTTAB(0,15)CHR$135C
HR$157CHR$132" Computer is picking 41
random "CHR$156TAB(0,16)CHR$135CHR
$157CHR$132" numbers between 1 and 4
9. "CHR$156
8040IF choice%=3 PRINTTAB(0,15)CHR$135C
HR$157CHR$132" Computer is picking 39
random "CHR$156TAB(0,16)CHR$135CHR
$157CHR$132" numbers between 1 and 4
9. "CHR$156
8050ENDPROC
8060:
8070:
9000REM: ***
9010DEFPROCnumthistime
9020b%=RND(49)
9030IF b%<10 PRINTTAB(0,18)" Number pic
ked this time = ";b%;" "
9040IF b%>9 PRINTTAB(0,18)" Number pick
ed this time = ";b%;" "
9050IF d%<10 PRINTTAB(0,19)" Total numb
ers picked (including"'" those picked mo
re than once) = ";d%
9060IF d%>9 PRINTTAB(0,19)" Total numbe
rs picked (including"'" those picked mor
e than once) = ";d%
9070IF e%<10 PRINTTAB(0,21)" Numbers le
ft (out of 49) = ";e%;" "
9080IF e%>9 PRINTTAB(0,21)" Numbers lef
t (out of 49) = ";e%;" "
9090d%=d%+1
9100ENDPROC
9110:
9120:
10000REM: ***
10010DEFPROCtimetaken
10020IF choice%=1 AND speed%=1 PRINTTAB(
1,22)"Time to pick 43 numbers = ";INT((T
IME-T%)/100);" seconds"
10030IF choice%=1 AND speed%=2 PRINTTAB(
1,22)"Time to pick 43 numbers = ";INT((T
IME-T%)/100);" seconds"
10040IF choice%=1 AND speed%=3 PRINTTAB(
0,22)SPC(40)
10050IF choice%=2 AND speed%=1 PRINTTAB(
1,22)"Time to pick 41 numbers = ";INT((T
IME-T%)/100);" seconds"
10060IF choice%=2 AND speed%=2 PRINTTAB(
1,22)"Time to pick 41 numbers = ";INT((T
IME-T%)/100);" seconds"
10070IF choice%=2 AND speed%=3 PRINTTAB(
0,22)SPC(40)
10080IF choice%=3 AND speed%=1 PRINTTAB(
1,22)"Time to pick 39 numbers = ";INT((T
IME-T%)/100);" seconds"
10090IF choice%=3 AND speed%=2 PRINTTAB(
1,22)"Time to pick 39 numbers = ";INT((T
IME-T%)/100);" seconds"
10100IF choice%=3 AND speed%=3 PRINTTAB(
0,22)SPC(40)
10110ENDPROC
10120:
10130:
11000REM: ***
11010DEFPROCnumsleft
11020IF choice%=1 AND e%=6 PRINTTAB(0,3)
SPC(40)TAB(0,18)SPC(40)TAB(5,3)CHR$135CH
R$157CHR$132"Numbers NOT picked are:- "
CHR$156
11030IF choice%=2 AND e%=6 PRINTTAB(0,3)
SPC(40)TAB(0,18)SPC(40)TAB(5,3)CHR$135CH
R$157CHR$132"Numbers NOT picked are:- "
CHR$156
11040IF choice%=2 AND e%=8 PRINTTAB(0,3)
SPC(40)TAB(0,18)SPC(40)TAB(5,3)CHR$135CH
R$157CHR$132"Numbers NOT picked are:- "
CHR$156
11050IF choice%=3 AND e%=10 PRINTTAB(0,3
)SPC(40)TAB(0,18)SPC(40)TAB(5,3)CHR$135C
HR$157CHR$132"Numbers NOT picked are:-
"CHR$156
11060IF choice%=1 AND e%=6 PRINTTAB(0,14
)SPC(40)TAB(0,14)CHR$131CHR$157CHR$132"T
he 6 numbers left are the numbers "C
HR$156:PRINTTAB(0,15)CHR$131CHR$157CHR$1
32" NOT PICKED BY THE COMPUTER
"CHR$156
11070IF choice%=2 AND e%=8 PRINTTAB(0,14
)SPC(40)TAB(0,14)CHR$131CHR$157CHR$132"T
he 8 numbers left are the numbers "CHR
$156:PRINTTAB(0,15)CHR$131CHR$157CHR$132
" NOT PICKED BY THE COMPUTER "C
HR$156
11080IF choice%=3 AND e%=10 PRINTTAB(0,1
4)SPC(40)TAB(0,14)CHR$131CHR$157CHR$132"
The 10 numbers left are the numbers "C
HR$156:PRINTTAB(0,15)CHR$131CHR$157CHR$1
32" NOT PICKED BY THE COMPUTER
"CHR$156
11090IF choice%=1 AND e%=6 PRINTTAB(0,16
)CHR$131CHR$157CHR$132" THEY ARE YOUR
LOONEY LOTTERY "CHR$156:PRINTTAB(0,
17)CHR$131CHR$157CHR$132" NUMBERS
GOOD LUCK!!"
11100IF choice%=2 AND e%=8 PRINTTAB(0,16
)CHR$131CHR$157CHR$132" THEY ARE YOUR LO
ONEY NUMBERS FOR "CHR$156:PRINTTA
B(0,17)CHR$131CHR$157CHR$132" YOUR POOL
S ENTRY GOOD LUCK!! "
11110IF choice%=3 AND e%=10 PRINTTAB(0,1
6)CHR$131CHR$157CHR$132" THEY ARE YOUR L
OONEY NUMBERS FOR "CHR$156:PRINTT
AB(0,17)CHR$131CHR$157CHR$132" YOUR POO
LS ENTRY GOOD LUCK!! "
11120ENDPROC
11130:
11140:
12000REM: ***
12010DEFPROCerror
12020IF -113 THEN STOP
12030CLS:REPORT:PRINT" at line ";ERL
12040ENDPROC
12050END