Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,23 @@
ORG RESET
jmp main
ORG TIMER0
; timer interrupt only used to wake the processor
clr tr0
reti
main:
setb ea ; enable interrupts
setb et0 ; enable timer0 interrupt
mov tl0, #0 ; start timer counter at zero
mov th0, #0 ; these two values dictate the length of sleep
mov a, pcon ; copy power control register
setb a.0 ; set idl bit
setb tr0 ; start timer
; sleeping...
mov pcon, a ; move a back into pcon (processor sleeps after this instruction finishes)
; when the timer overflows and the timer interrupt returns, execution will resume at this spot
; Awake!
jmp $

4
Task/Sleep/8th/sleep.8th Normal file
View file

@ -0,0 +1,4 @@
f:stdin f:getline
"Sleeping..." . cr
eval sleep
"Awake!" . cr bye

View file

@ -0,0 +1,4 @@
milliseconds: eval[input["How long should I sleep? "]] / eval = evil, but this is just a simple demo
echo["Sleeping..."]
sleep[milliseconds]
echo["Awake!"]

15
Task/Sleep/Axe/sleep.axe Normal file
View file

@ -0,0 +1,15 @@
Disp "TIME:"
input→A
0→T
length(A)→L
For(I,1,L)
If {A}<'0' or {A}>'9'
Disp "NOT A NUMBER",i
Return
End
T*10+{A}-'0'→T
A++
End
Disp "SLEEPING...",i
Pause T
Disp "AWAKE",i

View file

@ -0,0 +1,6 @@
..............
INPUT("Enter the time to sleep in seconds: ";sleep)
PRINT("Sleeping...")
PAUSE(sleep)
PRINT("Awake!")
..............

View file

@ -0,0 +1,8 @@
' FB 1.05.0 Win64
Dim ms As UInteger
Input "Enter number of milliseconds to sleep" ; ms
Print "Sleeping..."
Sleep ms, 1 '' the "1" means Sleep can't be interrupted with a keystroke
Print "Awake!"
End

View file

@ -0,0 +1,3 @@
stdoutnl('Sleeping...')
sleep(5000) // Sleep 5 seconds
stdoutnl('Awake!')

View file

@ -0,0 +1,5 @@
on doSleep (ms)
put "Sleeping..."
sleep(ms)
put "Awake!"
end

7
Task/Sleep/Nim/sleep.nim Normal file
View file

@ -0,0 +1,7 @@
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 @@
: sleepMilli(n) "Sleeping..." . n sleep "Awake!" println ;

View file

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

View file

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

View file

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

View file

@ -0,0 +1,4 @@
atom a = prompt_number("wait for duration (in seconds, 0..20):", {0,20})
puts(1,"Sleeping...\n")
sleep(a)
puts(1,"Awake!\n")

View file

@ -0,0 +1,12 @@
load "guilib.ring"
for n = 1 to 10
Sleep(3)
see "" + n + " "
next
see nl
func Sleep x
nTime = x * 1000
oTest = new qTest
oTest.qsleep(nTime)

View file

@ -0,0 +1,6 @@
var sec = read(Number); # any positive number (it may be fractional)
say "Sleeping...";
Sys.sleep(sec); # in seconds
#Sys.usleep(sec); # in microseconds
#Sys.nanosleep(sec); # in nanoseconds
say "Awake!";

View file

@ -0,0 +1,10 @@
import Foundation
println("Enter number of seconds to sleep")
let input = NSFileHandle.fileHandleWithStandardInput()
var amount = NSString(data:input.availableData, encoding: NSUTF8StringEncoding)?.intValue
var interval = NSTimeInterval(amount!)
println("Sleeping...")
NSThread.sleepForTimeInterval(interval)
println("Awake!")

View file

@ -0,0 +1,4 @@
out "Sleeping..." endl console
# sleep for 5 seconds (5000 milliseconds)
sleep 5000
out "Awake!" endl console