Show All the Letters That the Player Has Already Found
Understand how to store multiple found letters using Ruby collections, update the word display to show all discovered letters, and improve your hangman game's functionality by refining code organization and reuse.
We'll cover the following...
We'll cover the following...
Accumulating found letters using collections
We only show one letter at a time, that is, the last one that the player has found. Understanding this behavior is rather simple. We simply assign a name to the proposed letter when it matches, and we use the same name each time, while simultaneously hiding the previous letter.
We need to accumulate all the found letters. We have what we call collections, which ...