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); ```