lua - Err using coroutine -


i'm not sure if misunderstood use of coroutine, here code:

talk = coroutine.create(function () print("i speaking within 60 seconds") end)  time = coroutine.create(function () if coroutine.status(talk) == running = 60, 0, -1 print(i) end sleep(1) else coroutine.resume(talk) end  end) coroutine.resume(time) 

all print speaking within 60 seconds, expecting within countdown. how fix this?

talk = coroutine.create(function () print("i speaking within 60 seconds") coroutine.resume(time) end)  time = coroutine.create(function () = 60, 0, -1 print(i) coroutine.resume(talk) end  end)  coroutine.resume(time) 

Comments

Popular posts from this blog

libGdx unable to find files in android application data directory -

php - Webix Data Loading from Laravel Link -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -