-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
87 lines (72 loc) · 2.88 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import time, singleplayer
from os import system as sys
from termcolor import colored as css
def title():
print(css("GUESS.THAT.WORD V2.7! @Noulion\n", 'yellow', attrs=['bold']))
def main():
title()
def guess():
title()
print(css(' hints: ', 'white', attrs=['bold'])+(css(hint, 'light_green', attrs=['bold'])))
print(css(f"\n [{trace}] ({wordLenght}) letter word,\n {text}", 'yellow', attrs=['bold']), '\n\n\n')
while True:
print(css(" [Give Up?, type g]", 'white'))
word_input = input(css(" Guess the word!: ", 'white'))
if word_input == word:
time.sleep(0.6)
print(css(f"\n You guessed '{word}', correct!\n", 'cyan'))
time.sleep(2.5)
sys('cls')
return start_menu()
elif word_input == 'g':
print(css(f"\n The word was {word}\n", 'light_red'))
time.sleep(2.3)
sys('cls')
return start_menu()
elif word_input == '':
print('\n Blank isnt a word.\n')
else:
time.sleep(0.6)
s = ""
print(css(f"\n{s:3}Try Again!, '{word_input}' is wrong!!\n", 'light_red'))
print(css("Friend Vs Friend!\nSet Up Your Word\n", 'white'))
word = input(css("Type a word for someone to guess: ", 'yellow', attrs=['bold']))
wordLenght= len(word)
trace = " * " * wordLenght
hint = input(css("Type a hint for that word: ", 'yellow', attrs=['bold']))
if word == word.lower():
text = "The word is lower cased"
elif word != word.lower():
text = "The word is capitalized"
if hint == hint:
sys('cls')
guess()
def start_menu():
title()
print(css("Welcome to Guess That Word V2!.\nThis is a remake of the original,\ndev log:\n\n Single Player Mode has now been added!\n New Logo Design\n You can now input words in terminal for someone to guess!\n Not much changes\n", 'white', attrs=['bold']))
option = {1:"friend_vs_friend",
2:"Single_Player",
3:"Exit"
}
for num,option in option.items():
num = css(num, 'white')
option = css(option, 'yellow', attrs=['bold'])
print(f'[{num}]{option}', end='\n')
while True:
option_choose = input('\n:')
if option_choose == '1':
sys('cls')
time.sleep(0.045)
return main()
elif option_choose == '2':
sys("cls")
time.sleep(0.045)
return singleplayer.start_menu2()
elif option_choose == '3':
time.sleep(0.045)
break
else:
sys('cls')
return start_menu()
if __name__ == "__main__":
start_menu()