Skip to content

Commit d1f21ab

Browse files
committed
game
gae py by ekansh ik no one will ever see this and no one will ever acknowledge this shit but one day maybe one day awadhi will see this commit
1 parent 6058f50 commit d1f21ab

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

useless python game/game.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import random
2+
3+
# List of random syllables to generate nonsense words
4+
syllables = ['bli', 'blu', 'bra', 'cri', 'cro', 'dra', 'dro', 'fla', 'flo', 'gra', 'gro', 'pli', 'plo', 'sli', 'slo', 'tra', 'tro']
5+
6+
def generate_nonsense_word():
7+
return random.choice(syllables) + random.choice(syllables) + random.choice(syllables)
8+
9+
def play_game():
10+
print("Welcome to the Silly Word Generator Game!")
11+
print("In this game, you'll have to guess the magic word.")
12+
print("But beware... it's complete nonsense!")
13+
14+
# Generate a list of nonsense words
15+
words = [generate_nonsense_word() for _ in range(5)]
16+
17+
# Randomly select one word as the "magic word"
18+
magic_word = random.choice(words)
19+
20+
print("\nHere are your nonsense words:")
21+
for i, word in enumerate(words):
22+
print(f"{i + 1}. {word}")
23+
24+
# Get the player's guess
25+
guess = input("\nWhich word do you think is the magic word? (Enter the number): ")
26+
27+
try:
28+
guess_index = int(guess) - 1
29+
if words[guess_index] == magic_word:
30+
print(f"\nCongratulations! {words[guess_index]} was the magic word! You win!")
31+
else:
32+
print(f"\nOops! The magic word was actually {magic_word}. Better luck next time!")
33+
except:
34+
print("\nThat's not a valid number. Game over!")
35+
36+
if __name__ == "__main__":
37+
play_game()

0 commit comments

Comments
 (0)