Skip to main content
4 of 7
added 391 characters in body
breadbox
  • 7.3k
  • 33
  • 45

Perl, 33 32 24 characters

A solution in 32 characters:

$_=a;print$_++,$"until/passwore/ 

Not much to say about this one. I could reduce this to 27 characters if I could use newlines instead of spaces to separate the entries.

Ilmari Karonen points out that .. internally calls ++, so a better solution (25 characters) would be:

print$_,$"for a..password 

By taking advantage of Perl's command-line options, here's an equivalent 24-character solution:

perl -l40e 'print for a..password' 

The rules for counting perl flags is here, for those who aren't familiar with them.

Of course, Ilmari's 21-character solution is shorter still, but it requires a machine that can allocate an array of 120,699,639,557 strings.

breadbox
  • 7.3k
  • 33
  • 45