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,6 +1,6 @@
STDOUT.autoflush(1)
STDOUT.autoflush(true)
var (rows, cols) = `stty size`.words.map{.to_i}...
var (rows, cols) = `stty size`.nums...
var x = (rows/2 - 1 -> int)
var y = (cols/2 - 16 -> int)
@ -12,20 +12,20 @@ var chars = [
].map {|s| s.split(3) }
func position(i,j) {
"\e[%d;%dH"%(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}...
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 "\e[H\e[J"
for i in ^chars {
print position(x + i, y)
print [chars[i][indices()]].join(' ')
}
print position(1, 1);
Sys.sleep(1);
print position(1, 1)
Sys.sleep(0.1)
}