Write a program that inputs the dimensions of a painting, the matting width, and the frame width for a framed portrait. The program should output a diagram using the symbol X
for the painting, +
for the matting, and #
for the framing. The symbols must be space-separated. Trailing whitespace is alright, as long as the output visually matches the criteria. The inputs can be 0
.
INPUT: 3 2 1 2 (Width, Height, Matte Width, Frame Width)
OUTPUT:
In text form:
# # # # # # # # #
# # # # # # # # #
# # + + + + + # #
# # + X X X + # #
# # + X X X + # #
# # + + + + + # #
# # # # # # # # #
# # # # # # # # #
The winning code completes the conditions in the least possible bytes.