State 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.
Swipe to start coding
- Define the
get_guessed_word
function withgameword
andletters_already_guessed
as parameters. - Create a for loop to iterate through
gameword
usingi
as the iterator, utilizing therange()
function for iteration. - Implement a condition to determine if elements within
gameword
match any inletters_already_guessed
. - If the condition is met, append the letter
list(gameword)[i]
toresult_list
; otherwise, append'_ '
(including the space).
Oplossing
Bedankt voor je feedback!
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 11.11
State 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.
Swipe to start coding
- Define the
get_guessed_word
function withgameword
andletters_already_guessed
as parameters. - Create a for loop to iterate through
gameword
usingi
as the iterator, utilizing therange()
function for iteration. - Implement a condition to determine if elements within
gameword
match any inletters_already_guessed
. - If the condition is met, append the letter
list(gameword)[i]
toresult_list
; otherwise, append'_ '
(including the space).
Oplossing
Bedankt voor je feedback!