Skip to main content
Commonmark migration
Source Link

##Perl, 63 chars##

Perl, 63 chars

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

This solution uses the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010). Without it, the best I can do is 67 chars (and an extra newline at the end of the output):

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

Earlier 65-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!say$1!eg

Replacing say$1 with print$1.$/ lets the code run on older perls, at the cost of 5 extra characters.

##Perl, 63 chars##

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

This solution uses the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010). Without it, the best I can do is 67 chars (and an extra newline at the end of the output):

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

Earlier 65-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!say$1!eg

Replacing say$1 with print$1.$/ lets the code run on older perls, at the cost of 5 extra characters.

Perl, 63 chars

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

This solution uses the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010). Without it, the best I can do is 67 chars (and an extra newline at the end of the output):

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

Earlier 65-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!say$1!eg

Replacing say$1 with print$1.$/ lets the code run on older perls, at the cost of 5 extra characters.

rewritten to use `say` per comments
Source Link
Ilmari Karonen
  • 20.8k
  • 4
  • 55
  • 100

##Perl, 6763 chars##

print"1234567890JIHGFEDCBAKLMNOPQRSTsay for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

This one prints an extra newline at the end, but I assume that's OK. (Alternatively, I can make it omit both trailing newlines.) Ifsolution uses the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010) is permitted. Without it, the best I can get this down to 63 charsdo is 67 chars (and fix thean extra newline issue, tooat the end of the output):

say for"1234567890JIHGFEDCBAKLMNOPQRSTprint"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

Earlier 7065-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!print$1.$/say$1!eg

Replacing print$1.$/say$1 with say$1print$1.$/ saves 5 charslets the code run on older perls, but requiresat the -E switch (or use 5.01)cost of 5 extra characters.

##Perl, 67 chars##

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

This one prints an extra newline at the end, but I assume that's OK. (Alternatively, I can make it omit both trailing newlines.) If the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010) is permitted, I can get this down to 63 chars (and fix the newline issue, too):

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

Earlier 70-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!print$1.$/!eg

Replacing print$1.$/ with say$1 saves 5 chars, but requires the -E switch (or use 5.01).

##Perl, 63 chars##

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

This solution uses the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010). Without it, the best I can do is 67 chars (and an extra newline at the end of the output):

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

Earlier 65-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!say$1!eg

Replacing say$1 with print$1.$/ lets the code run on older perls, at the cost of 5 extra characters.

added 491 characters in body
Source Link
Ilmari Karonen
  • 20.8k
  • 4
  • 55
  • 100

##Perl, 7067 chars##

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

This one prints an extra newline at the end, but I assume that's OK. (Alternatively, I can make it omit both trailing newlines.) If the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010) is permitted, I can get this down to 63 chars (and fix the newline issue, too):

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

Earlier 70-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!print$1.$/!eg

Replacing print$1.$/ with say$1 saves 5 chars, but requires the -E switch (or use 5.01).

##Perl, 70 chars##

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!print$1.$/!eg

Replacing print$1.$/ with say$1 saves 5 chars, but requires the -E switch (or use 5.01).

##Perl, 67 chars##

print"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g,$,=$/

This one prints an extra newline at the end, but I assume that's OK. (Alternatively, I can make it omit both trailing newlines.) If the say function (available since Perl 5.10.0 with the -E switch, or with use 5.010) is permitted, I can get this down to 63 chars (and fix the newline issue, too):

say for"1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU"=~/(?=(...))/g

Earlier 70-char solution:

s//1234567890JIHGFEDCBAKLMNOPQRST!?,.ZYXWVU/;s!(?=(...))!print$1.$/!eg

Replacing print$1.$/ with say$1 saves 5 chars, but requires the -E switch (or use 5.01).

Source Link
Ilmari Karonen
  • 20.8k
  • 4
  • 55
  • 100
Loading