取两个非负整数列表,并输出如下定义的ASCII框。
- 角和交点为加号:
+
(ASCII代码43) - 垂直线是条形
|
(ASCII代码124) - 水平线是负号
-
(ASCII代码45)
第一个输入列表指定水平方向上每个加号之间的减号数。
第二个输入列表指定垂直方向上每个加号之间的条形数量。
举几个例子更容易解释:
0 // No minuses between each + sign
0 // No bars between + signs
++
++
------------------
1 2 // First a single minus, then two minuses
1 2 // First one bar, then two bars
+-+--+
| | |
+-+--+
| | |
| | |
+-+--+
------------------
1 0 3 0 2 0
2 1 0 0
+-++---++--++
| || || ||
| || || ||
+-++---++--++
| || || ||
+-++---++--++
+-++---++--++
+-++---++--++
说明:
- 输入顺序和格式是可选的
- 仅应打印/显示这些框,但可以接受尾随空格或换行符。
- 如果更方便,您可以选择将1添加到所有输入值。然后,第二个示例为:
2 3; 2 3
。
这是代码高尔夫球,因此以字节为单位的最短代码获胜。