Added initial files
[word-grid-game.git] / word_grid_game.py
1 import random
2
3 all_words=[i.strip() for i in open("words.txt").readlines()]
4
5 def get_difficulty():
6 game="fail"
7 while game!="EASY" and game != "HARD":
8 game=input("choose the difficulty easy or hard...").upper()
9 print("you have 30 seconds (45 if you picked 'hard') to memorise a grid of words. Good luck...")
10 return game == "EASY"
11
12 def words_for_game(words, is_easy):
13 if is_easy:
14 return words[:10]
15 else:
16 return words[:]
17
18 def print_grid(words):
19 print(words)
20
21
22 # random.shuffle(words)
23 # added_word=words.pop()
24 # for i in range(3):
25 # print(words[3*i],words[3*i+1],words[3*i+2])
26
27 def play_game():
28 is_easy = get_difficulty()
29 words = words_for_game(all_words, is_easy)
30 random.shuffle(words)
31 print_grid(words)