你可能还记得你小时候的这些图画,但现在是时候让电脑画出来了(完整的ascii辉煌).玩得开心!
描述:
输入是多行(由换行符终止),描述"字段".这个领域散布着"数字"(由空格分隔).所有行都可以被认为是相同的长度(您可以将空格填充到末尾).
任务:
以这些数字的自然顺序
绘制线条(1 -> 2 -> 3 -> ...N)(假设N <= 99),具有以下特征:
+'字符替换数字-'|'/\重要笔记:
当绘制类型为4和5的线时,您可以假设(给定点与坐标x1,y1和x2,y2连接)distance(x1,x2) == distance(y1,y2).或换句话说(如用户jball评论):"非水平或垂直对齐的连续元素始终与斜杠或反斜杠的斜率对齐".
重要的是遵循点连接的顺序(较新的线可以击出较旧的线).
- 样本输入1 -
8
7 6
10 9
5
3 4
11
12 13
1 2
- 样本输出1 -
+
/|
/ +--+
+--------+ \
/ \
/ +
/ |
/ +--+
+ |
\ |
+------------------------+
+--------------------------+
- …
制作一个包含迷宫文件的程序.迷宫的墙壁由#.迷宫必须包括一个球,由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)