mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): allow multiple solutions oop game 73 (#53117)
This commit is contained in:
+3
-3
@@ -18,19 +18,19 @@ Inside the callback function, add a `platform` parameter and for the body of the
|
||||
You should have a `forEach` loop that iterates through the `platforms` array.
|
||||
|
||||
```js
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(.*\)|[^\s()]+)\s*=>\s*{\s*(.*?)\s*}\s*\);?/);
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(.*\)|[^\s()]+)\s*=>\s*{?\s*(.*?)\s*}?\s*\);?/);
|
||||
```
|
||||
|
||||
You should add a `platform` parameter to the callback function.
|
||||
|
||||
```js
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*(.*?)\s*}\s*\);?/);
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{?\s*(.*?)\s*}?\s*\);?/);
|
||||
```
|
||||
|
||||
You should call the `draw` method on each `platform`.
|
||||
|
||||
```js
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{\s*platform\.draw\(\)\s*;?\s*}\s*\);?/);
|
||||
assert.match(code, /platforms\.forEach\(\s*(\(\s*platform\s*\)|platform)\s*=>\s*{?\s*platform\.draw\(\)\s*;?\s*}?\s*\);?/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user