From 062b3b2002a92f097fa7bc6bf57d929fd2fc7d3b Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Fri, 13 Mar 2026 11:35:08 +0100 Subject: [PATCH] fix(curriculum): remove before/after-user-code from rosetta challenges 11-15 (#66391) --- .../594d8d0ab97724821379b1e6.md | 14 +++--- .../594d966a1467eb84194f0086.md | 11 ++-- .../594da033de4190850b893874.md | 9 +--- .../594db4d0dedb4c06a2a4cefd.md | 11 ++-- .../594dc6c729e5700999302b45.md | 50 +++++++++---------- 5 files changed, 40 insertions(+), 55 deletions(-) diff --git a/curriculum/challenges/english/blocks/rosetta-code-challenges/594d8d0ab97724821379b1e6.md b/curriculum/challenges/english/blocks/rosetta-code-challenges/594d8d0ab97724821379b1e6.md index d65362b8929..5559021035c 100644 --- a/curriculum/challenges/english/blocks/rosetta-code-challenges/594d8d0ab97724821379b1e6.md +++ b/curriculum/challenges/english/blocks/rosetta-code-challenges/594d8d0ab97724821379b1e6.md @@ -14,6 +14,13 @@ The case where the collection is empty may be ignored. Care must be taken to han If it is not appropriate or possible to support a general collection, use a vector (array), if possible. If it is not appropriate or possible to support an unspecified value type, use integers. +# --before-each-- + +```js +const arr1 = [1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]; +const arr2 = [1, 2, 4, 4, 1]; +``` + # --hints-- `mode` should be a function. @@ -36,13 +43,6 @@ assert.deepEqual(mode(arr2).sort(), [1, 4]); # --seed-- -## --after-user-code-- - -```js -const arr1 = [1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]; -const arr2 = [1, 2, 4, 4, 1]; -``` - ## --seed-contents-- ```js diff --git a/curriculum/challenges/english/blocks/rosetta-code-challenges/594d966a1467eb84194f0086.md b/curriculum/challenges/english/blocks/rosetta-code-challenges/594d966a1467eb84194f0086.md index 12b5b68cd57..531fc4c70ff 100644 --- a/curriculum/challenges/english/blocks/rosetta-code-challenges/594d966a1467eb84194f0086.md +++ b/curriculum/challenges/english/blocks/rosetta-code-challenges/594d966a1467eb84194f0086.md @@ -48,14 +48,6 @@ assert(typeof pythagoreanMeans === 'function'); `pythagoreanMeans([1, 2, ..., 10])` should equal the same output above. -```js -assert.deepEqual(pythagoreanMeans(range1), answer1); -``` - -# --seed-- - -## --after-user-code-- - ```js const range1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const answer1 = { @@ -66,8 +58,11 @@ const answer1 = { }, test: 'is A >= G >= H ? yes' }; +assert.deepEqual(pythagoreanMeans(range1), answer1); ``` +# --seed-- + ## --seed-contents-- ```js diff --git a/curriculum/challenges/english/blocks/rosetta-code-challenges/594da033de4190850b893874.md b/curriculum/challenges/english/blocks/rosetta-code-challenges/594da033de4190850b893874.md index f4dbbcbcca7..76b11b25edd 100644 --- a/curriculum/challenges/english/blocks/rosetta-code-challenges/594da033de4190850b893874.md +++ b/curriculum/challenges/english/blocks/rosetta-code-challenges/594da033de4190850b893874.md @@ -25,18 +25,13 @@ assert(typeof rms === 'function'); `rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])` should equal `6.2048368229954285`. ```js +const arr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const answer1 = 6.2048368229954285; assert.equal(rms(arr1), answer1); ``` # --seed-- -## --after-user-code-- - -```js -const arr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; -const answer1 = 6.2048368229954285; -``` - ## --seed-contents-- ```js diff --git a/curriculum/challenges/english/blocks/rosetta-code-challenges/594db4d0dedb4c06a2a4cefd.md b/curriculum/challenges/english/blocks/rosetta-code-challenges/594db4d0dedb4c06a2a4cefd.md index aa9d6f54100..227ed8d5c8b 100644 --- a/curriculum/challenges/english/blocks/rosetta-code-challenges/594db4d0dedb4c06a2a4cefd.md +++ b/curriculum/challenges/english/blocks/rosetta-code-challenges/594db4d0dedb4c06a2a4cefd.md @@ -34,19 +34,14 @@ assert(typeof babbage === 'function'); `babbage(99736, 269696)` should not return 99736 (there is a smaller answer). ```js +const babbageAns = 99736; +const endDigits = 269696; +const answer = 25264; assert.equal(babbage(babbageAns, endDigits), answer); ``` # --seed-- -## --after-user-code-- - -```js -const babbageAns = 99736; -const endDigits = 269696; -const answer = 25264; -``` - ## --seed-contents-- ```js diff --git a/curriculum/challenges/english/blocks/rosetta-code-challenges/594dc6c729e5700999302b45.md b/curriculum/challenges/english/blocks/rosetta-code-challenges/594dc6c729e5700999302b45.md index 9332dcea513..e9eb0c2a2d7 100644 --- a/curriculum/challenges/english/blocks/rosetta-code-challenges/594dc6c729e5700999302b45.md +++ b/curriculum/challenges/english/blocks/rosetta-code-challenges/594dc6c729e5700999302b45.md @@ -20,6 +20,31 @@ Determine whether a generated string of brackets is balanced; that is, whether i | \[]]\[\[] | false | | \[\[\[\[]]]] | true | +# --before-each-- + +```js +const testCases = [ + '[]', + ']][[[][][][]][', + '[][[[[][][[[]]]]]]', + '][', + '[[[]]]][[]', + '][[]', + '][[][]][[[]]', + '[[][]]][', + '[[[]]][[]]]][][[', + '[]][[]]][[[[][]]', + '][]][[][', + '[[]][[][]]', + '[[]]', + ']][]][[]][[[', + '][]][][[', + '][][', + '[]]]', + '' +]; +``` + # --hints-- `isBalanced` should be a function. @@ -138,31 +163,6 @@ assert(isBalanced(testCases[17])); # --seed-- -## --after-user-code-- - -```js -const testCases = [ - '[]', - ']][[[][][][]][', - '[][[[[][][[[]]]]]]', - '][', - '[[[]]]][[]', - '][[]', - '][[][]][[[]]', - '[[][]]][', - '[[[]]][[]]]][][[', - '[]][[]]][[[[][]]', - '][]][[][', - '[[]][[][]]', - '[[]]', - ']][]][[]][[[', - '][]][][[', - '][][', - '[]]]', - '' -]; -``` - ## --seed-contents-- ```js