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,67 @@
import concurrent.{scheduleAtFixedRate, scheduler}
val ROW = 10
val COL = 20
val digits = array( [
" __",
" / /",
"/__/ ",
" ",
" /",
" / ",
" __",
" __/",
"/__ ",
" __",
" __/",
" __/ ",
" ",
" /__/",
" / ",
" __",
" /__ ",
" __/ ",
" __",
" /__ ",
"/__/ ",
" __",
" /",
" / ",
" __",
" /__/",
"/__/ ",
" __",
" /__/",
" __/ "
] )
val colon = array( [
" ",
" .",
". "
] )
def displayTime =
def pad( n ) = if n < 10 then '0' + n else n
t = $time
s = (t + $timeZoneOffset)\1000%86400
time = pad( s\3600 ) + ':' + pad( s%3600\60 ) + ':' + pad( s%60 )
for row <- 0:3
print( if $os.startsWith('Windows') then '\n' else '\u001B[' + (ROW + row) + ';' + COL + 'H' )
for ch <- time
print( if ch == ':' then colon(row) else digits(int(ch)*3 + row) )
println()
t
if not $os.startsWith( 'Windows' )
print( '\u001B[2J\u001B[?25l' )
scheduleAtFixedRate( displayTime, 1000 - displayTime()%1000, 1000 )
readLine()
scheduler().shutdown()
if not $os.startsWith( 'Windows' )
print( '\u001B[?25h' )

View file

@ -0,0 +1,14 @@
import times, os
const
t = ["⡎⢉⢵","⠀⢺⠀","⠊⠉⡱","⠊⣉⡱","⢀⠔⡇","⣏⣉⡉","⣎⣉⡁","⠊⢉⠝","⢎⣉⡱","⡎⠉⢱","⠀⠶⠀"]
b = ["⢗⣁⡸","⢀⣸⣀","⣔⣉⣀","⢄⣀⡸","⠉⠉⡏","⢄⣀⡸","⢇⣀⡸","⢰⠁⠀","⢇⣀⡸","⢈⣉⡹","⠀⠶ "]
while true:
let x = getClockStr()
stdout.write "\e[H\e[J"
for c in x: stdout.write t[c.ord - '0'.ord]
echo ""
for c in x: stdout.write b[c.ord - '0'.ord]
echo ""
sleep 1000

View file

@ -0,0 +1,31 @@
STDOUT.autoflush(1)
var (rows, cols) = `stty size`.words.map{.to_i}...
var x = (rows/2 - 1 -> int)
var y = (cols/2 - 16 -> int)
var chars = [
"┌─┐ ╷╶─┐╶─┐╷ ╷┌─╴┌─╴╶─┐┌─┐┌─┐ ",
"│ │ │┌─┘╶─┤└─┤└─┐├─┐ │├─┤└─┤ : ",
"└─┘ ╵└─╴╶─┘ ╵╶─┘└─┘ ╵└─┘╶─┘ "
].map {|s| s.split(3) }
func position(i,j) {
"\e[%d;%dH"%(i, j)
}
func indices {
var t = Time.local;
"%02d:%02d:%02d"%(t.hour, t.min, t.sec).split(1).map{|c| c.ord - '0'.ord}...
}
loop {
print "\e[H\e[J";
chars.range.each { |i|
print position(x + i, y);
print [chars[i][indices()]].join(' ');
}
print position(1, 1);
Sys.sleep(1);
}