Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
4
Task/Sleep/DCL/sleep.dcl
Normal file
4
Task/Sleep/DCL/sleep.dcl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ amount_of_time = p1 ! hour[:[minute][:[second][.[hundredth]]]]
|
||||
$ write sys$output "Sleeping..."
|
||||
$ wait 'amount_of_time
|
||||
$ write sys$output "Awake!"
|
||||
13
Task/Sleep/Lua/sleep.lua
Normal file
13
Task/Sleep/Lua/sleep.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function sleep (s)
|
||||
local t0 = os.time()
|
||||
repeat until os.time() - t0 >= s
|
||||
end
|
||||
|
||||
local seconds
|
||||
repeat -- Keep asking until input is a valid number
|
||||
io.write("Enter number of seconds to sleep: ")
|
||||
seconds = tonumber(io.read())
|
||||
until seconds ~= nil
|
||||
print("Sleeping...")
|
||||
sleep(seconds)
|
||||
print("Awake!")
|
||||
Loading…
Add table
Add a link
Reference in a new issue