Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(curriculum): not require braces step 79,80 platform game #54548

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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