Skip to main content
Commonmark migration
Source Link

#Perl 5, 66 bytes

Perl 5, 66 bytes

$n=pop;$_='#';for$x(0..$n){$_.=$"x($n-2).'#'};s/(.{$n})/$1\n/g;say 

Takes input as first command line argument.

Builds up a string of length n^2 with # at the proper spots, then inserts newlines at the right places.

#Perl 5, 66 bytes

$n=pop;$_='#';for$x(0..$n){$_.=$"x($n-2).'#'};s/(.{$n})/$1\n/g;say 

Takes input as first command line argument.

Builds up a string of length n^2 with # at the proper spots, then inserts newlines at the right places.

Perl 5, 66 bytes

$n=pop;$_='#';for$x(0..$n){$_.=$"x($n-2).'#'};s/(.{$n})/$1\n/g;say 

Takes input as first command line argument.

Builds up a string of length n^2 with # at the proper spots, then inserts newlines at the right places.

Source Link
Chris
  • 2.1k
  • 13
  • 26

#Perl 5, 66 bytes

$n=pop;$_='#';for$x(0..$n){$_.=$"x($n-2).'#'};s/(.{$n})/$1\n/g;say 

Takes input as first command line argument.

Builds up a string of length n^2 with # at the proper spots, then inserts newlines at the right places.