|
| 1 | +{ |
| 2 | + "exercise": "jigsaw-puzzle", |
| 3 | + "comments": [ |
| 4 | + "You need to take only a few bits of information and provide the rest", |
| 5 | + "Selecting a data format for the input and the output is important" |
| 6 | + ], |
| 7 | + "cases": [ |
| 8 | + { |
| 9 | + "uuid": "123e44cd-1388-11f0-96bc-145afc5ea279", |
| 10 | + "description": "1000 pieces puzzle with 1.6 aspect ratio", |
| 11 | + "property": "jigsawData", |
| 12 | + "input": { |
| 13 | + "pieces": 1000, |
| 14 | + "aspectRatio": 1.6 |
| 15 | + }, |
| 16 | + "expected": { |
| 17 | + "pieces": 1000, |
| 18 | + "border": 126, |
| 19 | + "inside": 874, |
| 20 | + "rows": 25, |
| 21 | + "columns": 40, |
| 22 | + "aspectRatio": 1.6, |
| 23 | + "format": "portrait" |
| 24 | + } |
| 25 | + }, |
| 26 | + { |
| 27 | + "uuid": "1da97b91-1388-11f0-a658-145afc5ea279", |
| 28 | + "description": "square puzzle with 32 rows", |
| 29 | + "property": "jigsawData", |
| 30 | + "input": { |
| 31 | + "rows": 32, |
| 32 | + "format": "square" |
| 33 | + }, |
| 34 | + "expected": { |
| 35 | + "pieces": 1024, |
| 36 | + "border": 124, |
| 37 | + "inside": 900, |
| 38 | + "rows": 32, |
| 39 | + "columns": 32, |
| 40 | + "aspectRatio": 1.0, |
| 41 | + "format": "square" |
| 42 | + } |
| 43 | + }, |
| 44 | + { |
| 45 | + "uuid": "25e21469-1388-11f0-881d-145afc5ea279", |
| 46 | + "description": "300 pieces puzzle with 70 border pieces", |
| 47 | + "property": "jigsawData", |
| 48 | + "input": { |
| 49 | + "pieces": 300, |
| 50 | + "border": 70, |
| 51 | + "inside": 230, |
| 52 | + "rows": 25, |
| 53 | + "columns": 12, |
| 54 | + "aspectRatio": 0.48, |
| 55 | + "format": "portrait" |
| 56 | + } |
| 57 | + }, |
| 58 | + { |
| 59 | + "uuid": "2d910864-1388-11f0-9a22-145afc5ea279", |
| 60 | + "description": "3d ball puzzle with 81 pieces", |
| 61 | + "property": "jigsawData", |
| 62 | + "input": { |
| 63 | + "border": 0, |
| 64 | + "inside": 82 |
| 65 | + }, |
| 66 | + "expected": { |
| 67 | + "pieces": 81, |
| 68 | + "border": 0, |
| 69 | + "inside": 81, |
| 70 | + "rows": 9, |
| 71 | + "columns": 9, |
| 72 | + "aspectRatio": 1.0, |
| 73 | + "format": "3d ball" |
| 74 | + } |
| 75 | + }, |
| 76 | + { |
| 77 | + "uuid": "32d6bfe1-1388-11f0-b268-145afc5ea279", |
| 78 | + "description": "puzzle with insufficient data", |
| 79 | + "property": "jigsawData", |
| 80 | + "input": { |
| 81 | + "pieces": 1500, |
| 82 | + "format": "landscape" |
| 83 | + }, |
| 84 | + "expected": { |
| 85 | + "error": "Insufficient data" |
| 86 | + } |
| 87 | + }, |
| 88 | + { |
| 89 | + "uuid": "42b3f426-1388-11f0-ab04-145afc5ea279", |
| 90 | + "description": "500 pieces configurations", |
| 91 | + "property": "jigsawConfigurations", |
| 92 | + "input": 100, |
| 93 | + "expected": [ |
| 94 | + { "rows": 1, "columns": 100 }, |
| 95 | + { "rows": 2, "columns": 50 }, |
| 96 | + { "rows": 4, "columns": 25 }, |
| 97 | + { "rows": 5, "columns": 20 }, |
| 98 | + { "rows": 10, "columns": 10 }, |
| 99 | + { "rows": 20, "columns": 5 }, |
| 100 | + { "rows": 25, "columns": 4 }, |
| 101 | + { "rows": 50, "columns": 2 }, |
| 102 | + { "rows": 100, "columns": 1 } |
| 103 | + ] |
| 104 | + }, |
| 105 | + { |
| 106 | + "uuid": "4ad014ab-1388-11f0-8431-145afc5ea279", |
| 107 | + "description": "prime number of pieces", |
| 108 | + "property": "jigsawConfigurations", |
| 109 | + "input": 739, |
| 110 | + "expected": [ |
| 111 | + { "rows": 1, "columns": 739 }, |
| 112 | + { "rows": 739, "columns": 1 } |
| 113 | + ] |
| 114 | + } |
| 115 | + ] |
| 116 | +} |
0 commit comments