diff --git a/games/chill/coin_flip/__pycache__/game.cpython-313.pyc b/games/chill/coin_flip/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..8993f5d Binary files /dev/null and b/games/chill/coin_flip/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/even_or_odd/__pycache__/game.cpython-313.pyc b/games/chill/even_or_odd/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..f714ef4 Binary files /dev/null and b/games/chill/even_or_odd/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/hangman/__pycache__/game.cpython-313.pyc b/games/chill/hangman/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..08aee5d Binary files /dev/null and b/games/chill/hangman/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/higher_lower/__pycache__/game.cpython-313.pyc b/games/chill/higher_lower/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..8feea10 Binary files /dev/null and b/games/chill/higher_lower/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/ice_cream_generator/__pycache__/game.cpython-313.pyc b/games/chill/ice_cream_generator/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..bc09f12 Binary files /dev/null and b/games/chill/ice_cream_generator/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/ice_cream_generator/game.py b/games/chill/ice_cream_generator/game.py new file mode 100644 index 0000000..82b8f20 --- /dev/null +++ b/games/chill/ice_cream_generator/game.py @@ -0,0 +1,85 @@ +import random + +AUTHOR = "Divija2612" + +def run(): + print(f"šŸ¦ Welcome to Ice Cream Machine by {AUTHOR}!") + print("Fulfill customer orders by choosing the correct ingredients.\n") + + ingredients = [ + "Chocolate", + "Vanilla", + "Banana", + "Cookie", + "Strawberry", + "Caramel", + "Mint", + "Mango" + ] + + orders = { + "I'm craving a tropical fruit combo.": ["Banana", "Mango"], + "Give me the classic chocolate and vanilla flavor.": ["Chocolate", "Vanilla"], + "I want something cool with mint and vanilla.": ["Mint", "Vanilla"], + "Can I get a cookie caramel dessert?": ["Cookie", "Caramel"], + "I'd love a strawberry vanilla favorite.": ["Strawberry", "Vanilla"], + "Make me a rich chocolate cookie delight.": ["Chocolate", "Cookie"], + "I'm in the mood for a fruity strawberry mango blend.": ["Mango", "Strawberry"], + "Give me a refreshing mint chocolate flavor.": ["Chocolate", "Mint"] +} + + score = 0 + rounds_played = 0 + + while True: + rounds_played += 1 + + description, correct_ingredients = random.choice( + list(orders.items()) + ) + + print(f"\n--- Round {rounds_played} ---") + print("\nšŸ§‘ Customer says:") + print(f'"{description}!"') + + print("\nAvailable ingredients:") + for ingredient in ingredients: + print(f"- {ingredient}") + + choice1 = input("\nChoose ingredient 1: ").strip().title() + choice2 = input("Choose ingredient 2: ").strip().title() + + player_choice = {choice1, choice2} + correct_choice = set(correct_ingredients) + + if player_choice == correct_choice: + print("āœ… Perfect order! Customer is happy!") + score += 1 + else: + print("āŒ That's not what the customer wanted.") + print( + f"Correct ingredients were: " + f"{correct_ingredients[0]} + {correct_ingredients[1]}" + ) + + print(f"⭐ Score: {score}/{rounds_played}") + + play_again = input( + "\nWould you like to serve another customer? (y/n): " + ).strip().lower() + + if play_again != "y": + break + + print("\nšŸ† Game Over!") + print(f"Final Score: {score}/{rounds_played}") + + if rounds_played > 0: + success_rate = (score / rounds_played) * 100 + + if success_rate == 100: + print("🌟 Master Ice Cream Maker!") + elif success_rate >= 60: + print("šŸ˜„ Great job serving customers!") + else: + print("šŸ¦ Keep practicing your flavor combinations!") \ No newline at end of file diff --git a/games/chill/reaction_time/__pycache__/game.cpython-313.pyc b/games/chill/reaction_time/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..62cd458 Binary files /dev/null and b/games/chill/reaction_time/__pycache__/game.cpython-313.pyc differ diff --git a/games/chill/timer/__pycache__/game.cpython-313.pyc b/games/chill/timer/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..b302e42 Binary files /dev/null and b/games/chill/timer/__pycache__/game.cpython-313.pyc differ diff --git a/games/logic/calculator_game/__pycache__/game.cpython-313.pyc b/games/logic/calculator_game/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..9fa33dd Binary files /dev/null and b/games/logic/calculator_game/__pycache__/game.cpython-313.pyc differ diff --git a/games/logic/glitch_machine/game.py b/games/logic/glitch_machine/game.py new file mode 100644 index 0000000..886dcc0 --- /dev/null +++ b/games/logic/glitch_machine/game.py @@ -0,0 +1,107 @@ +""" +Glitch Machine +A corrupted word flashes on screen, replacing some of its letters with +random symbols (e.g. TERMINAL -> T#RM!N@L). The player must type the +original, uncorrupted word before the glitch overtakes the system. + +Play multiple rounds and rack up points - score increases with word +length and decreases the longer you take to answer. +""" + +import random +import string +import time + +WORDS = [ + "TERMINAL", "PYTHON", "KEYBOARD", "COMPILER", "FUNCTION", + "VARIABLE", "ALGORITHM", "DEBUGGER", "ARCADE", "GLITCH", + "PROGRAM", "CONSOLE", "SCRIPT", "BINARY", "NETWORK", + "PROCESS", "MACHINE", "SIGNAL", "MEMORY", "MODULE", +] + +GLITCH_SYMBOLS = "#!@$%&*?^~" + +ROUNDS_PER_GAME = 5 + + +def corrupt_word(word, difficulty=0.4): + """Replace a portion of the word's letters with random glitch symbols. + + At least one letter is always corrupted so the puzzle is never trivial, + and at least one letter is always left visible as a hint. + """ + word_chars = list(word) + length = len(word_chars) + + num_to_corrupt = max(1, round(length * difficulty)) + num_to_corrupt = min(num_to_corrupt, length - 1) if length > 1 else 0 + + indices = list(range(length)) + random.shuffle(indices) + corrupt_indices = set(indices[:num_to_corrupt]) + + corrupted_chars = [ + random.choice(GLITCH_SYMBOLS) if i in corrupt_indices else ch + for i, ch in enumerate(word_chars) + ] + return "".join(corrupted_chars) + + +def print_banner(): + print("=" * 40) + print(" G L I T C H M A C H I N E") + print("=" * 40) + print("A corrupted string flickers across the terminal.") + print("Type the original word before the system glitches out!") + print("-" * 40) + + +def play_round(round_num, used_words): + available = [w for w in WORDS if w not in used_words] + if not available: + available = WORDS + used_words.clear() + + word = random.choice(available) + used_words.add(word) + + corrupted = corrupt_word(word) + + print(f"\nRound {round_num}/{ROUNDS_PER_GAME}") + print(f"Corrupted signal: {corrupted}") + + start_time = time.time() + guess = input("Decode it > ").strip().upper() + elapsed = time.time() - start_time + + if guess == word: + base_points = len(word) * 10 + time_penalty = int(elapsed) * 2 + points = max(5, base_points - time_penalty) + print(f"Signal restored! It was {word}. (+{points} points)") + return points + else: + print(f"Decryption failed. The word was {word}.") + return 0 + + +def run(): + print_banner() + + score = 0 + used_words = set() + + for round_num in range(1, ROUNDS_PER_GAME + 1): + score += play_round(round_num, used_words) + print(f"Current score: {score}") + + print("\n" + "=" * 40) + print(f"GAME OVER - Final Score: {score}") + if score >= 200: + print("Signal integrity: EXCELLENT") + elif score >= 100: + print("Signal integrity: STABLE") + else: + print("Signal integrity: CRITICAL") + print("=" * 40) + diff --git a/games/logic/quiz/__pycache__/game.cpython-313.pyc b/games/logic/quiz/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..310b011 Binary files /dev/null and b/games/logic/quiz/__pycache__/game.cpython-313.pyc differ diff --git a/games/random/password-generator/__pycache__/game.cpython-313.pyc b/games/random/password-generator/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..df147fa Binary files /dev/null and b/games/random/password-generator/__pycache__/game.cpython-313.pyc differ diff --git a/games/random/rock-paper-scissor/__pycache__/game.cpython-313.pyc b/games/random/rock-paper-scissor/__pycache__/game.cpython-313.pyc new file mode 100644 index 0000000..92da2c6 Binary files /dev/null and b/games/random/rock-paper-scissor/__pycache__/game.cpython-313.pyc differ