From 70be2fa4eee8a38edb9d3f465992df2b5e369e22 Mon Sep 17 00:00:00 2001 From: Gagan Bhullar Date: Tue, 20 Aug 2024 01:29:17 -0600 Subject: [PATCH] fix(curriculum): step 78 and step 80 too strict checking fix (#55847) --- .../64c9bab6998128282da063f9.md | 2 +- .../64c9dc4bd63a92295347c449.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9bab6998128282da063f9.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9bab6998128282da063f9.md index 7e9df37bea4..99c35abb616 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9bab6998128282da063f9.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9bab6998128282da063f9.md @@ -18,7 +18,7 @@ Inside the `animate` function, add a condition to check if the right key was pre You should have an `if` statement that checks if the right key was pressed and if the `isCheckpointCollisionDetectionActive` is true. ```js -assert.match(code, /if\s*\(\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{\s*(.*?)\s*}/); +assert.match(code, /if\s*\(((\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.rightKey\.pressed\s*))\)\s*{\s*(.*?)\s*}/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9dc4bd63a92295347c449.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9dc4bd63a92295347c449.md index 38fea37dfa7..44557fc650b 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9dc4bd63a92295347c449.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c9dc4bd63a92295347c449.md @@ -18,7 +18,7 @@ Inside the loop, use the addition assignment operator to add 5 to the platform's You should have a condition that checks if the left key was pressed and if `isCheckpointCollisionDetectionActive` is true. ```js -assert.match(code, /if\s*\(\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*-=\s*5\s*;\s*}\s*\)\s*;?\s*}\s*else\s+if\s*\(\s*keys\.leftKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*\)\s*{.*}\s*\)\s*;?/s); +assert.match(code, /if\s*\(((\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.rightKey\.pressed\s*))\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*-=\s*5\s*;\s*}\s*\)\s*;?\s*}\s*else\s+if\s*\(((\s*keys\.leftKey\.pressed\s*&&\s*isCheckpointCollisionDetectionActive\s*)|(\s*isCheckpointCollisionDetectionActive\s*&&\s*keys\.leftKey\.pressed\s*))\)\s*{.*}\s*\)\s*;?/s); ```