From 3421c62ca422efb1a6f2fa374f0148100cd5b043 Mon Sep 17 00:00:00 2001 From: Katrina Owen Date: Fri, 31 Mar 2023 16:11:46 +0200 Subject: [PATCH 1/3] Rework largest-series-product documentation This PR is part of our project of making our Practice Exercises more consistent and human. For more context please see the following forum-thread: https://forum.exercism.org/t/new-project-making-practice-exercises-more-consistent-and-human-across-exercism/3943 The main change is to frame the exercise within the context of story. --- .../largest-series-product/instructions.md | 25 +++++++++++++++++++ .../largest-series-product/introduction.md | 5 ++++ 2 files changed, 30 insertions(+) create mode 100644 exercises/largest-series-product/instructions.md create mode 100644 exercises/largest-series-product/introduction.md diff --git a/exercises/largest-series-product/instructions.md b/exercises/largest-series-product/instructions.md new file mode 100644 index 0000000000..c2d3499751 --- /dev/null +++ b/exercises/largest-series-product/instructions.md @@ -0,0 +1,25 @@ +# Instructions + +Your task is to look for patterns in the long sequence of digits in the encrypted signal. + +The technique you're going to use here is called the largest series product. + +Let's define a few terms, first. + +- **input** - the sequence of digits that you need to analyze +- **series** - a sequence of adjacent digits (those that are next to each other) that is contained within the input +- **span** - how many digits long each series is +- **product** - what you get when you multiply numbers together + +Let's work through an example, with the input `"63915"`. + +- To form a series, take adjacent digits in the original input. +- If you are working with a span of `3`, there will be three possible series: + - `"639"` + - `"391"` + - `"915"` +- Then we need to calculate the product of each series: + - The product of the series `"639"` is 162 (`6 × 3 × 9 = 162`) + - The product of the series `"391"` is 27 (`3 × 9 × 1 = 27`) + - The product of the series `"915"` is 45 (`9 × 1 × 5 = 45`) +- 162 is bigger than both 27 and 45, so the largest series product of `"63915"` is from the series `"639"`. So the answer is **162**. diff --git a/exercises/largest-series-product/introduction.md b/exercises/largest-series-product/introduction.md new file mode 100644 index 0000000000..597bb5fa15 --- /dev/null +++ b/exercises/largest-series-product/introduction.md @@ -0,0 +1,5 @@ +# Introduction + +You work for a government agency that has intercepted a series of encrypted communication signals from a group of bank robbers. +The signals contain a long sequence of digits. +Your team needs to use various digital signal processing techniques to analyze the signals and identify any patterns that may indicate the planning of a heist. From e1d190c56b9ecf582c64e0aef36aeca65991388d Mon Sep 17 00:00:00 2001 From: Katrina Owen Date: Fri, 31 Mar 2023 22:30:33 +0200 Subject: [PATCH 2/3] Update exercises/largest-series-product/instructions.md Co-authored-by: Isaac Good --- exercises/largest-series-product/instructions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/largest-series-product/instructions.md b/exercises/largest-series-product/instructions.md index c2d3499751..6a245855e8 100644 --- a/exercises/largest-series-product/instructions.md +++ b/exercises/largest-series-product/instructions.md @@ -6,10 +6,10 @@ The technique you're going to use here is called the largest series product. Let's define a few terms, first. -- **input** - the sequence of digits that you need to analyze -- **series** - a sequence of adjacent digits (those that are next to each other) that is contained within the input -- **span** - how many digits long each series is -- **product** - what you get when you multiply numbers together +- **input**: the sequence of digits that you need to analyze +- **series**: a sequence of adjacent digits (those that are next to each other) that is contained within the input +- **span**: how many digits long each series is +- **product**: what you get when you multiply numbers together Let's work through an example, with the input `"63915"`. From b885b7d0a10fa2fd325b36b39a137ee1c811cf14 Mon Sep 17 00:00:00 2001 From: Katrina Owen Date: Fri, 31 Mar 2023 22:33:28 +0200 Subject: [PATCH 3/3] Fix formatting in largest-series-product --- exercises/largest-series-product/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/largest-series-product/instructions.md b/exercises/largest-series-product/instructions.md index 6a245855e8..f297b57f7c 100644 --- a/exercises/largest-series-product/instructions.md +++ b/exercises/largest-series-product/instructions.md @@ -22,4 +22,5 @@ Let's work through an example, with the input `"63915"`. - The product of the series `"639"` is 162 (`6 × 3 × 9 = 162`) - The product of the series `"391"` is 27 (`3 × 9 × 1 = 27`) - The product of the series `"915"` is 45 (`9 × 1 × 5 = 45`) -- 162 is bigger than both 27 and 45, so the largest series product of `"63915"` is from the series `"639"`. So the answer is **162**. +- 162 is bigger than both 27 and 45, so the largest series product of `"63915"` is from the series `"639"`. + So the answer is **162**.