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

added 74 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 16(削除) 16 (削除ここまで) 14 bytes

×ばつs.×ばつS»X»D»Xr»×ばつ`»D®»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 s.ø # add the corner char on both sides
 U©  # storesave in Xregister while keeping it on the stack
 ×ばつ|` # createpush athe stringremaining inputs to the top of the stack
 ×ばつ`  # push the correct nr of vertical chars on the stack
  » # split into list and # join on newline creating(joining athe top vertical string
and horizontal sections)
  D # join horizontal part and# verticalduplicate partthis
 on newline
 ®  # duplicatepush andthe joinhorizontal onpart newlineagain
 Xr» » # join a last horizontal# stringjoin ineverything theon beginningnewline

Try it online! Try it online!

Saved 24 bytes thanks to Adnan.

05AB1E, 16 bytes

×ばつs.×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 s.ø # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars  # split into list and join on newline creating a vertical string
  # join horizontal part and vertical part on newline
  # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online!

Saved 2 bytes thanks to Adnan.

05AB1E, (削除) 16 (削除ここまで) 14 bytes

×ばつs.×ばつ`»D®»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 s.ø # add the corner char on both sides
 ©  # save in register while keeping it on the stack
 |` # push the remaining inputs to the top of the stack
 ×ばつ`  # push the correct nr of vertical chars on the stack
 »  # join on newline (joining the top vertical and horizontal sections)
 D # duplicate this
 ® # push the horizontal part again
 » # join everything on newline

Try it online!

Saved 4 bytes thanks to Adnan.

deleted 20 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, (削除) 16 (削除ここまで) 1716 bytes

×ばつS»X»D»Xr»×ばつs×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 «R3«s.ø  # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online! Try it online!

Saved 1 byte2 bytes thanks to Adnan.

05AB1E, (削除) 16 (削除ここまで) 17 bytes

×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 «R3« # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online!

Saved 1 byte thanks to Adnan.

05AB1E, 16 bytes

×ばつs×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 s.ø  # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online!

Saved 2 bytes thanks to Adnan.

added 21 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 16(削除) 16 (削除ここまで) 17 bytes

×ばつS»X»D»Xr»×ばつS»X»D»Xr»

Explanation

×ばつ×ばつ # create a string of the correct nr of horizontal chars
 «R3« # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online! Try it online!

Saved 1 byte thanks to Adnan.

05AB1E, 16 bytes

×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 «R3« # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online!

Saved 1 byte thanks to Adnan.

05AB1E, (削除) 16 (削除ここまで) 17 bytes

×ばつS»X»D»Xr»

Explanation

×ばつ # create a string of the correct nr of horizontal chars
 «R3« # add the corner char on both sides
 U # store in X
 ×ばつ # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

Try it online!

Saved 1 byte thanks to Adnan.

deleted 72 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164
Loading
deleted 91 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164
Loading
deleted 28 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164
Loading
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164
Loading

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