Lotto 49

displayMode(FULLSCREEN)
-- Use this function to perform your initial setup
function setup()
    randit()  
    fontSize(64)
    textMode(CENTER)
    x=1200
    m=1
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)
-- Do your drawing here
    fill(232, 220, 10, 255)
    rect(30,400,1000,200)
    fill(16, 239, 103, 255)
    ellipse(x+10,505,100,100)
    ellipse(x+130,505,100,100)
    ellipse(x+250,505,100,100)
    ellipse(x+370,505,100,100)
    ellipse(x+490,505,100,100)
    ellipse(x+610,505,100,100)
    ellipse(x+810,505,100,100)
 
    text("Ziehung bei Lotto 6 aus 49", 450,300)
    text("Die Lottozahlen        Zusatzzahl",500,650)
    text("Neue Ziehung mit Klick",450,200)
    
    fill(255)
    x=x-1
    if x <= 130 then x=130 end
    ellipse(x,500,100,100)
    ellipse(x+120,500,100,100)
    ellipse(x+240,500,100,100)
    ellipse(x+360,500,100,100)
    ellipse(x+480,500,100,100)
    ellipse(x+600,500,100,100)
    ellipse(x+800,500,100,100)
    fill(27, 31, 26, 255)
    text(n1,x,500)
    text(n2,x+120,500)
    text(n3,x+240,500)
    text(n4,x+365,500)
    text(n5,x+480,500)
    text(n6,x+600,500)  
    text(p,x+800,500)
end
function randit()
    local tab={}
    while #tab<7 do
        local r=math.random(49)
        local found=false
        for z=1,#tab do
            if tab[z]==r then
               found=true
            end
        end
        if not found then
            table.insert(tab,r)
        end   
    end
    table.sort(tab)
        n1=(tab[1])
        n2=(tab[2])
        n3=(tab[3])
        n4=(tab[4])
        n5=(tab[5])
        n6=(tab[6])
        p=math.random(49)
    return(tab)
end
function touched(t)
    if t.state == BEGAN then
        setup()
    end
 end

@matox Nice. Not all lotteries are the same. Maybe you can add parameters to vary the number of balls and the range of random numbers. That way your program can be used for a lot of different lotteries.