From f3c354d396a38033dac28ece6f6220e75cef5aec Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Tue, 1 Jul 2014 20:51:07 +0200 Subject: [Lua] Día 2 (sin terminar) --- lua/punch.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/punch.lua (limited to 'lua/punch.lua') diff --git a/lua/punch.lua b/lua/punch.lua new file mode 100644 index 0000000..8f8b24f --- /dev/null +++ b/lua/punch.lua @@ -0,0 +1,20 @@ +dofile("scheduler.lua") + +function punch() + for i = 1, 5 do + print('punch ' .. i) + wait(1.0) + end +end + +function block() + for i = 1, 3 do + print('block ' .. i) + wait(2.0) + end +end + +schedule(0.0, coroutine.create(punch)) +schedule(0.0, coroutine.create(block)) + +run() -- cgit v1.2.3