chore(curriculum): add quotes to strings in Dice Game (#55537)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>pull/55804/merge
parent
e9b700865a
commit
66d29c084d
|
@ -7,7 +7,7 @@ dashedName: step-6
|
|||
|
||||
# --description--
|
||||
|
||||
Each time you roll the dice, you could end up with a `"Three of a kind"`, `"Four of a kind"`, `"Full house"`, `"Straight"` or a random combination of numbers. Based on the outcome, you can make a selection and add points to your score.
|
||||
Each time you roll the dice, you could end up with a `Three of a kind`, `Four of a kind`, `Full house`, `Straight` or a random combination of numbers. Based on the outcome, you can make a selection and add points to your score.
|
||||
|
||||
Start by creating a function called `updateRadioOption` that takes an index and a score value as arguments. It should set the `scoreInputs` at that index to be enabled, set the value of that input to the score, and display `, score = ${score}` in the correct `scoreSpans` element.
|
||||
|
||||
|
@ -32,7 +32,7 @@ assert.isFalse(scoreInputs[0].disabled);
|
|||
assert.deepEqual(scoreInputs[0].value, "10");
|
||||
```
|
||||
|
||||
`updateRadioOption` should update the text of the `scoreSpans` element at the provided index to be the text `, score = ` followed by the given score.
|
||||
`updateRadioOption` should update the text of the `scoreSpans` element at the provided index to be the text `", score = "` followed by the given score.
|
||||
|
||||
```js
|
||||
assert.deepEqual(scoreSpans[0].innerText, ", score = 10");
|
||||
|
|
|
@ -7,7 +7,7 @@ dashedName: step-7
|
|||
|
||||
# --description--
|
||||
|
||||
If you roll the dice and get a `"Three of a kind"` or `"Four of a kind"`, then you can get a score totalling the sum of all five dice values. To calculate this, create a `getHighestDuplicates` function which takes an array of numbers. The function will need to count how many times each number is found in the array.
|
||||
If you roll the dice and get a `Three of a kind` or `Four of a kind`, then you can get a score totalling the sum of all five dice values. To calculate this, create a `getHighestDuplicates` function which takes an array of numbers. The function will need to count how many times each number is found in the array.
|
||||
|
||||
If a number appears four or more times, you will need to update the `Four of a Kind` option with your `updateRadioOption` function. If a number appears three or more times, you will need to update the `Three of a Kind` option. In both cases, the score value should be the sum of all five dice.
|
||||
|
||||
|
|
Loading…
Reference in New Issue