今天的任务是在给定单个参数的情况下创建漩涡。
此参数确定每个臂的长度(以字符为单位)。
每条手臂的每个“层”比最后一个包含更多的字符。
给定臂长,这是漩涡的外观:
0:
#
1:
#
###
#
2:
#
# #
###
# #
#
3:
## #
# #
###
# #
# ##
4:
# #
## #
# #
###
# #
# ##
# #
10:
#
#
#
#
#
#### #
### #
## #
# #
###
# #
# ##
# ###
# ####
#
#
#
#
#
适用标准漏洞,尾随空白是可选的,ASCII中的任何单个非空白字符都可以替换“#”。
这是代码高尔夫球,因此最短的答案以字节为单位。
规范(如存在)似乎与示例矛盾。最近两个地方的不对称来自何处?
—
彼得·泰勒
这是更正的版本。
—
rahnema17年
@JonathanAllan看到我的编辑描述:删除了难看的黑色非字符,但它们仍然不对称。不,我没有接手...似乎对我构成无聊的挑战(无冒犯)
—
Xcoder先生17年
请重新打开它。现在很清楚。
—
programmer5000
@JonathanAllan是的,正如您所说,他们遇到了问题。固定。
—
Papayaman1000