高尔夫代码:钻石图案

编程入门 行业动态 更新时间:2024-10-10 04:28:35
本文介绍了高尔夫代码:钻石图案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

按字符计数的最短代码,用于根据输入输出菱形图案.

The shortest code by character count to output a a pattern of diamonds according to the input.

输入由3个正数组成,分别代表菱形的大小和网格的大小.

The input is composed of 3 positive numbers representing the size of the diamond and the size of the grid.

由带空格的ASCII字符/和\制成菱形.大小为1的钻石是:

A diamond is made from the ASCII characters / and \ with spaces. A diamond of size 1 is:

/\ \/

网格的大小由钻石的宽度和高度组成.

The size of the grid consists from width and height of number of diamonds.

Input: 1 6 2 Output: /\/\/\/\/\/\ \/\/\/\/\/\/ /\/\/\/\/\/\ \/\/\/\/\/\/

Input: 2 2 2 Output: /\ /\ / \/ \ \ /\ / \/ \/ /\ /\ / \/ \ \ /\ / \/ \/

Input 4 3 1 Output: /\ /\ /\ / \ / \ / \ / \ / \ / \ / \/ \/ \ \ /\ /\ / \ / \ / \ / \ / \ / \ / \/ \/ \/

代码计数包括输入/​​输出(即完整程序).

Code count includes input/output (i.e full program).

推荐答案

Golfscript-50个字符

~@:3,[{[.3-~' '*\' '*'/'\.'\\'4$]2$*}%n*.-1%]*n*\;

更多推荐

高尔夫代码:钻石图案

本文发布于:2023-11-29 09:35:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646023.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:高尔夫   图案   钻石   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!