September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -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."

View 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"

View 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!")
}

View file

@ -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!")

View file

@ -0,0 +1,3 @@
Say time()
Call sysSleep 10 -- wait 10 seconds
Say time()

View file

@ -1,4 +0,0 @@
<@ SAYLIT>Number of seconds: </@><@ GETVAR>secs</@>
<@ SAYLIT>Sleeping</@>
<@ ACTPAUVAR>secs</@>
<@ SAYLIT>Awake</@>

View file

@ -1,4 +0,0 @@
<# MontrezLittéralement>Number of seconds: </#><# PrenezUneValeurVariable>secs</#>
<# MontrezLittéralement>Sleeping</#>
<# AgissezFaireUnePauseVariable>secs</#>
<# MontrezLittéralement>Awake</#>

View file

@ -1,4 +0,0 @@
<@ 显示_字串_>Number of seconds: </@><@ 获取_变量_>secs</@>
<@ 显示_字串_>Sleeping</@>
<@ 运行_暂停动变量_>secs</@>
<@ 显示_字串_>Awake</@>

View 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!");
}

View file

@ -0,0 +1,8 @@
program sleep_awake
* pass duration in milliseconds
display "Sleeping..."
sleep `0'
display "Awake!"
end
sleep_awake 2000

View 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
View file

@ -0,0 +1,4 @@
seconds:=ask("Seconds to sleep: ").toFloat();
println("Sleeping...");
Atomic.sleep(seconds); # float, usually millisecond resolution
println("Awake!");