Skip to main content
added 31 characters in body
Source Link
JohnWells
  • 701
  • 3
  • 7

Kotlin, 123123 116 bytes

change if with \n to println

{s:Int->val n=s-1
for(r in 0..n){for(c in 0..n)print(if(n-r==c||r==c||r<1||c<1||r==n||c==n)if(c==n)"#\n"
else "#"
else " ")
println()}}

Try it online!Try it online!

Kotlin, 123 bytes

{s:Int->val n=s-1
for(r in 0..n)for(c in 0..n)print(if(n-r==c||r==c||r<1||c<1||r==n||c==n)if(c==n)"#\n"
else "#"
else " ")}

Try it online!

Kotlin, 123 116 bytes

change if with \n to println

{s:Int->val n=s-1
for(r in 0..n){for(c in 0..n)print(if(n-r==c||r==c||r<1||c<1||r==n||c==n)"#"
else " ")
println()}}

Try it online!

Source Link
JohnWells
  • 701
  • 3
  • 7

Kotlin, 123 bytes

{s:Int->val n=s-1
for(r in 0..n)for(c in 0..n)print(if(n-r==c||r==c||r<1||c<1||r==n||c==n)if(c==n)"#\n"
else "#"
else " ")}

Try it online!