mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-24 11:03:17 -04:00
fix(curriculum): typos in making RPG game project at new JS (#47909)
fix(curriculum,learn): Fix a few misspellings
This commit is contained in:
committed by
GitHub
parent
d2d08b4875
commit
0e42b79b69
@@ -7,7 +7,7 @@ dashedName: step-122
|
||||
|
||||
# --description--
|
||||
|
||||
JavaScript offers the built in `Math` utility which offers a number of mathematical tools. One of those is `Math.random()`, which generates a random number between 0 and 1. Another is `Math.floor()`, which rounds a given number down to the nearest integer.
|
||||
JavaScript offers the built-in `Math` utility which offers a number of mathematical tools. One of those is `Math.random()`, which generates a random number between 0 and 1. Another is `Math.floor()`, which rounds a given number down to the nearest integer.
|
||||
|
||||
Using these, you can generate a random number within a range. For example, this generates a random number between 1 and 5: `Math.floor(Math.random() * 5) + 1;`.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ You should set `healthText.innerText` to `health`.
|
||||
assert.match(attack.toString(), /healthText\.innerText\s*=\s*health/);
|
||||
```
|
||||
|
||||
Ypu should update `monsterHealthText.innerText`.
|
||||
You should update `monsterHealthText.innerText`.
|
||||
|
||||
```js
|
||||
assert.match(attack.toString(), /monsterHealthText\.innerText/);
|
||||
|
||||
@@ -33,7 +33,7 @@ Your `else if` statement should check if `monsterHealth` is less than or equal t
|
||||
assert.match(attack.toString(), /else\s*if\s*\(\s*monsterHealth\s*<=\s*0\s*\)/);
|
||||
```
|
||||
|
||||
Your `else if` statment should call the `defeatMonster` function.
|
||||
Your `else if` statement should call the `defeatMonster` function.
|
||||
|
||||
```js
|
||||
assert.match(attack.toString(), /else\s*if\s*\(\s*monsterHealth\s*<=\s*0\s*\)\s*\{\s*defeatMonster/);
|
||||
|
||||
Reference in New Issue
Block a user