Comments on In The Jailhouse Now
Parent
In The Jailhouse Now
+7
−0
Challenge
Given an integer n>=4
as input create an ASCII art "prison door"* measuring n-1
characters wide and n
characters high, using the symbols from the example below.
Example
╔╦╗
╠╬╣
╠╬╣
╚╩╝
The characters used are as follows:
┌───────────────┬─────────┬───────┐
│ Position │ Symbol │ Char │
├───────────────┼─────────┼───────┤
│ Top Left │ ╔ │ 9556 │
├───────────────┼─────────┼───────┤
│ Top │ ╦ │ 9574 │
├───────────────┼─────────┼───────┤
│ Top Right │ ╗ │ 9559 │
├───────────────┼─────────┼───────┤
│ Right │ ╣ │ 9571 │
├───────────────┼─────────┼───────┤
│ Bottom Right │ ╝ │ 9565 │
├───────────────┼─────────┼───────┤
│ Bottom │ ╩ │ 9577 │
├───────────────┼─────────┼───────┤
│ Bottom Left │ ╚ │ 9562 │
├───────────────┼─────────┼───────┤
│ Left │ ╠ │ 9568 │
├───────────────┼─────────┼───────┤
│ Inner │ ╬ │ 9580 │
└───────────────┴─────────┴───────┘
Rules
- You may take input by any reasonable, convenient means.
- For the purposes of this challenge, in languages where the symbols used to build the "door" are multi-byte characters, they may be counted towards your score as a single byte each.
- All other characters (single- or multi-byte) should be counted as normal.
- You may output an array/list of lines instead of a multi-line string.
- Output may not contain any leading or trailing whitespace other than a trailing newline where absolutely necessary.
- This is code-golf so lowest byte count wins.
Test Cases
Input: 4
Output:
╔╦╗
╠╬╣
╠╬╣
╚╩╝
Input: 8
Output:
╔╦╦╦╦╦╗
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╚╩╩╩╩╩╝
Input: 20
Output:
╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝
* Yes, I'm aware that the bigger it gets the less it looks like a prison door! :D
+2
−0
[C (gcc)], 119 118 116 115 byt …
3y ago
+2
−0
[Python 3], 74 bytes …
3y ago
+2
−0
Scala, 90 89 88 bytes Saved …
3y ago
+1
−0
[Ruby], 53 bytes ```ruby - …
3y ago
+1
−0
[Sclipting], (UTF-16) 80 bytes …
3y ago
+0
−0
[C (clang)], 210 198 183 bytes …
3y ago
Post
+1
−0
1 comment thread