Created
August 29, 2014 00:26
-
-
Save colomon/196e74c18c504d1150c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @codes = 'a'..'z' X~ 'a'..'z'; | |
sub simple($n) { | |
@codes[$n % +@codes]; | |
} | |
my $last = @codes[* - 1]; | |
sub full($n) { | |
my $prefix = $last x ($n div +@codes); | |
my $value = simple($n); | |
$prefix ~ $value; | |
} | |
say full(1); | |
say full(10); | |
say full(100); | |
say full(1000); | |
say full(10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment