mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-04 08:05:48 -05:00
fix(curriculum): step 78 and step 80 too strict checking fix (#55847)
This commit is contained in:
@@ -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--
|
||||
|
||||
@@ -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);
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user