|
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: |
4 | 2 |
|
5 | 3 | - `pieces`: Number of pieces |
6 | 4 | - `border`: Number of border pieces |
7 | 5 | - `inside`: Number of inside pieces |
8 | 6 | - `rows`: Number of rows of pieces |
9 | 7 | - `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"` |
16 | 10 |
|
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. |
18 | 12 |
|
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. |
20 | 14 |
|
21 | 15 | 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