From ca3b73f8817ea26c4b168bd4b9d0eca8a58bc218 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 2 Jan 2025 14:06:09 -0500 Subject: [PATCH] chore(curriculum): make braces optional in step 103, 104 platfomer game (#57797) --- .../64cb472593e3be6d10a7c13b.md | 4 ++-- .../64cb480723790d6d727b8ef5.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md index 222309e32d5..92780ee7e09 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb472593e3be6d10a7c13b.md @@ -9,7 +9,7 @@ dashedName: step-103 Inside your condition, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function. -Inside the loop, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position. +Inside the `forEach` callback, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position. # --hints-- @@ -24,7 +24,7 @@ You should have a `checkpoint` parameter inside the `forEach` callback function. ```js const splitter = code.split("if (keys.rightKey.pressed && isCheckpointCollisionDetectionActive)") -assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/); +assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/); ``` You should use the subtraction assignment operator to subtract 5 from the `checkpoint`'s `x` position. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md index 159231582ac..c0221ce120e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb480723790d6d727b8ef5.md @@ -9,7 +9,7 @@ dashedName: step-104 Inside your `else if` statement, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function. -Inside the loop, use the addition assignment operator to add 5 to the checkpoints's `x` position. +Inside the `forEach` callback, use the addition assignment operator to add 5 to the checkpoints's `x` position. # --hints-- @@ -24,7 +24,7 @@ You should use the `checkpoint` parameter inside the `forEach` callback function ```js const splitter = code.split("else if (keys.leftKey.pressed && isCheckpointCollisionDetectionActive) {") -assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/); +assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/); ``` You should use the addition assignment operator to add 5 to the `checkpoint`'s `x` position.