Recall the Wrong Proposals
Learn to improve interactivity by implementing additional functionalities.
We'll cover the following...
We'll cover the following...
Storing the wrong letters
Displaying the number of letters of the hidden word and the found letters is not enough to help the player. It’s also useful to show the wrong letters that they proposed. To do this, we are going to store the wrong letters in the same way as we accumulate the correct letters in a collection.
Let’s have a look at the updated code:
We add another collection named
wrong_lettersin line 6.We add the wrong letters in line 41, right after the display of the message saying that the letter is not in the hidden word. This ...