Skip to content

Commit 1d50ae1

Browse files
Guide students to use the correct concept (#2666)
1 parent 18e8682 commit 1d50ae1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

exercises/concept/elyses-looping-enchantments/.docs/instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ To keep things simple, she only uses cards with values 1-10.
88
Elyse wants to know how many cards of a particular type she has in her deck.
99

1010
Write a function `cardTypeCheck` that takes two parameters: an array of cards (Elyse's deck) and the type of card to count.
11+
12+
<!--prettier-ignore -->
13+
~~~exercism/note
1114
The function should use `forEach` and return the number of cards in the deck of the specified type.
15+
~~~
1216

1317
```javascript
1418
const cardType = 3;
@@ -23,7 +27,11 @@ For another trick, Elyse needs to know how many odd or even cards there are in h
2327
Implement a function `determineOddEvenCards` that takes in two parameters: an array of cards (Elyse's deck), and a boolean (true is analogous to 'even', and false is analogous to 'odd').
2428

2529
This function should return a single number: the number of odd or even cards there are (depending on the value of the second argument) in the deck.
30+
31+
<!--prettier-ignore -->
32+
~~~exercism/note
2633
To practice, use a `for...of` loop in the function implementation this time.
34+
~~~
2735

2836
```javascript
2937
determineOddEvenCards([1, 2, 3, 1, 5, 6], true);

exercises/concept/elyses-looping-enchantments/enchantments.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @returns {number} number of cards of a single type there are in the deck
1010
*/
1111
export function cardTypeCheck(stack, card) {
12+
// 🚨 Use .forEach
1213
throw new Error('Implement the cardTypeCheck function');
1314
}
1415

@@ -20,5 +21,6 @@ export function cardTypeCheck(stack, card) {
2021
* @returns {number} number of cards that are either odd or even (depending on `type`)
2122
*/
2223
export function determineOddEvenCards(stack, type) {
24+
// 🚨 Use a `for...of` loop
2325
throw new Error('Implement the determineOddEvenCards function');
2426
}

0 commit comments

Comments
 (0)