DWITE '08 R1 #1 - LaNDscAPE ii

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, October 2008, Problem 1

A classic draw some ASCII patterns problem, turned onto its horizontal side. Lets draw some hills, of various heights.

The input will contain 5 lines, integers 0 \le N \le 5.

The output will contain 5 lines, the scene generated, as described below.

Background is drawn with . (period)s, hills are triangles in shape, height specified by input, and are drawn with letter x. Refer to sample input.

Sample Input

1
2
3
0
4

Sample Output

.................
.............x...
......x.....xxx..
..x..xxx...xxxxx.
xxxxxxxxx.xxxxxxx

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments

There are no comments at the moment.