diff --git a/CONTRIBUTERS.MD b/CONTRIBUTERS.MD index cfe3ca496..b174abb4b 100644 --- a/CONTRIBUTERS.MD +++ b/CONTRIBUTERS.MD @@ -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 | - \ No newline at end of file +| Praggya Verma | [@praggyaverma](https://github.com/praggyaverma) | 1 +| Sanskar Kharya | [@MaybeSomeone-arc18] (https://github.com/MaybeSomeone-arc18) | \ No newline at end of file diff --git a/Python/mini_adventure_game.py b/Python/mini_adventure_game.py new file mode 100644 index 000000000..a51b1f965 --- /dev/null +++ b/Python/mini_adventure_game.py @@ -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()