Draw a clock: Difference between revisions
→{{header|Raku}}: hide cursor while running, catch SIGINT
(→{{header|Raku}}: hide cursor while running, catch SIGINT) |
|||
Line 5,425:
constant @b = < ⢗⣁⡸ ⢀⣸⣀ ⣔⣉⣀ ⢄⣀⡸ ⠉⠉⡏ ⢄⣀⡸ ⢇⣀⡸ ⢰⠁⠀ ⢇⣀⡸ ⢈⣉⡹ ⠀⠶⠀>;
signal(SIGINT).tap: { print "\e[?25h\n"; exit }
print "\e7\e[?25l"; # saves cursor position, make it invisible
loop {
my @x = DateTime.now.Str.substr(11,8).ords X- ord('0');
Line 5,431 ⟶ 5,432:
sleep 1;
print "\e8"; # restores cursor position
▲END put "\n";</syntaxhighlight>
Finally a more minimalist version that shows three progress bars (hours, minutes, seconds):
|