Marshall Lochbaum's online BQN REPL has an interesting(and aesthetically pleasing) method of displaying arrays. Your task is to implement a version with simpler rules.
[2,[3],4,[[[6,[5],7]]]]
becomes:
┌─
· 2 ┌· 4 ┌·
· 3 · ┌·
┘ · ┌─
· 6 ┌· 7
· 5
┘
┘
┘
┘
┘
Rules for drawing
- A singleton array has
┌·
·
as its top left corner.
- A non-singleton array has
┌─
·
as its top left corner.
(In the actual BQN, this is used for rank-0, or "unit" arrays)
- All arrays have
┘
as their bottom right corner.
- Each element at a certain depth will be displayed at the same depth vertically. For example, 2 and 4 are displayed 1 unit from the top since they are at depth 1.
- Each further level of nesting depth moves 1 unit down in depth.
- Numbers next to each other will be separated by a single space.
Other details
- You may take a ragged numeric array in any way your language supports.
- The input will only consist of integers and nested arrays containing integers.
- If your language does not support arrays with depth, you may take a string/other equivalent that your language supports.
- If your language's codepage does not contain the characters
┌ · ─ ┘
, you can count them as 1 byte. - This is code-golf. Shortest answer in each language wins.
- Since bacon strips are thin, your code must be thin and small as well.