Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created June 20, 2016 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/be1ba87c994864f8cf14ce5cacc96bdb to your computer and use it in GitHub Desktop.
Save zoffixznet/be1ba87c994864f8cf14ce5cacc96bdb to your computer and use it in GitHub Desktop.
use MONKEY-TYPING;
augment class Int { multi method base(1) { '0' x self } };
given :36("FIZZ"), :36("BUZZ"), :36("FIZZBUZZ") -> $s {
for 36...1 -> $n {
given chr($n div 10 + 8320) ~ chr($n mod 10 + 8320) -> $radix {
sprintf "%-24s|%-24s|%-24s\n", ^3 .map: { $s[$_].base($n) ~ $radix };
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment