Skip to content

Commit acfce29

Browse files
authored
Update Diamond
1 parent 72c16a8 commit acfce29

File tree

1 file changed

+34
-33
lines changed

1 file changed

+34
-33
lines changed

exercises/diamond/description.md

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
# Description
22

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.
54

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.
237

248
Diamond for letter 'A':
259

@@ -30,23 +14,40 @@ A
3014
Diamond for letter 'C':
3115

3216
```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
3822
```
3923

4024
Diamond for letter 'E':
4125

4226
```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
5236
```
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

Comments
 (0)