Lottozahlen


-- Lottozahlen

-- Use this function to perform your initial setup
function setup()
    print("Deine Lottozahlen!!!")
    fill(255) 
    fontSize(48)
    font("Inconsolata")
    z1 = math.random(49)
    repeat
        z2 = math.random(49)
    until z2 ~= z1
    repeat
        z3 = math.random(49)
    until z3 ~= z1 and z3 ~= z2
    repeat
        z4 = math.random(49)
    until z4 ~= z1 and z4 ~= z2 and z4 ~= z3
    repeat
        z5 = math.random(49)
    until z5 ~= z1 and z5 ~= z2 and z5 ~= z3 and z5 ~= z4 
    repeat
        z6 = math.random(49)
    until z6 ~= z1 and z6 ~= z2 and z6 ~= z3 and z6 ~= z4 and z6 ~= z5 
    lotto = {z1,z2,z3,z4,z5,z6} 
    table.sort(lotto)
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    text("Lottozahlen 6 aus 49", 350,700)
    text("Lottozahlen sortiert",350,300)
    ellipse(100,500,100,100)
    ellipse(205,500,100,100)
    ellipse(310,500,100,100)
    ellipse(415,500,100,100)
    ellipse(520,500,100,100)
    ellipse(625,500,100,100)

    ellipse(100,200,100,100)
    ellipse(205,200,100,100)
    ellipse(310,200,100,100)
    ellipse(415,200,100,100)
    ellipse(520,200,100,100)
    ellipse(625,200,100,100)
    pushStyle()
        fill(0)
        fontSize(36)
        font("ArialMT")
        text(z1,100,500)    
        text(z2,205,500) 
        text(z3,310,500) 
        text(z4,415,500) 
        text(z5,520,500) 
        text(z6,625,500) 
 
        text(lotto[1],100,200)    
        text(lotto[2],205,200) 
        text(lotto[3],310,200) 
        text(lotto[4],415,200) 
        text(lotto[5],520,200) 
        text(lotto[6],625,200) 
    popStyle() 
end