+ 1

Need help

I am working on a word guessing game including a sort of Wheel of Fortune and struggling with working on this problem. The player is given a category (Movie, Famous Person) and some number of blanks representing each character in the name of the movie or person. The user guesses one letter at a time and the program updates the display to include the letter where it appears in the name. The program should also display any character that was guessed incorrectly as well as the number of incorrect guesses remaining. The game ends when the user has filled in all of the characters or has reached the guessed incorrectly 5 times for a particular puzzle. The user should be allowed to play puzzles repeatedly and the program should keep track of how many puzzles the user has completed successfully. I want to show the number of words by using - but my code just showed one -. current output - 5 tries left. desire output ----- 5 tries left. https://code.sololearn.com/cp0z8T73r4G3

3rd Mar 2022, 7:38 AM
rappy
4 Answers
+ 1
You can try dashes = "-" * tries #if you are trying to show how many completed tries Or dashes = "-" * (5-tries) #If you are trying how many remaining tries update this dashes before printing #edit : I only seen just about dashes, not about full code, pls note hope it helps..
3rd Mar 2022, 7:54 AM
Jayakrishna 🇼🇳
0
I didnt Dive Too deep into your code, to be honest. But in line 37 you choose only one character from the word to find. This single character always has a length of 1. Thats why you will only get 1 dash I think you dont need line 37 at All. Just go on with the variable 'name'.
3rd Mar 2022, 8:05 AM
G B
G B - avatar
0
I actually made something similar you can just take a peak at the lines i did and add it to yours this one kinda old though https://code.sololearn.com/c30xnIR4fp7s/?ref=app
3rd Mar 2022, 8:35 AM
Ion Kare
Ion Kare - avatar
0
I got it! Thank you all.
4th Mar 2022, 9:03 PM
rappy