Skip to content

Commit

Permalink
fix(curriculum): not require braces step 79,80 platform game (#54548)
Browse files Browse the repository at this point in the history
  • Loading branch information
a2937 committed Apr 29, 2024
1 parent b38ef48 commit 9be7d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -16,13 +16,13 @@ Inside the loop, use the subtraction assignment operator to subtract 5 from the
You should have a `forEach` loop that iterates through the `platforms` array.

```js
assert.match(code, /if\s*\(.*\)\s*{\s+platforms\.forEach\(\s*(\(.*\)|[^\s()]+)\s*=>\s*{\s*(.*?)\s*}\s*\)\s*;?/);
assert.match(code, /if\s*\(.*\)\s*{\s+platforms\.forEach\(\s*(\(.*\)|[^\s()]+)\s*=>\s*{?\s*(.*?)\s*}?\s*\)\s*;?/);
```

You should use the subtraction assignment operator to subtract 5 from the platform's `x` position.

```js
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*-=\s*5\s*;?\s*}\s*\)\s*;?/);
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{?\s*platform\.position\.x\s*-=\s*5\s*;?\s*}?\s*\)\s*;?/);
```

# --seed--
Expand Down
Expand Up @@ -25,13 +25,13 @@ assert.match(code, /if\s*\(\s*keys\.rightKey\.pressed\s*&&\s*isCheckpointCollisi
You should add a `forEach` loop that iterates through the `platforms` array.

```js
assert.match(code, /else\s+if\s*\(.*\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*(.*?)\s*}\s*\)\s*;?/);
assert.match(code, /else\s+if\s*\(.*\)\s*{\s*platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{?\s*(.*?)\s*}?\s*\)\s*;?/);
```

You should use the addition assignment operator to add 5 to the platform's `x` position.

```js
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.position\.x\s*\+=\s*5\s*;?\s*}\s*\)\s*;?/);
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{?\s*platform\.position\.x\s*\+=\s*5\s*;?\s*}?\s*\)\s*;?/);
```

# --seed--
Expand Down

0 comments on commit 9be7d24

Please sign in to comment.