Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Crafting a Classic Hangman Game

State of AffairsState of Affairs

Tracking the Game Word's Progress

To keep the user informed about the progress of their guesses, it's essential to display both the number of correctly guessed letters and the letters still to be guessed after each attempt.

For this purpose, we will develop the get_guessed_word function. This function will maintain a result_list, which represents the current state of the gameword, including correctly guessed letters and placeholders for the remaining letters.

Tarea

  1. Define the get_guessed_word function with gameword and letters_already_guessed as parameters.
  2. Create a for loop to iterate through gameword using i as the iterator, utilizing the range() function for iteration.
  3. Implement a condition to determine if elements within gameword match any in letters_already_guessed.
  4. If the condition is met, append the letter list(gameword)[i] to result_list; otherwise, append '_ ' (including the space).

Mark tasks as Completed

¿Todo estuvo claro?

Sección 1. Capítulo 4
AVAILABLE TO ULTIMATE ONLY
course content

Contenido del Curso

Crafting a Classic Hangman Game

State of AffairsState of Affairs

Tracking the Game Word's Progress

To keep the user informed about the progress of their guesses, it's essential to display both the number of correctly guessed letters and the letters still to be guessed after each attempt.

For this purpose, we will develop the get_guessed_word function. This function will maintain a result_list, which represents the current state of the gameword, including correctly guessed letters and placeholders for the remaining letters.

Tarea

  1. Define the get_guessed_word function with gameword and letters_already_guessed as parameters.
  2. Create a for loop to iterate through gameword using i as the iterator, utilizing the range() function for iteration.
  3. Implement a condition to determine if elements within gameword match any in letters_already_guessed.
  4. If the condition is met, append the letter list(gameword)[i] to result_list; otherwise, append '_ ' (including the space).

Mark tasks as Completed

¿Todo estuvo claro?

Sección 1. Capítulo 4
AVAILABLE TO ULTIMATE ONLY
some-alt