Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function co()
- for i = 1, 3 do
- print("co: ", i)
- coroutine.yield(i)
- end
- end
- function coTester()
- c = coroutine.create(co)
- coroutine.resume(c)
- wait(function() return coroutine.status(c) == "suspended" end )
- coroutine.resume(c)
- wait(function() return coroutine.status(c) == "suspended" end )
- coroutine.resume(c)
- end
- ct = coroutine.create(coTester)
- coroutine.resume(ct)
Advertisement
Add Comment
Please, Sign In to add comment