Skip to content

Commit 51a71c8

Browse files
committed
address pr comments
1 parent 6d7e651 commit 51a71c8

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

exercises/jigsaw-puzzle/canonical-data.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@
4343
},
4444
{
4545
"uuid": "25e21469-1388-11f0-881d-145afc5ea279",
46-
"description": "300 pieces puzzle with 70 border pieces",
46+
"description": "300 pieces portrait puzzle with 70 border pieces",
4747
"property": "jigsawData",
4848
"input": {
49+
"pieces": 300,
50+
"border": 70,
51+
"format": "portrait"
52+
},
53+
"expected": {
4954
"pieces": 300,
5055
"border": 70,
5156
"inside": 230,
@@ -57,7 +62,7 @@
5762
},
5863
{
5964
"uuid": "2d910864-1388-11f0-9a22-145afc5ea279",
60-
"description": "3d ball puzzle with 81 pieces",
65+
"description": "puzzle globe with 81 pieces",
6166
"property": "jigsawData",
6267
"input": {
6368
"border": 0,
@@ -70,7 +75,7 @@
7075
"rows": 9,
7176
"columns": 9,
7277
"aspectRatio": 1.0,
73-
"format": "3d ball"
78+
"format": "globe"
7479
}
7580
},
7681
{
@@ -85,9 +90,19 @@
8590
"error": "Insufficient data"
8691
}
8792
},
93+
{
94+
"uuid": "744de990-13bb-11f0-8731-145afc5ea279",
95+
"description": "pizzle with contradictory data",
96+
"property": "jigsawData",
97+
"input": {
98+
"rows": "100",
99+
"columns": "1000",
100+
"format": "square"
101+
}
102+
},
88103
{
89104
"uuid": "42b3f426-1388-11f0-ab04-145afc5ea279",
90-
"description": "500 pieces configurations",
105+
"description": "100 pieces configurations",
91106
"property": "jigsawConfigurations",
92107
"input": 100,
93108
"expected": [
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
### Task 1
2-
3-
Provide a function `jigsawData` that receives a part of the information and fills in the blanks. If the provided information is insufficient to calculate the rest, there should be an error "Insufficient information". The full information about the jigsaw puzzle contains
1+
You get part of the information and need to fills in the blanks. If the provided information is insufficient to calculate the rest, there should be an error "Insufficient information". If the data given is contradictory, there should be an error "Contradictory information" The full information about the jigsaw puzzle contains the following parts:
42

53
- `pieces`: Number of pieces
64
- `border`: Number of border pieces
75
- `inside`: Number of inside pieces
86
- `rows`: Number of rows of pieces
97
- `columns`: Number of columns of pieces
10-
- `aspecRatio`: Aspect ratio of columns / rows
11-
- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "3d ball"`
12-
13-
For the rows and columns of a 3d ball puzzle, assume a square distribution.
14-
15-
### Task 2
8+
- `aspectRatio`: Aspect ratio of columns / rows
9+
- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "globe"`
1610

17-
Spoilt by the comfort of your helper, your friend now no longer wants to count border pieces, so they want another function that gives them a list of the possible even rows/columns configuration for a number of pieces, so they can estimate from the picture in the future.
11+
For the rows and columns of a puzzle globe, assume an aspect ratio of 1.0, so rows and columns are identical.
1812

19-
Write a `jigsawConfigurations` function that takes the number of pieces and returns an array of the possible numbers of rows and columns.
13+
Spoilt by the comfort of your helper, your friend now no longer wants to count border pieces. To help with estimating, you take the number of pieces and return an array of the possible numbers of rows and columns.
2014

2115
Start with the lowest number of rows and work your way up from there. While a single-row jigsaw puzzle might be a strange novelty, it is theoretically possible, so you should include this case.

0 commit comments

Comments
 (0)