Unnamed
public lua v1 · immutablegame = {updates = {}, running = false}function game:update () self.numupdates = 0 for i, v in pairs(self.updates) do self.numupdates = self.numupdates + 1 v(self) endendfunction game:run () self.isrunning = true repeat self:update() until self.numupdates == 0 self.isrunning = falseenddo local times = 10 function game.updates:test () print(times) times = times - 1 if times == 0 then game.updates.test = nil end endendgame:run()--[[10987654321]]