fix(curriculum): allow multiple solutions oop game 73 (#53117)

This commit is contained in:
a2937
2024-01-11 16:32:38 -08:00
committed by GitHub
parent fd901a963a
commit f9e9c9a6ab
@@ -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--