18
4
Challenge
Given an integer n
(where 4<=n<=10**6
) 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 as long as it's permitted by standard I/O rules.
- 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.
- Output may not contain any trailing spaces but a trailing newline is permitted if 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
4This would have been good if you could input both x and y dimensions – Beta Decay – 2017-06-15T13:19:03.753
15It was in the Sandbox more than long enough for you to suggest that. – Shaggy – 2017-06-15T13:21:36.920
Can my program contain
╬
even trough╬
isn't in its codepage? If not, then is"'Z“ζ
permitted as one byte cost (or 2)? (push 9580, convert to unicode)? – dzaima – 2017-06-15T13:43:42.737@dzaima For the purposes of this challenge, in languages where the symbols used for the "door" take multiple bytes, they may be counted towards your score as a single byte each. – Okx – 2017-06-15T13:46:17.057
@Okx
╬
- not represetable in any byte amount,"'Z“ζ
equaling one byte would be like in javascript"╬"
costing 1 byte – dzaima – 2017-06-15T13:49:24.217@dzaima, unless an overwhelming case is made otherwise, the allowance applies only to those characters used in the challenge. – Shaggy – 2017-06-15T13:54:25.593
@Shaggy so to compete I need to count the representation of the characters as 5 bytes each? – dzaima – 2017-06-15T14:09:29.423
I wish the height and width didn't differ by an odd number... – Neil – 2017-06-15T16:41:22.813
@Downvoter: feedback would be appreciated. – Shaggy – 2017-06-15T22:22:26.403
@Shaggy "unless an overwhelming case is made otherwise, the allowance applies only to those characters used in the challenge" So to clarify, the string of
+
s representing╬
in Brainfuck would count as 9,580 bytes, not 1? :-) – Ray – 2017-06-16T01:33:40.730How about allowing
FT7
,E#3
,LWJ
? The prison door might look a little weird; but that would resolve all codepage and counting issues. – Titus – 2018-03-14T16:51:31.370