Commit c93e018
authored
* Issue #34 solution - hashcode for dominoes.
* Add a comment in the Domino class making explicit that
changes in the Domino class are not accepted by the solution. (Believe
me,
I was really surprised during my first submission that my changes in the
Domino class were rejected. As well as my mentee ).
* Change the way equals and hashcode are implemented to use the
min+max value of each side instead of left+right.
* Added a constraint validation within the Domino class constructor,
that tiles must
have a maximum number of 9 on each side (this is needed for the hash
implementation).
* In the equals code, a comparison between a Domino and an Object would
generate a
class cast exception instead of the expected value, false.
* Issue #34 - fix lack of ()
* checkstyle fixes
[no important files changed]
1 parent 4dd7e25 commit c93e018
File tree
2 files changed
+29
-12
lines changed- exercises/practice/dominoes
- .meta/src/reference/java
- src/main/java
2 files changed
+29
-12
lines changedLines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
| 13 | + | |
9 | 14 | | |
10 | | - | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | | - | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | | - | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | | - | |
23 | | - | |
| 30 | + | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| 9 | + | |
6 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | | - | |
23 | | - | |
| 33 | + | |
24 | 34 | | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
28 | | - | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
0 commit comments