All pastes #460813 Raw Edit

Miscellany

public lua v1 · immutable
#460813 ·published 2007-04-27 09:22 UTC
rendered paste body
game = {updates = {}}function game:update ()    local updated = false    for i, v in pairs(self.updates) do        updated = true        if not coroutine.resume(v) then            self.updates[i] = nil        end    end    return updatedendfunction game:run ()    while self:update() do endendgame.updates.example =coroutine.create(    function ()        for i = 1, 10 do            print(i)            coroutine.yield()        end    end)game:run()--[[10987654321]]