September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,5 +1,6 @@
|
|||
10 REM s is the number of seconds
|
||||
20 LET s = 5
|
||||
30 PRINT "Sleeping"
|
||||
40 PAUSE s * 50
|
||||
50 PRINT "Awake"
|
||||
10 PRINT "HOW LONG SHOULD I SLEEP FOR?"
|
||||
20 PRINT "(IN TELEVISION FRAMES)"
|
||||
30 INPUT SLEEPTIME
|
||||
40 PRINT "SLEEPING... ";
|
||||
50 PAUSE SLEEPTIME
|
||||
60 PRINT "AWAKE."
|
||||
|
|
|
|||
5
Task/Sleep/BASIC/sleep-3.basic
Normal file
5
Task/Sleep/BASIC/sleep-3.basic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
10 REM s is the number of seconds
|
||||
20 LET s = 5
|
||||
30 PRINT "Sleeping"
|
||||
40 PAUSE s * 50
|
||||
50 PRINT "Awake"
|
||||
9
Task/Sleep/Kotlin/sleep.kotlin
Normal file
9
Task/Sleep/Kotlin/sleep.kotlin
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// version 1.0.6
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
print("Enter number of milliseconds to sleep: ")
|
||||
val ms = readLine()!!.toLong()
|
||||
println("Sleeping...")
|
||||
Thread.sleep(ms)
|
||||
println("Awake!")
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import os, strutils
|
||||
|
||||
echo("Enter how long I should sleep (in milliseconds):")
|
||||
var timed = parseInt(readLine(stdin).string)
|
||||
echo("Sleeping...")
|
||||
sleep(timed)
|
||||
echo("Awake!")
|
||||
3
Task/Sleep/OoRexx/sleep.rexx
Normal file
3
Task/Sleep/OoRexx/sleep.rexx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Say time()
|
||||
Call sysSleep 10 -- wait 10 seconds
|
||||
Say time()
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<@ SAYLIT>Number of seconds: </@><@ GETVAR>secs</@>
|
||||
<@ SAYLIT>Sleeping</@>
|
||||
<@ ACTPAUVAR>secs</@>
|
||||
<@ SAYLIT>Awake</@>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<# MontrezLittéralement>Number of seconds: </#><# PrenezUneValeurVariable>secs</#>
|
||||
<# MontrezLittéralement>Sleeping</#>
|
||||
<# AgissezFaireUnePauseVariable>secs</#>
|
||||
<# MontrezLittéralement>Awake</#>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<@ 显示_字串_>Number of seconds: </@><@ 获取_变量_>secs</@>
|
||||
<@ 显示_字串_>Sleeping</@>
|
||||
<@ 运行_暂停动变量_>secs</@>
|
||||
<@ 显示_字串_>Awake</@>
|
||||
19
Task/Sleep/Rust/sleep.rust
Normal file
19
Task/Sleep/Rust/sleep.rust
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use std::{io, time, thread};
|
||||
|
||||
fn main() {
|
||||
println!("How long should we sleep in milliseconds?");
|
||||
|
||||
let mut sleep_string = String::new();
|
||||
|
||||
io::stdin().read_line(&mut sleep_string)
|
||||
.expect("Failed to read line");
|
||||
|
||||
let sleep_timer: u64 = sleep_string.trim()
|
||||
.parse()
|
||||
.expect("Not an integer");
|
||||
let sleep_duration = time::Duration::from_millis(sleep_timer);
|
||||
|
||||
println!("Sleeping...");
|
||||
thread::sleep(sleep_duration);
|
||||
println!("Awake!");
|
||||
}
|
||||
8
Task/Sleep/Stata/sleep.stata
Normal file
8
Task/Sleep/Stata/sleep.stata
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
program sleep_awake
|
||||
* pass duration in milliseconds
|
||||
display "Sleeping..."
|
||||
sleep `0'
|
||||
display "Awake!"
|
||||
end
|
||||
|
||||
sleep_awake 2000
|
||||
14
Task/Sleep/X86-Assembly/sleep.x86
Normal file
14
Task/Sleep/X86-Assembly/sleep.x86
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
; x86_64 linux nasm
|
||||
|
||||
section .text
|
||||
|
||||
Sleep:
|
||||
mov rsi, 0 ; we wont use the second sleep arg, pass null to syscall
|
||||
sub rsp, 16
|
||||
mov qword [rsp], rdi ; number of seconds the caller requested
|
||||
mov qword [rsp + 8], rsi ; we won't use the nanoseconds
|
||||
mov rdi, rsp ; pass the struct that's on the stack to
|
||||
mov rax, 35 ; sys_nanosleep
|
||||
syscall
|
||||
add rsp, 16 ; clean up stack
|
||||
ret
|
||||
4
Task/Sleep/Zkl/sleep.zkl
Normal file
4
Task/Sleep/Zkl/sleep.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
seconds:=ask("Seconds to sleep: ").toFloat();
|
||||
println("Sleeping...");
|
||||
Atomic.sleep(seconds); # float, usually millisecond resolution
|
||||
println("Awake!");
|
||||
Loading…
Add table
Add a link
Reference in a new issue