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

#Dyalog APL , (削除) 31 (削除ここまで) 29 bytes

Dyalog APL , (削除) 31 (削除ここまで) 29 bytes

Prompts for horizontal-character, width, junction-character, height, vertical-character – in that order.

h↓⊃⍪/3/⊂↑(⍞⍴⍨h←⎕),⊂⍞{∊⍺⍵⍺}⎕⍴⍞

⎕⍴⍞ input-horizontal-character and repeat input-width times ( below)

⍞{...} input-junction-character which will be in the function...

∊⍺⍵⍺ flatten [[junction],[horizontals],[junction]]

encapsulate so it can be part of a list

(...), prepend...

h←⎕ input-height

⍞⍴⍨ input-vertical-character and repeat it that many times

make the list of strings into a character table

encapsulate (so it can be repeated as a whole)

3/ repeat it three times

╻ ╻ ╻
┗━ ┗━ ┗━

⍪/ concatenate the three pieces vertically

╻
┣━
┣━
┗━

(this encapsulates them too, so we need to...)

remove the encapsulation

h↓ drop the first h (rows)

┏━
┣━
┗━

TryAPL online!

#Dyalog APL , (削除) 31 (削除ここまで) 29 bytes

Prompts for horizontal-character, width, junction-character, height, vertical-character – in that order.

h↓⊃⍪/3/⊂↑(⍞⍴⍨h←⎕),⊂⍞{∊⍺⍵⍺}⎕⍴⍞

⎕⍴⍞ input-horizontal-character and repeat input-width times ( below)

⍞{...} input-junction-character which will be in the function...

∊⍺⍵⍺ flatten [[junction],[horizontals],[junction]]

encapsulate so it can be part of a list

(...), prepend...

h←⎕ input-height

⍞⍴⍨ input-vertical-character and repeat it that many times

make the list of strings into a character table

encapsulate (so it can be repeated as a whole)

3/ repeat it three times

╻ ╻ ╻
┗━ ┗━ ┗━

⍪/ concatenate the three pieces vertically

╻
┣━
┣━
┗━

(this encapsulates them too, so we need to...)

remove the encapsulation

h↓ drop the first h (rows)

┏━
┣━
┗━

TryAPL online!

Dyalog APL , (削除) 31 (削除ここまで) 29 bytes

Prompts for horizontal-character, width, junction-character, height, vertical-character – in that order.

h↓⊃⍪/3/⊂↑(⍞⍴⍨h←⎕),⊂⍞{∊⍺⍵⍺}⎕⍴⍞

⎕⍴⍞ input-horizontal-character and repeat input-width times ( below)

⍞{...} input-junction-character which will be in the function...

∊⍺⍵⍺ flatten [[junction],[horizontals],[junction]]

encapsulate so it can be part of a list

(...), prepend...

h←⎕ input-height

⍞⍴⍨ input-vertical-character and repeat it that many times

make the list of strings into a character table

encapsulate (so it can be repeated as a whole)

3/ repeat it three times

╻ ╻ ╻
┗━ ┗━ ┗━

⍪/ concatenate the three pieces vertically

╻
┣━
┣━
┗━

(this encapsulates them too, so we need to...)

remove the encapsulation

h↓ drop the first h (rows)

┏━
┣━
┗━

TryAPL online!

-2 and explanation
Source Link
Adám
  • 31.8k
  • 4
  • 131
  • 292

#Dyalog APL, 31(削除) 31 (削除ここまで) 29 bytes

Prompts for height, vertical, horizontal-character, width, junction;junction-character, height, vertical-character – in that order.

⊖h↓⊖⊃⍪h↓⊃⍪/3/⊂↑(⍞⍴⍨h←⎕),⊂⍞{∊⍺⍵⍺}⎕⍴⍞),⍞⍴⍨h←⎕

TryAPL online! ⎕⍴⍞ input-horizontal-character and repeat input-width times ( below)

⍞{...} input-junction-character which will be in the function...

∊⍺⍵⍺ flatten [[junction],[horizontals],[junction]]

encapsulate so it can be part of a list

(...), prepend...

h←⎕ input-height

⍞⍴⍨ input-vertical-character and repeat it that many times

make the list of strings into a character table

encapsulate (so it can be repeated as a whole)

3/ repeat it three times

╻ ╻ ╻
┗━ ┗━ ┗━

⍪/ concatenate the three pieces vertically

╻
┣━
┣━
┗━

(this encapsulates them too, so we need to...)

remove the encapsulation

h↓ drop the first h (rows)

┏━
┣━
┗━

TryAPL online!

#Dyalog APL, 31 bytes

Prompts for height, vertical, horizontal, width, junction; in that order.

⊖h↓⊖⊃⍪/3/⊂↑(⊂⍞{∊⍺⍵⍺}⎕⍴⍞),⍞⍴⍨h←⎕

TryAPL online!

#Dyalog APL, (削除) 31 (削除ここまで) 29 bytes

Prompts for horizontal-character, width, junction-character, height, vertical-character – in that order.

h↓⊃⍪/3/⊂↑(⍞⍴⍨h←⎕),⊂⍞{∊⍺⍵⍺}⎕⍴⍞

⎕⍴⍞ input-horizontal-character and repeat input-width times ( below)

⍞{...} input-junction-character which will be in the function...

∊⍺⍵⍺ flatten [[junction],[horizontals],[junction]]

encapsulate so it can be part of a list

(...), prepend...

h←⎕ input-height

⍞⍴⍨ input-vertical-character and repeat it that many times

make the list of strings into a character table

encapsulate (so it can be repeated as a whole)

3/ repeat it three times

╻ ╻ ╻
┗━ ┗━ ┗━

⍪/ concatenate the three pieces vertically

╻
┣━
┣━
┗━

(this encapsulates them too, so we need to...)

remove the encapsulation

h↓ drop the first h (rows)

┏━
┣━
┗━

TryAPL online!

Source Link
Adám
  • 31.8k
  • 4
  • 131
  • 292

#Dyalog APL, 31 bytes

Prompts for height, vertical, horizontal, width, junction; in that order.

⊖h↓⊖⊃⍪/3/⊂↑(⊂⍞{∊⍺⍵⍺}⎕⍴⍞),⍞⍴⍨h←⎕

TryAPL online!

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