相关疑难解决方法(0)

斐波那契代码高尔夫

以尽可能少的字符生成Fibonacci序列.任何语言都可以,除了您使用一个运算符定义的语言f,它会打印斐波那契数字.

起点:25 14个字符哈斯克尔:

f=0:1:zipWith(+)f(tail f)

f=0:scanl(+)1f
Run Code Online (Sandbox Code Playgroud)

language-agnostic code-golf fibonacci rosetta-stone

27
推荐指数
16
解决办法
6150
查看次数

Code Golf:旋转迷宫

Code Golf:旋转迷宫


制作一个包含迷宫文件的程序.迷宫的墙壁由#.迷宫必须包括一个球,由a o和任意数量的孔给出@.迷宫文件既可以通过命令行输入,也可以通过标准输入读入.请在您的解决方案中指定哪个.

然后您的程序执行以下操作:

1: If the ball is not directly above a wall, drop it down to the nearest wall.
2: If the ball passes through a hole during step 1, remove the ball.
3: Display the maze in the standard output (followed by a newline).
   Extraneous whitespace should not be displayed.
   Extraneous whitespace is defined to be whitespace outside of a rectangle 
   that fits snugly around the maze.
4: If there is …
Run Code Online (Sandbox Code Playgroud)

language-agnostic code-golf rosetta-stone

20
推荐指数
4
解决办法
2182
查看次数