Skip to main content
Commonmark migration
Source Link

##Perl, 72 63 52 50 bytes ##

Perl, 72 63 52 50 bytes

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

##Perl, 72 63 52 50 bytes ##

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

Perl, 72 63 52 50 bytes

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5
fix byte counts
Source Link

##Perl, 72 63 5352 50 bytes ##

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

Note: There might be errors in the byte counts for earlier versions. echo -n "code" | wc seems to have been confused by \n and the likes, so I've now switched to counting manually.

##Perl, 72 63 53 50 bytes ##

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

Note: There might be errors in the byte counts for earlier versions. echo -n "code" | wc seems to have been confused by \n and the likes, so I've now switched to counting manually.

##Perl, 72 63 52 50 bytes ##

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5
added 140 characters in body
Source Link

##Perl, 72 63 5353 50 bytes ##

My shortest version yet puts the mostly empty lines in the output record separatoruses $,/, and prints to get a list of continuous lines.newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop."\n"$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

Here isThe previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version, which might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

Note: There might be errors in the byte counts for earlier versions. echo -n "code" | wc seems to have been confused by \n and the likes, so I've now switched to counting manually.

##Perl, 72 63 53 bytes ##

My shortest version yet puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

Here is the previous version, which might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

##Perl, 72 63 53 50 bytes ##

My shortest version yet uses $/ to get a newline char more compactly:

$ perl -e 'print((($,="="."   ="x pop.$/)=~s/./=/gr)x(1+pop))' 2 5
=====================
=   =   =   =   =   =
=====================
=   =   =   =   =   =
=====================

The previous update puts the mostly empty lines in the output record separator $,, and prints a list of continuous lines.

$ perl -e 'print((($,="="."   ="x pop."\n")=~s/./=/gr)x(1+pop))' 2 5

The previous version might be a bit clearer for the casual reader:

$ perl -E 'say($y=($x="="."   ="x pop)=~s/./=/gr);for(1..pop){say$x;say$y}' 2 5

The first version used @ARGV instead of pop:

$ perl -E 'say($y=($x="="."   ="x$ARGV[1])=~s/./=/gr);for(1..$ARGV[0]){say$x;say$y}' 2 5

Note: There might be errors in the byte counts for earlier versions. echo -n "code" | wc seems to have been confused by \n and the likes, so I've now switched to counting manually.

added 292 characters in body
Source Link
Loading
added 118 characters in body
Source Link
Loading
Source Link
Loading