From 3451bc5ae75431b5fcc101955a8566b67a6861f7 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 15 May 2024 12:08:34 +0200 Subject: [PATCH 1/5] anagram: split description into instructions and introduction --- .../anagram/{description.md => instructions.md} | 8 ++++---- exercises/anagram/introduction.md | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) rename exercises/anagram/{description.md => instructions.md} (73%) create mode 100644 exercises/anagram/introduction.md diff --git a/exercises/anagram/description.md b/exercises/anagram/instructions.md similarity index 73% rename from exercises/anagram/description.md rename to exercises/anagram/instructions.md index f686f5ea1b..a7298485b3 100644 --- a/exercises/anagram/description.md +++ b/exercises/anagram/instructions.md @@ -1,9 +1,9 @@ -# Description +# Instructions -An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`. -A word is not its own anagram: for example, `"stop"` is not an anagram of `"stop"`. +Your task is to, given a target word and a set of candidate words, to find the subset of the candidates that are anagrams of the target. -Given a target word and a set of candidate words, this exercise requests the anagram set: the subset of the candidates that are anagrams of the target. +An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`. +A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`. The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`). Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`. diff --git a/exercises/anagram/introduction.md b/exercises/anagram/introduction.md new file mode 100644 index 0000000000..7b4db59f6e --- /dev/null +++ b/exercises/anagram/introduction.md @@ -0,0 +1,12 @@ +# Introduction + +At a garage sale, you find a lovely vintage typewriter at a bargain price! +Excitedly, you rush home, insert a sheet of paper, and start typing away. +However, your excitement wanes when you examine the output: all words are garbled! +For example, it prints "liar" instead of "rail" and "pots" instead of "stop." +Carefully, you try again, but the result is the same. +Apparently, all keys are wired incorrectly; for instance, the "r" key outputs an "l" and vice versa. +You now understand why they sold it for so little money! + +You realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. +Pleased with your finding, you spend the rest of the day generating hundreds of anagrams. From c5eccd9c7373dfdebca5c0fe85871939d8c8b4fb Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 16 May 2024 10:20:16 +0200 Subject: [PATCH 2/5] Convert to delay --- exercises/anagram/introduction.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/anagram/introduction.md b/exercises/anagram/introduction.md index 7b4db59f6e..ae45d4f21a 100644 --- a/exercises/anagram/introduction.md +++ b/exercises/anagram/introduction.md @@ -3,10 +3,10 @@ At a garage sale, you find a lovely vintage typewriter at a bargain price! Excitedly, you rush home, insert a sheet of paper, and start typing away. However, your excitement wanes when you examine the output: all words are garbled! -For example, it prints "liar" instead of "rail" and "pots" instead of "stop." -Carefully, you try again, but the result is the same. -Apparently, all keys are wired incorrectly; for instance, the "r" key outputs an "l" and vice versa. +For example, it prints "stop" instead of "post" and "least" instead of "stale." +Carefully, you try again, but now it prints "spot" and "slate." +After some experimentation, you find there is a random delay before each letter is printed, which messes up the order. You now understand why they sold it for so little money! -You realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. +You do realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. Pleased with your finding, you spend the rest of the day generating hundreds of anagrams. From 51dd1858b3822f24648320420b9efb058080ee10 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 16 May 2024 11:37:32 +0200 Subject: [PATCH 3/5] Update exercises/anagram/introduction.md --- exercises/anagram/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/anagram/introduction.md b/exercises/anagram/introduction.md index ae45d4f21a..89d0d24587 100644 --- a/exercises/anagram/introduction.md +++ b/exercises/anagram/introduction.md @@ -8,5 +8,5 @@ Carefully, you try again, but now it prints "spot" and "slate." After some experimentation, you find there is a random delay before each letter is printed, which messes up the order. You now understand why they sold it for so little money! -You do realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. +You realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. Pleased with your finding, you spend the rest of the day generating hundreds of anagrams. From 090ca722af00f150bdd4b32bc3b76e0e24882b5c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 16 May 2024 11:38:04 +0200 Subject: [PATCH 4/5] Update exercises/anagram/introduction.md --- exercises/anagram/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/anagram/introduction.md b/exercises/anagram/introduction.md index 89d0d24587..ace8523f3f 100644 --- a/exercises/anagram/introduction.md +++ b/exercises/anagram/introduction.md @@ -8,5 +8,5 @@ Carefully, you try again, but now it prints "spot" and "slate." After some experimentation, you find there is a random delay before each letter is printed, which messes up the order. You now understand why they sold it for so little money! -You realize you can use this quirk to generate anagrams: words formed by rearranging the letters of another word. +You realize this quirk allows you to generate anagrams: words formed by rearranging the letters of another word. Pleased with your finding, you spend the rest of the day generating hundreds of anagrams. From e3f5ff070dcbc1a399cf01c70d48edd26cb8d9b6 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 16 May 2024 11:39:02 +0200 Subject: [PATCH 5/5] Update exercises/anagram/introduction.md --- exercises/anagram/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/anagram/introduction.md b/exercises/anagram/introduction.md index ace8523f3f..1acbdf00b0 100644 --- a/exercises/anagram/introduction.md +++ b/exercises/anagram/introduction.md @@ -8,5 +8,5 @@ Carefully, you try again, but now it prints "spot" and "slate." After some experimentation, you find there is a random delay before each letter is printed, which messes up the order. You now understand why they sold it for so little money! -You realize this quirk allows you to generate anagrams: words formed by rearranging the letters of another word. +You realize this quirk allows you to generate anagrams, which are words formed by rearranging the letters of another word. Pleased with your finding, you spend the rest of the day generating hundreds of anagrams.