fix(curriculum): fixed strict regex (#54778)

This commit is contained in:
Andrew M. Yturaldi
2024-05-14 17:18:17 -05:00
committed by GitHub
parent f0bbef2d8b
commit 1a97345aa4

View File

@@ -34,13 +34,13 @@ assert.match(code, /const\s+randomDice\s*=\s*.*Math\.random\s*\(\s*\)\s*\*\s*6\s
You should use `Math.floor()` to round the result down to the nearest whole number.
```js
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*/);
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\(?\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*/);
```
You should add `1` to the end result of your `randomDice` variable.
```js
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*\+\s*1\s*/);
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\(?\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*\+\s*1\)?\s*/);
```
# --seed--