From 901edbf24f2033b06772f69584e16363cc3cf672 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 7 Apr 2025 10:29:09 +0200 Subject: [PATCH 01/31] Add 'jigsaw-puzzle' exercise --- exercises/jigsaw-puzzle/canonical-data.json | 116 ++++++++++++++++++++ exercises/jigsaw-puzzle/instructions.md | 21 ++++ exercises/jigsaw-puzzle/introduction.md | 1 + exercises/jigsaw-puzzle/metadata.toml | 3 + 4 files changed, 141 insertions(+) create mode 100644 exercises/jigsaw-puzzle/canonical-data.json create mode 100644 exercises/jigsaw-puzzle/instructions.md create mode 100644 exercises/jigsaw-puzzle/introduction.md create mode 100644 exercises/jigsaw-puzzle/metadata.toml diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json new file mode 100644 index 000000000..a9caa5560 --- /dev/null +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -0,0 +1,116 @@ +{ + "exercise": "jigsaw-puzzle", + "comments": [ + "You need to take only a few bits of information and provide the rest", + "Selecting a data format for the input and the output is important" + ], + "cases": [ + { + "uuid": "123e44cd-1388-11f0-96bc-145afc5ea279", + "description": "1000 pieces puzzle with 1.6 aspect ratio", + "property": "jigsawData", + "input": { + "pieces": 1000, + "aspectRatio": 1.6 + }, + "expected": { + "pieces": 1000, + "border": 126, + "inside": 874, + "rows": 25, + "columns": 40, + "aspectRatio": 1.6, + "format": "portrait" + } + }, + { + "uuid": "1da97b91-1388-11f0-a658-145afc5ea279", + "description": "square puzzle with 32 rows", + "property": "jigsawData", + "input": { + "rows": 32, + "format": "square" + }, + "expected": { + "pieces": 1024, + "border": 124, + "inside": 900, + "rows": 32, + "columns": 32, + "aspectRatio": 1.0, + "format": "square" + } + }, + { + "uuid": "25e21469-1388-11f0-881d-145afc5ea279", + "description": "300 pieces puzzle with 70 border pieces", + "property": "jigsawData", + "input": { + "pieces": 300, + "border": 70, + "inside": 230, + "rows": 25, + "columns": 12, + "aspectRatio": 0.48, + "format": "portrait" + } + }, + { + "uuid": "2d910864-1388-11f0-9a22-145afc5ea279", + "description": "3d ball puzzle with 81 pieces", + "property": "jigsawData", + "input": { + "border": 0, + "inside": 82 + }, + "expected": { + "pieces": 81, + "border": 0, + "inside": 81, + "rows": 9, + "columns": 9, + "aspectRatio": 1.0, + "format": "3d ball" + } + }, + { + "uuid": "32d6bfe1-1388-11f0-b268-145afc5ea279", + "description": "puzzle with insufficient data", + "property": "jigsawData", + "input": { + "pieces": 1500, + "format": "landscape" + }, + "expected": { + "error": "Insufficient data" + } + }, + { + "uuid": "42b3f426-1388-11f0-ab04-145afc5ea279", + "description": "500 pieces configurations", + "property": "jigsawConfigurations", + "input": 100, + "expected": [ + { "rows": 1, "columns": 100 }, + { "rows": 2, "columns": 50 }, + { "rows": 4, "columns": 25 }, + { "rows": 5, "columns": 20 }, + { "rows": 10, "columns": 10 }, + { "rows": 20, "columns": 5 }, + { "rows": 25, "columns": 4 }, + { "rows": 50, "columns": 2 }, + { "rows": 100, "columns": 1 } + ] + }, + { + "uuid": "4ad014ab-1388-11f0-8431-145afc5ea279", + "description": "prime number of pieces", + "property": "jigsawConfigurations", + "input": 739, + "expected": [ + { "rows": 1, "columns": 739 }, + { "rows": 739, "columns": 1 } + ] + } + ] +} diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md new file mode 100644 index 000000000..a663eb8da --- /dev/null +++ b/exercises/jigsaw-puzzle/instructions.md @@ -0,0 +1,21 @@ +### Task 1 + +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 + +- `pieces`: Number of pieces +- `border`: Number of border pieces +- `inside`: Number of inside pieces +- `rows`: Number of rows of pieces +- `columns`: Number of columns of pieces +- `aspecRatio`: Aspect ratio of columns / rows +- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "3d ball"` + +For the rows and columns of a 3d ball puzzle, assume a square distribution. + +### Task 2 + +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. + +Write a `jigsawConfigurations` function that takes the number of pieces and returns an array of the possible numbers of rows and columns. + +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. diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md new file mode 100644 index 000000000..f6bc9ee12 --- /dev/null +++ b/exercises/jigsaw-puzzle/introduction.md @@ -0,0 +1 @@ +Your best friend started to collect puzzles. A catalogue the collection should contain as much information as possible. After solving one of the puzzles to count the rows, columns, amount of border and inside pieces, you are tasked to provide some helper functions. \ No newline at end of file diff --git a/exercises/jigsaw-puzzle/metadata.toml b/exercises/jigsaw-puzzle/metadata.toml new file mode 100644 index 000000000..203fcd661 --- /dev/null +++ b/exercises/jigsaw-puzzle/metadata.toml @@ -0,0 +1,3 @@ +title = "Puzzle Helper" +blurb = "Calculate data about puzzles" +source = "atk just started another 1000-pieces puzzle when this idea hit him" \ No newline at end of file From 58812e9a1bda9b6b3010f808c99bbb4a5f0c1728 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 7 Apr 2025 16:30:49 +0200 Subject: [PATCH 02/31] address pr comments --- exercises/jigsaw-puzzle/canonical-data.json | 23 +++++++++++++++++---- exercises/jigsaw-puzzle/instructions.md | 16 +++++--------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index a9caa5560..11fd536b1 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -43,9 +43,14 @@ }, { "uuid": "25e21469-1388-11f0-881d-145afc5ea279", - "description": "300 pieces puzzle with 70 border pieces", + "description": "300 pieces portrait puzzle with 70 border pieces", "property": "jigsawData", "input": { + "pieces": 300, + "border": 70, + "format": "portrait" + }, + "expected": { "pieces": 300, "border": 70, "inside": 230, @@ -57,7 +62,7 @@ }, { "uuid": "2d910864-1388-11f0-9a22-145afc5ea279", - "description": "3d ball puzzle with 81 pieces", + "description": "puzzle globe with 81 pieces", "property": "jigsawData", "input": { "border": 0, @@ -70,7 +75,7 @@ "rows": 9, "columns": 9, "aspectRatio": 1.0, - "format": "3d ball" + "format": "globe" } }, { @@ -85,9 +90,19 @@ "error": "Insufficient data" } }, + { + "uuid": "744de990-13bb-11f0-8731-145afc5ea279", + "description": "pizzle with contradictory data", + "property": "jigsawData", + "input": { + "rows": "100", + "columns": "1000", + "format": "square" + } + }, { "uuid": "42b3f426-1388-11f0-ab04-145afc5ea279", - "description": "500 pieces configurations", + "description": "100 pieces configurations", "property": "jigsawConfigurations", "input": 100, "expected": [ diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index a663eb8da..d6745fbe3 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -1,21 +1,15 @@ -### Task 1 - -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 +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: - `pieces`: Number of pieces - `border`: Number of border pieces - `inside`: Number of inside pieces - `rows`: Number of rows of pieces - `columns`: Number of columns of pieces -- `aspecRatio`: Aspect ratio of columns / rows -- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "3d ball"` - -For the rows and columns of a 3d ball puzzle, assume a square distribution. - -### Task 2 +- `aspectRatio`: Aspect ratio of columns / rows +- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "globe"` -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. +For the rows and columns of a puzzle globe, assume an aspect ratio of 1.0, so rows and columns are identical. -Write a `jigsawConfigurations` function that takes the number of pieces and returns an array of the possible numbers of rows and columns. +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. 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. From fb39822370c52c87f129af53ad1762c61cf4c215 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 8 Apr 2025 08:59:29 +0200 Subject: [PATCH 03/31] address pr comments, 2nd part --- exercises/jigsaw-puzzle/instructions.md | 12 ++++++++---- exercises/jigsaw-puzzle/metadata.toml | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index d6745fbe3..18009e884 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -1,4 +1,6 @@ -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: +You get part of the information and need to fills in the blanks. +In case the data is insufficient or contradictory the user needs to be notified of the issue. +The full information about the jigsaw puzzle contains the following parts: - `pieces`: Number of pieces - `border`: Number of border pieces @@ -8,8 +10,10 @@ You get part of the information and need to fills in the blanks. If the provided - `aspectRatio`: Aspect ratio of columns / rows - `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "globe"` -For the rows and columns of a puzzle globe, assume an aspect ratio of 1.0, so rows and columns are identical. +For the rows and columns of a puzzle globe, assume an aspect ratio of 1.0, so that rows and columns are identical. -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. +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. -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. +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. diff --git a/exercises/jigsaw-puzzle/metadata.toml b/exercises/jigsaw-puzzle/metadata.toml index 203fcd661..f7be5b4de 100644 --- a/exercises/jigsaw-puzzle/metadata.toml +++ b/exercises/jigsaw-puzzle/metadata.toml @@ -1,3 +1,3 @@ -title = "Puzzle Helper" -blurb = "Calculate data about puzzles" -source = "atk just started another 1000-pieces puzzle when this idea hit him" \ No newline at end of file +title = "Jigsaw Puzzle" +blurb = "Calculating the number of certain pieces (row/column/border/inside/etc.) of a jigsaw puzzle" +source = "atk just started another 1000-pieces jigsaw puzzle when this idea hit him" \ No newline at end of file From fa94f0039b0322504c6535219ae1cc0541cf7a13 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 8 Apr 2025 13:05:09 +0200 Subject: [PATCH 04/31] input format for configurations, blurb improvements --- exercises/jigsaw-puzzle/canonical-data.json | 4 ++-- exercises/jigsaw-puzzle/metadata.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 11fd536b1..62dd90af0 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -104,7 +104,7 @@ "uuid": "42b3f426-1388-11f0-ab04-145afc5ea279", "description": "100 pieces configurations", "property": "jigsawConfigurations", - "input": 100, + "input": { "pieces": 100 }, "expected": [ { "rows": 1, "columns": 100 }, { "rows": 2, "columns": 50 }, @@ -121,7 +121,7 @@ "uuid": "4ad014ab-1388-11f0-8431-145afc5ea279", "description": "prime number of pieces", "property": "jigsawConfigurations", - "input": 739, + "input": { "pieces": 739 }, "expected": [ { "rows": 1, "columns": 739 }, { "rows": 739, "columns": 1 } diff --git a/exercises/jigsaw-puzzle/metadata.toml b/exercises/jigsaw-puzzle/metadata.toml index f7be5b4de..d8677b152 100644 --- a/exercises/jigsaw-puzzle/metadata.toml +++ b/exercises/jigsaw-puzzle/metadata.toml @@ -1,3 +1,3 @@ title = "Jigsaw Puzzle" -blurb = "Calculating the number of certain pieces (row/column/border/inside/etc.) of a jigsaw puzzle" +blurb = "Fill in missing jigsaw puzzle details from partial data" source = "atk just started another 1000-pieces jigsaw puzzle when this idea hit him" \ No newline at end of file From 47221ef06688f66933209822272b1eb8615e2e67 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 8 Apr 2025 13:16:20 +0200 Subject: [PATCH 05/31] add missing expectation, instructions updates --- exercises/jigsaw-puzzle/canonical-data.json | 3 +++ exercises/jigsaw-puzzle/instructions.md | 7 ++++--- exercises/jigsaw-puzzle/introduction.md | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 62dd90af0..e01ce4d14 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -98,6 +98,9 @@ "rows": "100", "columns": "1000", "format": "square" + }, + "expected": { + "error": "Contradictory data" } }, { diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index 18009e884..4139d893f 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -8,12 +8,13 @@ The full information about the jigsaw puzzle contains the following parts: - `rows`: Number of rows of pieces - `columns`: Number of columns of pieces - `aspectRatio`: Aspect ratio of columns / rows -- `format`: Format of the puzzle: `"portrait" / "square" / "landscape" / "globe"` +- `format`: Puzzle format, which can be `portrait`, `square`, `landscape`, or `globe` -For the rows and columns of a puzzle globe, assume an aspect ratio of 1.0, so that rows and columns are identical. +For a puzzle in `globe` format, assume an aspect ratio of 1.0. 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. +To help with estimating, you take the number of pieces and return a list of the possible numbers of rows and columns. 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. + diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md index f6bc9ee12..ca5bfed48 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/jigsaw-puzzle/introduction.md @@ -1 +1,5 @@ -Your best friend started to collect puzzles. A catalogue the collection should contain as much information as possible. After solving one of the puzzles to count the rows, columns, amount of border and inside pieces, you are tasked to provide some helper functions. \ No newline at end of file +# Introduction + +Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalogue for the collection — recording information like the number of pieces, rows, columns, border pieces, inside pieces, aspect ratio, and the puzzle's format. +After solving one of the puzzles to figure out these details, you're now helping fill in the gaps for others in the collection, even when some data is missing. + From 81302e3bcf199b7ed819d17a256e35ca64f48cb7 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 8 Apr 2025 15:57:29 +0200 Subject: [PATCH 06/31] fix typo --- exercises/jigsaw-puzzle/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index e01ce4d14..135b3adf0 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -66,7 +66,7 @@ "property": "jigsawData", "input": { "border": 0, - "inside": 82 + "inside": 81 }, "expected": { "pieces": 81, From 1ada7f35763c2aab387a9fb91e0d2579c73c52dd Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 8 Apr 2025 16:22:48 +0200 Subject: [PATCH 07/31] improve explanation --- exercises/jigsaw-puzzle/instructions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index 4139d893f..52cee9336 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -12,8 +12,10 @@ The full information about the jigsaw puzzle contains the following parts: For a puzzle in `globe` format, assume an aspect ratio of 1.0. -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 a list of the possible numbers of rows and columns. +After a short while, your friend found out that entering the number of pieces, the number of border pieces and the format was the fastest way to get all the information for their collection catalogue with the least amount of manual work. + +But your friend has grown tired of counting border pieces. +To help with estimating the information of their puzzles, you should take the number of pieces and return all the possible numbers of rows and columns. 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. From a3c52620aed6df320adc5b2f6540067b97700179 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 9 Apr 2025 09:12:39 +0200 Subject: [PATCH 08/31] remove second part --- exercises/jigsaw-puzzle/canonical-data.json | 47 +-------------------- exercises/jigsaw-puzzle/instructions.md | 13 ++---- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 135b3adf0..5995f34bc 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -20,7 +20,7 @@ "rows": 25, "columns": 40, "aspectRatio": 1.6, - "format": "portrait" + "format": "landscape" } }, { @@ -60,24 +60,6 @@ "format": "portrait" } }, - { - "uuid": "2d910864-1388-11f0-9a22-145afc5ea279", - "description": "puzzle globe with 81 pieces", - "property": "jigsawData", - "input": { - "border": 0, - "inside": 81 - }, - "expected": { - "pieces": 81, - "border": 0, - "inside": 81, - "rows": 9, - "columns": 9, - "aspectRatio": 1.0, - "format": "globe" - } - }, { "uuid": "32d6bfe1-1388-11f0-b268-145afc5ea279", "description": "puzzle with insufficient data", @@ -102,33 +84,6 @@ "expected": { "error": "Contradictory data" } - }, - { - "uuid": "42b3f426-1388-11f0-ab04-145afc5ea279", - "description": "100 pieces configurations", - "property": "jigsawConfigurations", - "input": { "pieces": 100 }, - "expected": [ - { "rows": 1, "columns": 100 }, - { "rows": 2, "columns": 50 }, - { "rows": 4, "columns": 25 }, - { "rows": 5, "columns": 20 }, - { "rows": 10, "columns": 10 }, - { "rows": 20, "columns": 5 }, - { "rows": 25, "columns": 4 }, - { "rows": 50, "columns": 2 }, - { "rows": 100, "columns": 1 } - ] - }, - { - "uuid": "4ad014ab-1388-11f0-8431-145afc5ea279", - "description": "prime number of pieces", - "property": "jigsawConfigurations", - "input": { "pieces": 739 }, - "expected": [ - { "rows": 1, "columns": 739 }, - { "rows": 739, "columns": 1 } - ] } ] } diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index 52cee9336..efd18c16b 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -8,15 +8,8 @@ The full information about the jigsaw puzzle contains the following parts: - `rows`: Number of rows of pieces - `columns`: Number of columns of pieces - `aspectRatio`: Aspect ratio of columns / rows -- `format`: Puzzle format, which can be `portrait`, `square`, `landscape`, or `globe` +- `format`: Puzzle format, which can be `portrait`, `square`, or `landscape` -For a puzzle in `globe` format, assume an aspect ratio of 1.0. - -After a short while, your friend found out that entering the number of pieces, the number of border pieces and the format was the fastest way to get all the information for their collection catalogue with the least amount of manual work. - -But your friend has grown tired of counting border pieces. -To help with estimating the information of their puzzles, you should take the number of pieces and return all the possible numbers of rows and columns. - -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. +For the sake of the exercise, you may assume square pieces, so that the format can be derived from the aspect ratio. +If it is lower than one, it is portrait, if exactly one, it is square and larger than one is landscape. From 62a5d73305b3a1c9798f6e4b38dc40feff76a0f1 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 9 Apr 2025 09:14:25 +0200 Subject: [PATCH 09/31] fix json format --- exercises/jigsaw-puzzle/canonical-data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 5995f34bc..de47145c0 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -77,8 +77,8 @@ "description": "pizzle with contradictory data", "property": "jigsawData", "input": { - "rows": "100", - "columns": "1000", + "rows": 100, + "columns": 1000, "format": "square" }, "expected": { From 38ac4de64379283c9ed23861c99636444b179135 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 9 Apr 2025 09:48:50 +0200 Subject: [PATCH 10/31] Update exercises/jigsaw-puzzle/introduction.md Co-authored-by: Erik Schierboom --- exercises/jigsaw-puzzle/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md index ca5bfed48..a01904f49 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/jigsaw-puzzle/introduction.md @@ -1,5 +1,5 @@ # Introduction -Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalogue for the collection — recording information like the number of pieces, rows, columns, border pieces, inside pieces, aspect ratio, and the puzzle's format. +Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalogue for their collection — recording information like the number of pieces, rows, columns, border pieces, inside pieces, aspect ratio, and the puzzle's format. After solving one of the puzzles to figure out these details, you're now helping fill in the gaps for others in the collection, even when some data is missing. From 8c79c78836f64bd64f0b06d292fff0761a2d2588 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Fri, 11 Apr 2025 13:01:04 +0200 Subject: [PATCH 11/31] fix: linter issues --- exercises/jigsaw-puzzle/instructions.md | 3 ++- exercises/jigsaw-puzzle/introduction.md | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index efd18c16b..fc12b23b2 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -1,3 +1,5 @@ +# Instructions + You get part of the information and need to fills in the blanks. In case the data is insufficient or contradictory the user needs to be notified of the issue. The full information about the jigsaw puzzle contains the following parts: @@ -12,4 +14,3 @@ The full information about the jigsaw puzzle contains the following parts: For the sake of the exercise, you may assume square pieces, so that the format can be derived from the aspect ratio. If it is lower than one, it is portrait, if exactly one, it is square and larger than one is landscape. - diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md index a01904f49..2672c27d8 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/jigsaw-puzzle/introduction.md @@ -2,4 +2,3 @@ Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalogue for their collection — recording information like the number of pieces, rows, columns, border pieces, inside pieces, aspect ratio, and the puzzle's format. After solving one of the puzzles to figure out these details, you're now helping fill in the gaps for others in the collection, even when some data is missing. - From 4ae05cdba5aaea75a90b175429e0e27717a3edc4 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Fri, 11 Apr 2025 13:05:49 +0200 Subject: [PATCH 12/31] fix: uuids require uuid v4 --- exercises/jigsaw-puzzle/canonical-data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index de47145c0..e6a1cf67b 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -6,7 +6,7 @@ ], "cases": [ { - "uuid": "123e44cd-1388-11f0-96bc-145afc5ea279", + "uuid": "ad626f23-09a2-4f5f-ba22-eec0671fa2a9", "description": "1000 pieces puzzle with 1.6 aspect ratio", "property": "jigsawData", "input": { @@ -24,7 +24,7 @@ } }, { - "uuid": "1da97b91-1388-11f0-a658-145afc5ea279", + "uuid": "3e0c5919-3561-42f5-b9ed-26d70c20214e", "description": "square puzzle with 32 rows", "property": "jigsawData", "input": { @@ -42,7 +42,7 @@ } }, { - "uuid": "25e21469-1388-11f0-881d-145afc5ea279", + "uuid": "f6378369-989c-497f-a6e2-f30b1fa76cba", "description": "300 pieces portrait puzzle with 70 border pieces", "property": "jigsawData", "input": { @@ -61,7 +61,7 @@ } }, { - "uuid": "32d6bfe1-1388-11f0-b268-145afc5ea279", + "uuid": "f53f82ba-5663-4c7e-9e86-57fdbb3e53d2", "description": "puzzle with insufficient data", "property": "jigsawData", "input": { @@ -73,7 +73,7 @@ } }, { - "uuid": "744de990-13bb-11f0-8731-145afc5ea279", + "uuid": "a3d5c31a-cc74-44bf-b4fc-9e4d65f1ac1a", "description": "pizzle with contradictory data", "property": "jigsawData", "input": { From ac36f29d799a9f3042b14b9d116d615ffc7c74e9 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sat, 12 Apr 2025 15:13:28 +0200 Subject: [PATCH 13/31] improve wording --- exercises/jigsaw-puzzle/instructions.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index fc12b23b2..8cca6e73c 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -1,16 +1,19 @@ # Instructions -You get part of the information and need to fills in the blanks. -In case the data is insufficient or contradictory the user needs to be notified of the issue. +Given partial information about a jigsaw puzzle, complete the remaining details. + +If the information is insufficient to complete the details, or if it contains contradictions, the user should be notified. + The full information about the jigsaw puzzle contains the following parts: -- `pieces`: Number of pieces +- `pieces`: Total number of pieces - `border`: Number of border pieces - `inside`: Number of inside pieces -- `rows`: Number of rows of pieces -- `columns`: Number of columns of pieces -- `aspectRatio`: Aspect ratio of columns / rows +- `rows`: Number of rows +- `columns`: Number of columns +- `aspectRatio`: Aspect ratio of columns to rows - `format`: Puzzle format, which can be `portrait`, `square`, or `landscape` For the sake of the exercise, you may assume square pieces, so that the format can be derived from the aspect ratio. + If it is lower than one, it is portrait, if exactly one, it is square and larger than one is landscape. From 2e707c754fb7c0d4b7bbf2d7d8e6561e969e741f Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sun, 13 Apr 2025 22:53:15 +0200 Subject: [PATCH 14/31] Update exercises/jigsaw-puzzle/instructions.md Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/jigsaw-puzzle/instructions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index 8cca6e73c..820cde890 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -14,6 +14,8 @@ The full information about the jigsaw puzzle contains the following parts: - `aspectRatio`: Aspect ratio of columns to rows - `format`: Puzzle format, which can be `portrait`, `square`, or `landscape` -For the sake of the exercise, you may assume square pieces, so that the format can be derived from the aspect ratio. +For this exercise, you may assume square pieces, so that the format can be derived from the aspect ratio: -If it is lower than one, it is portrait, if exactly one, it is square and larger than one is landscape. +- If the aspect ratio is less than 1, it's `portrait` +- If it is equal to 1, it's `square` +- If it is greater than 1, it's `landscape` From d1bc3e6332db8044c55cf8417f3f8458392ed97a Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sun, 13 Apr 2025 22:53:24 +0200 Subject: [PATCH 15/31] Update exercises/jigsaw-puzzle/introduction.md Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/jigsaw-puzzle/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md index 2672c27d8..0d832eaf4 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/jigsaw-puzzle/introduction.md @@ -1,4 +1,4 @@ # Introduction -Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalogue for their collection — recording information like the number of pieces, rows, columns, border pieces, inside pieces, aspect ratio, and the puzzle's format. +Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalog of their collection — recording information such as the total number of pieces, the number of rows and columns, the number of border and inside pieces, aspect ratio, and puzzle format. After solving one of the puzzles to figure out these details, you're now helping fill in the gaps for others in the collection, even when some data is missing. From 0616157bb00ea34008436e8eb456914d0fa36052 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sun, 13 Apr 2025 22:53:36 +0200 Subject: [PATCH 16/31] Update exercises/jigsaw-puzzle/canonical-data.json Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/jigsaw-puzzle/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index e6a1cf67b..984e05461 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -74,7 +74,7 @@ }, { "uuid": "a3d5c31a-cc74-44bf-b4fc-9e4d65f1ac1a", - "description": "pizzle with contradictory data", + "description": "puzzle with contradictory data", "property": "jigsawData", "input": { "rows": 100, From 007593dcd86915adff72f5fbbf33025f65f503d3 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 15 Apr 2025 08:11:05 +0200 Subject: [PATCH 17/31] Add more tests --- exercises/jigsaw-puzzle/canonical-data.json | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 984e05461..bb9c2501d 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -41,6 +41,42 @@ "format": "square" } }, + { + "uuid": "1126f160-b094-4dc2-bf37-13e36e394867", + "description": "400 pieces square puzzle with only inside pieces and aspec ratio", + "property": "jigsawData", + "input": { + "inside": 324, + "aspectRatio": 1.0 + }, + "expected": { + "pieces": 400, + "border": 76, + "inside": 324, + "rows": 20, + "columns": 20, + "aspectRatio": 1.0, + "format": "square" + } + }, + { + "uuid": "a9743178-5642-4cc0-8fdb-00d6b031c3a0", + "description": "1500 pieces landscape puzzle with 30 rows and 1.6 aspect ratio", + "property": "jigsawData", + "input": { + "rows": 30, + "aspectRatio": 1.6666666666666667 + }, + "expected": { + "pieces": 1500, + "border": 156, + "inside": 1344, + "rows": 30, + "columns": 50, + "aspectRatio": 1.6666666666666667, + "format": "landscape" + } + }, { "uuid": "f6378369-989c-497f-a6e2-f30b1fa76cba", "description": "300 pieces portrait puzzle with 70 border pieces", From 824ac43c4d01e3195d837066e1ed68c05fcc5890 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 15 Apr 2025 11:06:05 +0200 Subject: [PATCH 18/31] Fix typo in canonical data Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/jigsaw-puzzle/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index bb9c2501d..3a4954d28 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -43,7 +43,7 @@ }, { "uuid": "1126f160-b094-4dc2-bf37-13e36e394867", - "description": "400 pieces square puzzle with only inside pieces and aspec ratio", + "description": "400 pieces square puzzle with only inside pieces and aspect ratio", "property": "jigsawData", "input": { "inside": 324, From eba955ffa0120c8658a2391a6e1ba6aa792e8b18 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 16 Apr 2025 10:04:54 +0200 Subject: [PATCH 19/31] document aspect ratio choice --- exercises/jigsaw-puzzle/canonical-data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 3a4954d28..71829df92 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -1,8 +1,8 @@ { "exercise": "jigsaw-puzzle", "comments": [ - "You need to take only a few bits of information and provide the rest", - "Selecting a data format for the input and the output is important" + "For the aspect ratio, rational numbers can be used for languages without IEEE-754 support", + "If rational numbers are used, they need to be reduced to the lowest term to avoid ambiguity" ], "cases": [ { From a1c5a6936122595df09f23063ac8ab4356279132 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Thu, 24 Apr 2025 11:20:32 +0200 Subject: [PATCH 20/31] Make comment more understandable Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/jigsaw-puzzle/canonical-data.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/jigsaw-puzzle/canonical-data.json index 71829df92..102510498 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/jigsaw-puzzle/canonical-data.json @@ -1,8 +1,10 @@ { "exercise": "jigsaw-puzzle", "comments": [ - "For the aspect ratio, rational numbers can be used for languages without IEEE-754 support", - "If rational numbers are used, they need to be reduced to the lowest term to avoid ambiguity" + "For the aspect ratio, rational numbers can be used for languages without", + "IEEE-754 support. Their representation depends on the track (e.g., a tuple like", + "[numerator, denominator], a string like '3/4', or a custom rational type).", + "The represented fractions should be reduced to lowest terms to avoid ambiguity." ], "cases": [ { From 57eb31dfb0a38b3732d1e37803f8c4310c97162f Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 28 Apr 2025 16:15:05 +0200 Subject: [PATCH 21/31] Add source_url Co-authored-by: Erik Schierboom --- exercises/jigsaw-puzzle/metadata.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/metadata.toml b/exercises/jigsaw-puzzle/metadata.toml index d8677b152..058370bc7 100644 --- a/exercises/jigsaw-puzzle/metadata.toml +++ b/exercises/jigsaw-puzzle/metadata.toml @@ -1,3 +1,4 @@ title = "Jigsaw Puzzle" blurb = "Fill in missing jigsaw puzzle details from partial data" -source = "atk just started another 1000-pieces jigsaw puzzle when this idea hit him" \ No newline at end of file +source = "atk just started another 1000-pieces jigsaw puzzle when this idea hit him" +source_url = "https://github.com/exercism/problem-specifications/pull/2554" \ No newline at end of file From f12e79de291bbebb0e7c34a2c4b74c0edbd61664 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 28 Apr 2025 16:15:40 +0200 Subject: [PATCH 22/31] Clarify inside pieces Co-authored-by: Erik Schierboom --- exercises/jigsaw-puzzle/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/jigsaw-puzzle/instructions.md index 820cde890..5032cb7d9 100644 --- a/exercises/jigsaw-puzzle/instructions.md +++ b/exercises/jigsaw-puzzle/instructions.md @@ -8,7 +8,7 @@ The full information about the jigsaw puzzle contains the following parts: - `pieces`: Total number of pieces - `border`: Number of border pieces -- `inside`: Number of inside pieces +- `inside`: Number of inside (non-border) pieces - `rows`: Number of rows - `columns`: Number of columns - `aspectRatio`: Aspect ratio of columns to rows From 8e36f37d89a40b7ecf5514f73e9a2906b8567860 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 28 Apr 2025 16:27:42 +0200 Subject: [PATCH 23/31] make introduction more whimsical --- exercises/jigsaw-puzzle/introduction.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/jigsaw-puzzle/introduction.md index 0d832eaf4..dd909913f 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/jigsaw-puzzle/introduction.md @@ -1,4 +1,6 @@ # Introduction Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalog of their collection — recording information such as the total number of pieces, the number of rows and columns, the number of border and inside pieces, aspect ratio, and puzzle format. -After solving one of the puzzles to figure out these details, you're now helping fill in the gaps for others in the collection, even when some data is missing. +Even with your powers combined, it takes multiple hours to solve a single jigsaw puzzle with one thousand pieces — and then you still need to count the rows and columns and calculate the remaining numbers manually. +The even larger puzzles with multiple thousand pieces look quite daunting now. +"There has to be a better way!" you exclaim and sit down in front of your computer to solve the problem. From 60e1c19aa57b59562a278247c2b39c41b059f8db Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Thu, 8 May 2025 08:52:23 +0200 Subject: [PATCH 24/31] Rename to piecing-it-together --- .../canonical-data.json | 2 +- .../{jigsaw-puzzle => piecing-it-together}/instructions.md | 0 .../{jigsaw-puzzle => piecing-it-together}/introduction.md | 2 +- .../{jigsaw-puzzle => piecing-it-together}/metadata.toml | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename exercises/{jigsaw-puzzle => piecing-it-together}/canonical-data.json (98%) rename exercises/{jigsaw-puzzle => piecing-it-together}/instructions.md (100%) rename exercises/{jigsaw-puzzle => piecing-it-together}/introduction.md (97%) rename exercises/{jigsaw-puzzle => piecing-it-together}/metadata.toml (83%) diff --git a/exercises/jigsaw-puzzle/canonical-data.json b/exercises/piecing-it-together/canonical-data.json similarity index 98% rename from exercises/jigsaw-puzzle/canonical-data.json rename to exercises/piecing-it-together/canonical-data.json index 102510498..c1de180b2 100644 --- a/exercises/jigsaw-puzzle/canonical-data.json +++ b/exercises/piecing-it-together/canonical-data.json @@ -1,5 +1,5 @@ { - "exercise": "jigsaw-puzzle", + "exercise": "piecing-it-together", "comments": [ "For the aspect ratio, rational numbers can be used for languages without", "IEEE-754 support. Their representation depends on the track (e.g., a tuple like", diff --git a/exercises/jigsaw-puzzle/instructions.md b/exercises/piecing-it-together/instructions.md similarity index 100% rename from exercises/jigsaw-puzzle/instructions.md rename to exercises/piecing-it-together/instructions.md diff --git a/exercises/jigsaw-puzzle/introduction.md b/exercises/piecing-it-together/introduction.md similarity index 97% rename from exercises/jigsaw-puzzle/introduction.md rename to exercises/piecing-it-together/introduction.md index dd909913f..4ae666578 100644 --- a/exercises/jigsaw-puzzle/introduction.md +++ b/exercises/piecing-it-together/introduction.md @@ -2,5 +2,5 @@ Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalog of their collection — recording information such as the total number of pieces, the number of rows and columns, the number of border and inside pieces, aspect ratio, and puzzle format. Even with your powers combined, it takes multiple hours to solve a single jigsaw puzzle with one thousand pieces — and then you still need to count the rows and columns and calculate the remaining numbers manually. -The even larger puzzles with multiple thousand pieces look quite daunting now. +The even larger puzzles with multiple thousand pieces look quite daunting now. "There has to be a better way!" you exclaim and sit down in front of your computer to solve the problem. diff --git a/exercises/jigsaw-puzzle/metadata.toml b/exercises/piecing-it-together/metadata.toml similarity index 83% rename from exercises/jigsaw-puzzle/metadata.toml rename to exercises/piecing-it-together/metadata.toml index 058370bc7..55f18e0cc 100644 --- a/exercises/jigsaw-puzzle/metadata.toml +++ b/exercises/piecing-it-together/metadata.toml @@ -1,4 +1,4 @@ -title = "Jigsaw Puzzle" +title = "Piecing It Together" blurb = "Fill in missing jigsaw puzzle details from partial data" source = "atk just started another 1000-pieces jigsaw puzzle when this idea hit him" -source_url = "https://github.com/exercism/problem-specifications/pull/2554" \ No newline at end of file +source_url = "https://github.com/exercism/problem-specifications/pull/2554" From 56a647dcab2e55df88d5e00b3187df39b40c868b Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sat, 10 May 2025 22:38:34 +0200 Subject: [PATCH 25/31] add illustrated examples --- exercises/piecing-it-together/instructions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index 5032cb7d9..7f513e3fd 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -19,3 +19,22 @@ For this exercise, you may assume square pieces, so that the format can be deriv - If the aspect ratio is less than 1, it's `portrait` - If it is equal to 1, it's `square` - If it is greater than 1, it's `landscape` + +# Three examples + +## Portrait + +A portrait jigsaw puzzle comprising 6 pieces of which all are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2). + +![A 2 by 3 jigsaw puzzle](https://camo.githubusercontent.com/bb806ba85321c2b739e882d6f872897150a87134765383e26a47d88bfe0aa7f8/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3278332e737667) + +## Square +A square jigsaw puzzle with 9 pieces of which all except the centre piece are border pieces. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3). + +![A 3 by 3 jigsaw puzzle](https://camo.githubusercontent.com/499ca9b4913aac4f3ae18eeec392209ac8b360d892b7cb3be5d28cba4075602c/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3378332e737667) + +## Landscape +A landscape jigsaw puzzle with 12 pieces of which 10 are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). + +![A 4 by 3 jigsaw puzzle](https://camo.githubusercontent.com/45b18efc8524284928bd8cae6bd72b661e1b9a1ca8959fe5131c7985671030a0/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3478332e737667) + From 14b4cf38c07c6cf4ec6730e6a9eaae7ee2a7ba97 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sat, 10 May 2025 22:41:23 +0200 Subject: [PATCH 26/31] fix: linter errors --- exercises/piecing-it-together/instructions.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index 7f513e3fd..a34aa7de8 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -20,20 +20,22 @@ For this exercise, you may assume square pieces, so that the format can be deriv - If it is equal to 1, it's `square` - If it is greater than 1, it's `landscape` -# Three examples +## Three examples -## Portrait +### Portrait A portrait jigsaw puzzle comprising 6 pieces of which all are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2). ![A 2 by 3 jigsaw puzzle](https://camo.githubusercontent.com/bb806ba85321c2b739e882d6f872897150a87134765383e26a47d88bfe0aa7f8/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3278332e737667) -## Square +### Square + A square jigsaw puzzle with 9 pieces of which all except the centre piece are border pieces. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3). ![A 3 by 3 jigsaw puzzle](https://camo.githubusercontent.com/499ca9b4913aac4f3ae18eeec392209ac8b360d892b7cb3be5d28cba4075602c/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3378332e737667) -## Landscape +### Landscape + A landscape jigsaw puzzle with 12 pieces of which 10 are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). ![A 4 by 3 jigsaw puzzle](https://camo.githubusercontent.com/45b18efc8524284928bd8cae6bd72b661e1b9a1ca8959fe5131c7985671030a0/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3478332e737667) From 76730b867a2cc186748aaa7a7ebc4216528b2c3c Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sat, 10 May 2025 22:42:56 +0200 Subject: [PATCH 27/31] fix: linter errors, 2nd part --- exercises/piecing-it-together/instructions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index a34aa7de8..63ca49d70 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -39,4 +39,3 @@ A square jigsaw puzzle with 9 pieces of which all except the centre piece are bo A landscape jigsaw puzzle with 12 pieces of which 10 are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). ![A 4 by 3 jigsaw puzzle](https://camo.githubusercontent.com/45b18efc8524284928bd8cae6bd72b661e1b9a1ca8959fe5131c7985671030a0/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3478332e737667) - From 5626758052205823fb0765dc965040ce1370ca32 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Sun, 11 May 2025 11:21:26 +0200 Subject: [PATCH 28/31] final image urls --- exercises/piecing-it-together/instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index 63ca49d70..de0260eab 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -26,16 +26,16 @@ For this exercise, you may assume square pieces, so that the format can be deriv A portrait jigsaw puzzle comprising 6 pieces of which all are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2). -![A 2 by 3 jigsaw puzzle](https://camo.githubusercontent.com/bb806ba85321c2b739e882d6f872897150a87134765383e26a47d88bfe0aa7f8/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3278332e737667) +![A 2 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-2x3.svg) ### Square A square jigsaw puzzle with 9 pieces of which all except the centre piece are border pieces. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3). -![A 3 by 3 jigsaw puzzle](https://camo.githubusercontent.com/499ca9b4913aac4f3ae18eeec392209ac8b360d892b7cb3be5d28cba4075602c/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3378332e737667) +![A 3 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-3x3.svg) ### Landscape A landscape jigsaw puzzle with 12 pieces of which 10 are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). -![A 4 by 3 jigsaw puzzle](https://camo.githubusercontent.com/45b18efc8524284928bd8cae6bd72b661e1b9a1ca8959fe5131c7985671030a0/68747470733a2f2f6173736574732e657865726369736d2e6f72672f696d616765732f6578657263697365732f70696563696e672d69742d746f6765746865722f6a69677361772d70757a7a6c652d3478332e737667) +![A 4 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-4x3.svg) From 0b648ab28b4b9ffec1015c653c06a9f111d6ded1 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Mon, 12 May 2025 10:26:47 +0200 Subject: [PATCH 29/31] improve wording --- exercises/piecing-it-together/instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index de0260eab..8f76b7dd4 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -24,18 +24,18 @@ For this exercise, you may assume square pieces, so that the format can be deriv ### Portrait -A portrait jigsaw puzzle comprising 6 pieces of which all are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2). +A portrait jigsaw puzzle with 6 pieces, all of which are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2). ![A 2 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-2x3.svg) ### Square -A square jigsaw puzzle with 9 pieces of which all except the centre piece are border pieces. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3). +A square jigsaw puzzle with 9 pieces, all of which are border pieces except for the one in the center, which is an inside piece. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3). ![A 3 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-3x3.svg) ### Landscape -A landscape jigsaw puzzle with 12 pieces of which 10 are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). +A landscape jigsaw puzzle with 12 pieces, 10 of which are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3). ![A 4 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-4x3.svg) From 7dc21ba6f70b0da30eef6e12a57bacfed7a10de0 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 13 May 2025 15:50:14 +0200 Subject: [PATCH 30/31] wording improvements --- exercises/piecing-it-together/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/piecing-it-together/introduction.md b/exercises/piecing-it-together/introduction.md index 4ae666578..2fa20f6c5 100644 --- a/exercises/piecing-it-together/introduction.md +++ b/exercises/piecing-it-together/introduction.md @@ -2,5 +2,5 @@ Your best friend has started collecting jigsaw puzzles and wants to build a detailed catalog of their collection — recording information such as the total number of pieces, the number of rows and columns, the number of border and inside pieces, aspect ratio, and puzzle format. Even with your powers combined, it takes multiple hours to solve a single jigsaw puzzle with one thousand pieces — and then you still need to count the rows and columns and calculate the remaining numbers manually. -The even larger puzzles with multiple thousand pieces look quite daunting now. +The even larger puzzles with thousands of pieces look quite daunting now. "There has to be a better way!" you exclaim and sit down in front of your computer to solve the problem. From 1fa797d6ed70536396b4927c426a37203b657995 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Tue, 13 May 2025 22:12:05 +0200 Subject: [PATCH 31/31] more improvements --- exercises/piecing-it-together/instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/piecing-it-together/instructions.md b/exercises/piecing-it-together/instructions.md index 8f76b7dd4..c0c966592 100644 --- a/exercises/piecing-it-together/instructions.md +++ b/exercises/piecing-it-together/instructions.md @@ -1,8 +1,8 @@ # Instructions -Given partial information about a jigsaw puzzle, complete the remaining details. +Given partial information about a jigsaw puzzle, add the missing pieces. -If the information is insufficient to complete the details, or if it contains contradictions, the user should be notified. +If the information is insufficient to complete the details, or if given parts are in contradiction, the user should be notified. The full information about the jigsaw puzzle contains the following parts: