背景
今天(或昨天)是(或曾经是)11/23或斐波那契日!有什么比做斐波那契蛋糕更好的庆祝方式了?
例子
3
ii
i_i_ii_i_i
8
ii
ii
ii
ii
ii
ii
ii
ii
i ii i
i ii i
i ii i
i ii i
i ii i
i i ii i i
i i ii i i
i i ii i i
i i i ii i i i
i i i ii i i i
i i i i ii i i i i
i i i i i ii i i i i i
i_i_i_i_i_i_i_ii_i_i_i_i_i_i_i
挑战
你不是真的在做蛋糕,只是在做蜡烛,因为我不能画蛋糕
要制作蛋糕,您必须首先获得升序排列的第一个n
斐波那契数字。蜡烛i
的高度由当前斐波那契数的值确定。蜡烛之间用下划线(_
)分隔。
蛋糕应该对称。因此,应该将蜡烛翻转并连接起来。
示例构造
Input: 6
First 6 Fibonacci Numbers: 1, 1, 2, 3, 5, 8
Candle heights:
i
i
i
i i
i i
i i i
i i i i
i i i i i i
-----------
1 1 2 3 5 8
Output would be:
ii
ii
ii
i ii i
i ii i
i i ii i i
i i i ii i i i
i_i_i_i_i_ii_i_i_i_i_i
参考斐波那契数
作为参考,以下是前15个斐波那契数字。在这项挑战中,您将从开始1
。
1,1,2,3,5,8,13,21,34,55,89,144,233,377,610
9
我很遗憾地通知美国的西海岸,对于世界上大多数国家,11/23结束或接近尾声:(这只是从原来代码高尔夫以最快的代码
—
猫
@sysreq没关系,他们只需要立即前往西海岸,然后他们就可以在过去5个小时内享受斐波那契一日游(夏威夷7天):p
—
Downgoat
这个挑战将在43年内成为传奇(11/23/58)。
—
Arcturus
@sysreq鼓励以冗长的语言发布高尔夫球答案。当然,您并没有与Pyth竞争,但可以与相同语言或相当详细程度的语言与其他答案竞争。
—
马丁·恩德