function love.load()
    sequence = {}

    function addToSequence()
        table.insert(sequence, love.math.random(4))
    end

    addToSequence()

    current = 1
end

function love.keypressed(key)
    if tonumber(key) == sequence[current] then
        current = current + 1
        if current > #sequence then
            current = 1
            addToSequence()
        end
    end
end

function love.draw()
    love.graphics.print(table.concat(sequence, ', '))
    love.graphics.print(current..'/'..#sequence, 0, 20)
    love.graphics.print('sequence[current]: '..sequence[current], 0, 40)
end