Word Bomb Script -

def bomb_timer(seconds, player_name): """Timer thread that waits and then explodes.""" time.sleep(seconds) print(f"\nšŸ’£ BOOM! {player_name} took too long! šŸ’£") print(f"Required letters were: {required_letters}") exit(0) GAME SETUP ------------------------------ print("\nšŸ”„šŸ”„šŸ”„ WORD BOMB šŸ”„šŸ”„šŸ”„") print("Players take turns. You must say a word containing the given letters.") print("You have 5 seconds before the bomb explodes!") print("Type 'quit' to exit.\n")

# Start bomb timer timer = threading.Thread(target=bomb_timer, args=(5, current_player)) timer.daemon = True timer.start() Word Bomb Script

print("\n" + "="*50) print(f"šŸ’£ {current_player}'s turn! Bomb is ticking...") print(f"šŸ”¤ Required letters: {required_letters.upper()}") print("ā±ļø You have 5 seconds!") You must say a word containing the given letters

print(f"āœ… Correct! '{user_word}' contains '{required_letters}'.") print(f"šŸ”Ŗ Bomb defused! Passing to next player...") Passing to next player

if user_word == 'quit': print("Game ended.") break

# If bomb hasn't exploded yet, cancel by not calling exit (thread is still alive, but we'll just not let it affect) # Better: just check if time's up if elapsed > 5: print(f"\nšŸ’£ BOOM! Too slow, {current_player}!") print(f"Required letters were: {required_letters}") break

if not is_valid_word(user_word, required_letters): print(f"\nāŒ WRONG! '{user_word}' does not contain '{required_letters}'.") print(f"{current_player} loses!") break