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

Commonmark migration
Source Link

#Pyth, 19 bytes

Pyth, 19 bytes

jP*3,++Jw*-E2wJj*Ew

A program that takes newline-separated input on STDIN of the corner character, number of horizontal characters, horizontal character, number of vertical characters and the vertical character, and prints the result.

Try it online

How it works

jP*3,++Jw*-E2wJj*Ew Program.
 Jw Get the corner character. Store in J
 E Get the number of horizontal characters
 - 2 -2
 * w Get the horizontal character and repeat it that many times
 + Add J at the beginning of that
 + J and at the end
 E Get the number of vertical characters
 * w Get the vertical character and repeat it that many times
 j Join the above on newlines
 , Construct a 2-element list from the horizontal and vertical strings
 *3 Repeat it 3 times
 P Everything except the last element
j Join the above on newlines
 Implicitly print

#Pyth, 19 bytes

jP*3,++Jw*-E2wJj*Ew

A program that takes newline-separated input on STDIN of the corner character, number of horizontal characters, horizontal character, number of vertical characters and the vertical character, and prints the result.

Try it online

How it works

jP*3,++Jw*-E2wJj*Ew Program.
 Jw Get the corner character. Store in J
 E Get the number of horizontal characters
 - 2 -2
 * w Get the horizontal character and repeat it that many times
 + Add J at the beginning of that
 + J and at the end
 E Get the number of vertical characters
 * w Get the vertical character and repeat it that many times
 j Join the above on newlines
 , Construct a 2-element list from the horizontal and vertical strings
 *3 Repeat it 3 times
 P Everything except the last element
j Join the above on newlines
 Implicitly print

Pyth, 19 bytes

jP*3,++Jw*-E2wJj*Ew

A program that takes newline-separated input on STDIN of the corner character, number of horizontal characters, horizontal character, number of vertical characters and the vertical character, and prints the result.

Try it online

How it works

jP*3,++Jw*-E2wJj*Ew Program.
 Jw Get the corner character. Store in J
 E Get the number of horizontal characters
 - 2 -2
 * w Get the horizontal character and repeat it that many times
 + Add J at the beginning of that
 + J and at the end
 E Get the number of vertical characters
 * w Get the vertical character and repeat it that many times
 j Join the above on newlines
 , Construct a 2-element list from the horizontal and vertical strings
 *3 Repeat it 3 times
 P Everything except the last element
j Join the above on newlines
 Implicitly print
Source Link

#Pyth, 19 bytes

jP*3,++Jw*-E2wJj*Ew

A program that takes newline-separated input on STDIN of the corner character, number of horizontal characters, horizontal character, number of vertical characters and the vertical character, and prints the result.

Try it online

How it works

jP*3,++Jw*-E2wJj*Ew Program.
 Jw Get the corner character. Store in J
 E Get the number of horizontal characters
 - 2 -2
 * w Get the horizontal character and repeat it that many times
 + Add J at the beginning of that
 + J and at the end
 E Get the number of vertical characters
 * w Get the vertical character and repeat it that many times
 j Join the above on newlines
 , Construct a 2-element list from the horizontal and vertical strings
 *3 Repeat it 3 times
 P Everything except the last element
j Join the above on newlines
 Implicitly print

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