Code Golf: Diamond Pattern
- by LiraNuna
The challenge
The shortest code by character count to output a a pattern of diamonds according to the input.
The input is composed of 3 positive numbers representing the size of the diamond and the size of the grid.
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.
Test cases
Input:
1 6 2
Output:
/\/\/\/\/\/\
\/\/\/\/\/\/
/\/\/\/\/\/\
\/\/\/\/\/\/
Input:
2 2 2
Output:
/\ /\
/ \/ \
\ /\ /
\/ \/
/\ /\
/ \/ \
\ /\ /
\/ \/
Input
4 1 3
Output:
/\ /\ /\
/ \ / \ / \
/ \ / \ / \
/ \/ \/ \
\ /\ /\ /
\ / \ / \ /
\ / \ / \ /
\/ \/ \/
Code count includes input/output (i.e full program).