diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-10-01 14:34:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-01 14:34:19 +0100 |
| commit | 0501dcb05267e010f8c5f99b61368077b2f2684b (patch) | |
| tree | dce5ead93a4e4c31ba926adfbf28b0ce31caf56f | |
| parent | 5476167f21c01dbd6284349bad59658e27284e09 (diff) | |
| parent | b0b1570cb8464a139ae1339c5e4ac9fc1685b7f1 (diff) | |
| download | perlweeklychallenge-club-0501dcb05267e010f8c5f99b61368077b2f2684b.tar.gz perlweeklychallenge-club-0501dcb05267e010f8c5f99b61368077b2f2684b.tar.bz2 perlweeklychallenge-club-0501dcb05267e010f8c5f99b61368077b2f2684b.zip | |
Merge pull request #695 from Doomtrain14/master
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 |
