-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (26 loc) · 854 Bytes
/
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
import web_scrape_words as scrape
import hangman
def main():
# get words dict from web page with themes as keys & list of words as values
words = scrape.get_words_create_files()
'''
files = words.keys()
words_list = words.values()
for file in list(files):
print(file)
'''
repeat_game = True
while repeat_game == True :
# user selects a theme
theme = hangman.select_theme(words)
hangman.play_game(words, theme)
repeat = ''
while (repeat.lower() not in ['y', 'n']) :
repeat = input('\n Would you like to play another one? (Y/n) ')
if repeat == 'y':
repeat_game = True
else :
repeat_game = False
print('**********Thank you for playing*********')
if __name__ == "__main__":
main()