Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTERS.MD
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,5 @@
| Daniel Aparecido | [@oaparecido](https://github.com/Oaparecido) | 1 |
| Sparsh Shyam | [@sparshstark](https://github.com/sparshstark) | 1 |
| Kalkeshwar Yamsani | [@kalkeshwar](https://github.com/kalkeshwar) | 1 |
| Praggya Verma | [@praggyaverma](https://github.com/praggyaverma) | 1 |
| Praggya Verma | [@praggyaverma](https://github.com/praggyaverma) | 1
| Sanskar Kharya | [@MaybeSomeone-arc18] (https://github.com/MaybeSomeone-arc18) |
32 changes: 32 additions & 0 deletions Python/mini_adventure_game.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# mini_adventure_game.py
import random

def mini_adventure_game():
print("πŸ—ΊοΈ Welcome to the Mini Adventure Game!")
print("You are on a quest to find the hidden treasure.\n")

paths = ["forest", "cave", "river"]
treasures = ["gold coins", "a magic sword", "an ancient scroll"]
obstacles = ["a wild beast", "a sneaky trap", "a dark fog"]

while True:
print(f"Paths available: {', '.join(paths)}")
choice = input("Which path will you take? ").lower()

if choice not in paths:
print("⚠️ Invalid path. Choose wisely!")
continue

encounter = random.choice(obstacles + treasures)
if encounter in treasures:
print(f"πŸŽ‰ You found {encounter}! You win!")
else:
print(f"πŸ’€ Oh no! You encountered {encounter}. You lose!")

replay = input("Do you want to play again? (yes/no): ").lower()
if replay != "yes":
print("Thanks for playing! πŸ†")
break

if __name__ == "__main__":
mini_adventure_game()