这是我的朋友托马斯。他是一半的树,一半的图释。
| |
| :D |
| |
他很孤独。让他结识一些朋友吧!
给定一个基于文本的表情符号作为输入(例如ಠ_ಠ
,:P
,>_>
,不😀
,🤓
或🐦
),输出对应的treemote。
Treemote的长度是多少个字符(基本上是字符串的大多数内置长度函数)。因此,ಠ_ಠ
具有长度为3。
长度n
为treemote的语法如下:
|< 2+n spaces>| * ceil(n/2)
| <emote> | (note the spaces)
|< 2+n spaces>| * ceil(n/2)
因此,任何长度为3的树状节点都将看起来像:
| |
| |
| ಠ_ಠ |
| |
| |
他的ceil(n/2)
两边都有换行符分隔的主干段,每个主干段2 + n
内都有空格。
挑战:给定基于文本的表情符号,输出相应的treemote。
其他规则:
- 这是code-golf,这意味着我要您编写短代码。
- 不允许出现标准漏洞。
- 除非您的语言无法处理,否则您必须支持非ASCII字符。
测试用例:
^_^
| |
| |
| ^_^ |
| |
| |
\o/
| |
| |
| \o/ |
| |
| |
(✿◠‿◠)
| |
| |
| |
| (✿◠‿◠) |
| |
| |
| |
D:
| |
| D: |
| |
( ͡° ͜ʖ ͡°)
| |
| |
| |
| |
| |
| |
| ( ͡° ͜ʖ ͡°) |
| |
| |
| |
| |
| |
| |
ಠ_ಠ
测试案例。