This post is part of a series on Mohammad Anwar’s excellent Weekly Challenge, where hackers submit solutions in Perl, Raku, or any other language, to two different challenges every week. (It’s a lot of fun, if you’re into that sort of thing.)
Challenge 1 this week is an easy one:
Write a script to print decimal number 0 to 50 in [the] Octal Number System.
Perl and Raku
We can solve this with the following polyglot (runs in both languages at once):
printf "Decimal %2d = Octal %2o\n", $_, $_ for 0..50;
Still, in Raku, we can do the following:
Continue reading “Octal Representation”