Here I've checked this code, it should work:
randomize timer()
Dim lotterynum(52,5)
lotterynum(1,1)=rnd(48)+1
lotterynum(1,2)=rnd(48)+1
lotterynum(1,3)=rnd(48)+1
lotterynum(1,4)=rnd(48)+1
lotterynum(1,5)=rnd(48)+1
money=100
oldmoney=money
gosub main
main:
cls
do
wait 1000
gosub startscreen
gosub txt1
wait key
cls
gosub lotterynumbers
gosub check
gosub theend
loop
return
startscreen:
text 0,0,"welcome to the national lottery"
text 10,300,"we are now going to ask you to input five lottery numbers"
set cursor 0,20
input "number1>", a
input "number2>", b
input "number3>", c
input "number4>", d
input "number5>", e
cls
dim playernum(52,5)
playernum(1,1)=a
playernum(1,2)=b
playernum(1,3)=c
playernum(1,4)=d
playernum(1,5)=e
return
txt1:
text 10,20,"Press spacebar to veiw the lottery numbers"
return
lotterynumbers:
set cursor 10,20
print "Lottery numbers!"
for t = 1 to 5
print lotterynum(1,t)
next t
set cursor 10,250
print "your numbers!"
for g = 1 to 5
print playernum(1,g)
next g
wait key
return
check:
for check = 1 to 5
for check2 = 1 to 5
if lotterynum(1,check2) = playernum(1,check) then money = money + 1
next check
next check2
print "You got " + str$(money - oldmoney) + " correct!"
if oldmoney = money then money = money - 1
print "your balance is ", money
return
clearscreen:
cls
return
theend:
wait key
print "Press x to quit or Enter to try again!"
do
if inkey$()="x" then end
if scancode()=28
gosub main
endif
loop
return
"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949