File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 13
13
wordList = fruitList + animalList
14
14
word = random .choice (wordList )
15
15
category = word_Category [word ]
16
-
16
+ print ( word )
17
17
if __name__ == '__main__' :
18
18
print (f'Guess the word! : Hint - Category { category } ' )
19
19
24
24
rounds = len (word ) + 2
25
25
flag = 0
26
26
letterGuessed = ''
27
+ chances = 3
27
28
28
29
print (f'---> Total Number of Rounds : { rounds } <---' )
29
30
try :
34
35
print ("Only Alhpabetic Character Allowed" )
35
36
if len (guess ) != 1 :
36
37
print ("Only Once Character Allowed at a Time" )
38
+ if guess not in word :
39
+ chances -= 1
40
+ print (f'Chances Remaining : { chances } ' )
41
+ print ("Correct Answer To Reset Chances" )
42
+ if chances == 0 :
43
+ print ("You have Zero Chances" )
44
+ break
45
+ break
37
46
if guess in word :
47
+ if chances < 3 :
48
+ chances = 3
49
+ print (f'Chances Reset Remaining Chances: { chances } ' )
38
50
w = word .count (guess )
39
51
for _ in range (w ):
40
52
letterGuessed += guess
41
53
for char in word :
42
54
if char in letterGuessed and (Counter (letterGuessed ) != Counter (word )):
43
55
print (char , end = " " )
56
+
44
57
elif (Counter (letterGuessed ) == Counter (word )):
45
58
flag = 1
46
59
print (f'The word is : { word } ' )
You can’t perform that action at this time.
0 commit comments