0

1 the computer displays some secret word(in underscore):---
2 I guess letter"c"in the word
3 yes,the screen pops up like this :c--
4 I guess the second letter is u
5 yes , it is :cu-
6 last ,I guess the final one is p
7 yes , it is :cup

WHICH FUNCTION SHALL I USE TO MAKE THIS HAPPEN?
The topic will be asked in tomorrow , could anyone give me some hint or related example?

Thank you!:)

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Cireyoretihw
0

You need to show some effort, but first think about what's happening, obviously it knows the LENgth of the word and displays dashes for letters that haven't been guessed and IF the letter guessed is IN the word then it will show that letter. You need to make the function, show us some work and we'll likely help with more specific issues.

0

for i in range(len(words[a]))
if word1==guessletter:
print ('The letter is in the word.')
print ('Letters matched so far:',words_so_far.replace("_",guessletter,1))

0

well that totally messed me up...

whats the relation ship between words[a] and word1

... lets get it strait ... you are tiring to write a HANGMAN routine ...

loop until all letters are found in word from a list of words
...show only letters in word already guessed and hide unknowns
...loop get next letter guessed
......say incorrect or correct guess letter
......until next letter is guessed in word
...until all words in list are guessed

is this close to what you are trying to do

Edited by Cireyoretihw: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.