Skip to content

Instantly share code, notes, and snippets.

@colomon
Created August 29, 2014 00:26
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 colomon/196e74c18c504d1150c4 to your computer and use it in GitHub Desktop.
Save colomon/196e74c18c504d1150c4 to your computer and use it in GitHub Desktop.
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