diff options
| author | Ysmael Ebreo <Ysmael.Ebreo@latticesemi.com> | 2019-10-01 20:24:32 +0800 |
|---|---|---|
| committer | Ysmael Ebreo <Ysmael.Ebreo@latticesemi.com> | 2019-10-01 20:24:32 +0800 |
| commit | b0b1570cb8464a139ae1339c5e4ac9fc1685b7f1 (patch) | |
| tree | 6027598262835099e31cda92d78cc31a51d0408c | |
| parent | eec8b614102867f37e76cca2821c61a41ca01641 (diff) | |
| download | perlweeklychallenge-club-b0b1570cb8464a139ae1339c5e4ac9fc1685b7f1.tar.gz perlweeklychallenge-club-b0b1570cb8464a139ae1339c5e4ac9fc1685b7f1.tar.bz2 perlweeklychallenge-club-b0b1570cb8464a139ae1339c5e4ac9fc1685b7f1.zip | |
Added perl6 solution ch#28-2
| -rw-r--r-- | challenge-028/yet-ebreo/perl6/ch-2.p6 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/challenge-028/yet-ebreo/perl6/ch-2.p6 b/challenge-028/yet-ebreo/perl6/ch-2.p6 new file mode 100644 index 0000000000..47a874a66f --- /dev/null +++ b/challenge-028/yet-ebreo/perl6/ch-2.p6 @@ -0,0 +1,39 @@ +my @ascii_num= ( + [" 0000 "," 00 00 "," 00 00 "," 00 00 "," 0000 "], + [" 11 "," 11 "," 11 "," 11 "," 11 "], + [" 222222 "," 22 "," 222222 "," 22 "," 222222 "], + [" 333333 "," 33 "," 333333 "," 33 "," 333333 "], + [" 44 44 "," 44 44 "," 444444 "," 44 "," 44 "], + [" 555555 "," 55 "," 555555 "," 55 "," 555555 "], + [" 666666 "," 66 "," 666666 "," 66 66 "," 666666 "], + [" 777777 "," 77 "," 77 "," 77 "," 77 "], + [" 888888 "," 88 88 "," 888888 "," 88 88 "," 888888 "], + [" 999999 "," 99 99 "," 999999 "," 99 "," 999999 "], + [" "," :: "," "," :: "," "], + [" "," "," "," "," "] +); +my $toggler = 1; +loop { + my $dig_time = DateTime.now; + my @printline; + + $toggler = !$toggler; + for $dig_time.hh-mm-ss.split("",:skip-empty) -> $x { + for (0 .. 4) -> $i { + @printline[$i] ~= @ascii_num[ ($x~~/\:/) ?? ( $toggler ?? 10 !! 11) !! $x ][$i]; + } + } + + #This might cause flicker + shell (($*DISTRO.name eq 'mswin32') ?? 'cls' !! 'clear'); + + for (0 .. 4) -> $i { + say @printline[$i]; + } + + say "\nToday is "~qw|Monday Tuesday Wednesday Thursday Friday Saturday Sunday|[$dig_time.day-of-week-1] + ~": "~qw|January February March April May June July August September October November December|[$dig_time.month-1] + ~" "~$dig_time.day~"," + ~" "~$dig_time.year; + sleep .5 +}
\ No newline at end of file |
