-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import random | ||
|
||
# List of random syllables to generate nonsense words | ||
syllables = ['bli', 'blu', 'bra', 'cri', 'cro', 'dra', 'dro', 'fla', 'flo', 'gra', 'gro', 'pli', 'plo', 'sli', 'slo', 'tra', 'tro'] | ||
|
||
def generate_nonsense_word(): | ||
return random.choice(syllables) + random.choice(syllables) + random.choice(syllables) | ||
|
||
def play_game(): | ||
print("Welcome to the Silly Word Generator Game!") | ||
print("In this game, you'll have to guess the magic word.") | ||
print("But beware... it's complete nonsense!") | ||
|
||
# Generate a list of nonsense words | ||
words = [generate_nonsense_word() for _ in range(5)] | ||
|
||
# Randomly select one word as the "magic word" | ||
magic_word = random.choice(words) | ||
|
||
print("\nHere are your nonsense words:") | ||
for i, word in enumerate(words): | ||
print(f"{i + 1}. {word}") | ||
|
||
# Get the player's guess | ||
guess = input("\nWhich word do you think is the magic word? (Enter the number): ") | ||
|
||
try: | ||
guess_index = int(guess) - 1 | ||
if words[guess_index] == magic_word: | ||
print(f"\nCongratulations! {words[guess_index]} was the magic word! You win!") | ||
else: | ||
print(f"\nOops! The magic word was actually {magic_word}. Better luck next time!") | ||
except: | ||
print("\nThat's not a valid number. Game over!") | ||
|
||
if __name__ == "__main__": | ||
play_game() |