|
1 | 1 | # Description |
2 | 2 |
|
3 | | -The diamond kata takes as its input a letter, and outputs it in a diamond shape. |
4 | | -Given a letter, it prints a diamond starting with 'A', with the supplied letter at the widest point. |
| 3 | +Your objective is to draw out a diamond using letters and spaces. |
5 | 4 |
|
6 | | -## Requirements |
7 | | - |
8 | | -- The first row contains one 'A'. |
9 | | -- The last row contains one 'A'. |
10 | | -- All rows, except the first and last, have exactly two identical letters. |
11 | | -- All rows have as many trailing spaces as leading spaces. (This might be 0). |
12 | | -- The diamond is horizontally symmetric. |
13 | | -- The diamond is vertically symmetric. |
14 | | -- The diamond has a square shape (width equals height). |
15 | | -- The letters form a diamond shape. |
16 | | -- The top half has the letters in ascending order. |
17 | | -- The bottom half has the letters in descending order. |
18 | | -- The four corners (containing the spaces) are triangles. |
19 | | - |
20 | | -## Examples |
21 | | - |
22 | | -In the following examples, spaces are indicated by `·` characters. |
| 5 | +You're given a letter which signifies the widest point of the diamond. |
| 6 | +Let's look at some examples. |
23 | 7 |
|
24 | 8 | Diamond for letter 'A': |
25 | 9 |
|
|
30 | 14 | Diamond for letter 'C': |
31 | 15 |
|
32 | 16 | ```text |
33 | | -··A·· |
34 | | -·B·B· |
35 | | -C···C |
36 | | -·B·B· |
37 | | -··A·· |
| 17 | + A |
| 18 | + B B |
| 19 | +C C |
| 20 | + B B |
| 21 | + A |
38 | 22 | ``` |
39 | 23 |
|
40 | 24 | Diamond for letter 'E': |
41 | 25 |
|
42 | 26 | ```text |
43 | | -····A···· |
44 | | -···B·B··· |
45 | | -··C···C·· |
46 | | -·D·····D· |
47 | | -E·······E |
48 | | -·D·····D· |
49 | | -··C···C·· |
50 | | -···B·B··· |
51 | | -····A···· |
| 27 | + A |
| 28 | + B B |
| 29 | + C C |
| 30 | + D D |
| 31 | +E E |
| 32 | + D D |
| 33 | + C C |
| 34 | + B B |
| 35 | + A |
52 | 36 | ``` |
| 37 | + |
| 38 | + |
| 39 | +## Requirements |
| 40 | + |
| 41 | +These are the full requirements: |
| 42 | + |
| 43 | +- The first row contains one 'A'. |
| 44 | +- The last row contains one 'A'. |
| 45 | +- All rows, except the first and last, have exactly two identical letters. |
| 46 | +- All rows have as many trailing spaces as leading spaces. (This might be 0). |
| 47 | +- The diamond is horizontally symmetric. |
| 48 | +- The diamond is vertically symmetric. |
| 49 | +- The diamond has a square shape (width equals height). |
| 50 | +- The letters form a diamond shape. |
| 51 | +- The top half has the letters in ascending order. |
| 52 | +- The bottom half has the letters in descending order. |
| 53 | +- The four corners (containing the spaces) are triangles. |
0 commit comments