Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link

Perl, 19 chars

say for a..password

Uses newlines as delimiters, per clarification above. Run with perl -M5.010 (or just perl -E 'say for a..password') to enable the Perl 5.10+ say feature. Per meta meta, this doesn't count as extra chars.

(If you insist on spaces as delimiters, ,ドル=$";say a..password is only two chars longer. However, it's also very slow and wasteful of memory, to the point of being unusable in practice, since it tries to build the entire list in memory before printing it.)

Perl, 19 chars

say for a..password

Uses newlines as delimiters, per clarification above. Run with perl -M5.010 (or just perl -E 'say for a..password') to enable the Perl 5.10+ say feature. Per meta, this doesn't count as extra chars.

(If you insist on spaces as delimiters, ,ドル=$";say a..password is only two chars longer. However, it's also very slow and wasteful of memory, to the point of being unusable in practice, since it tries to build the entire list in memory before printing it.)

Perl, 19 chars

say for a..password

Uses newlines as delimiters, per clarification above. Run with perl -M5.010 (or just perl -E 'say for a..password') to enable the Perl 5.10+ say feature. Per meta, this doesn't count as extra chars.

(If you insist on spaces as delimiters, ,ドル=$";say a..password is only two chars longer. However, it's also very slow and wasteful of memory, to the point of being unusable in practice, since it tries to build the entire list in memory before printing it.)

added 67 characters in body
Source Link
Ilmari Karonen
  • 21k
  • 5
  • 55
  • 101

Perl 5.10+, 2119 chars

,ドル=$";say a..password

If newlines are allowed as delimiters, I can get this down to 19 chars with the nice and simple

say for a..password

This version also consumes a lot less memoryUses newlines as delimiters, since it will lazily iterate over the range rather than trying to build the entire list in memoryper clarification above.

Both of these need to be run Run with the perl -M5.010 switch (or just perl -E 'say for a..password', if run as a one-liner) to enable the Perl 5.10+ say feature. Per meta , this doesn't count as extra chars.

(If you insist on spaces as delimiters, ,ドル=$";say a..password is only two chars longer. However, it's also very slow and wasteful of memory, to the point of being unusable in practice, since it tries to build the entire list in memory before printing it.)

Perl 5.10+, 21 chars

,ドル=$";say a..password

If newlines are allowed as delimiters, I can get this down to 19 chars with the nice and simple

say for a..password

This version also consumes a lot less memory, since it will lazily iterate over the range rather than trying to build the entire list in memory.

Both of these need to be run with the -M5.010 switch (or -E, if run as a one-liner) to enable the say feature.

Perl, 19 chars

say for a..password

Uses newlines as delimiters, per clarification above. Run with perl -M5.010 (or just perl -E 'say for a..password') to enable the Perl 5.10+ say feature. Per meta , this doesn't count as extra chars.

(If you insist on spaces as delimiters, ,ドル=$";say a..password is only two chars longer. However, it's also very slow and wasteful of memory, to the point of being unusable in practice, since it tries to build the entire list in memory before printing it.)

Source Link
Ilmari Karonen
  • 21k
  • 5
  • 55
  • 101
Loading

AltStyle によって変換されたページ (->オリジナル) /