PDA

View Full Version : Lottery example short



Lionheart008
27-02-2024, 20:05
Here is a little lottery Script example



'---Script created on 02-27-2024 18:19:29 by lionheart (frank)
' lottery: germany, lottozahlen 6 out of 49 plus extraball
' thinbasic by frank bruebach, 27-2-2024
'
dim i, temp as long
dim Lotto(49) as long
dim Lotterynumbers(7) AS LONG

' lotterynumber = "lottozahlen", you draw six number of 49 possibilities,
' 6 numbers of 49 drop down of a big transparent sphere into various glasses
' extranumber = after the drawing of six number you can
' get the 7th number as extranumber and earn more money, old lottery around 90ies

'lottery begin --------------------------->
'
for i = 1 to 49
Lotto(i) = 1
next
i = 1
RANDOMIZE Timer

do while i < 8
temp = rnd(1,49)
if Lotto(temp) = 1 then
Lotterynumbers(i) = temp
Lotto(temp) = 0
incr i 'i++
endif
If i = 8 Then Exit Do
loop

Msgbox 0, " Your Lottery numbers are: "
for i = 1 to 6
msgbox 0, "Ball "+i+" "+str$(LotteryNumbers(i))
next
Msgbox 0, " And the extranumber is : " + str$(LotteryNumbers(7))
msgbox 0, "end of lotterynumber short script"


I found this old example Last days and Convert IT to thinbasic