gpt-4.1-2025-04-14· OpenAI
LMArena Human Preference 140K
code a life preview game
- User
code a life preview game
- Assistant
Absolutely! Let’s create a simple "Life Preview Game" in Python. In this game, the player makes choices at different stages of life (childhood, teenage, adulthood), and the game gives a brief "preview" of how their life might turn out based on their choices.
This will be a text-based game you can run in your terminal or command prompt.
Life Preview Game (Python)
def intro(): print("Welcome to the Life Preview Game!") print("You'll make choices at different stages of life and see how your story unfolds.\n") def childhood(): print("Childhood Stage:") print("1. Spend time reading books") print("2. Play video games all day") choice = input("Choose 1 or 2: ") if choice == "1": return "You developed a love for learning." elif choice == "2": return "You became a master at gaming." else: print("Invalid choice. Defaulting to reading books.") return "You developed a love for learning." def teenage(): print("\nTeenage Stage:") print("1. Join a sports team") print("2. Focus on art and music") choice = input("Choose 1 or 2: ") if choice == "1": return "You learned teamwork and discipline." elif choice == "2": return "You became very creative." else: print("Invalid choice. Defaulting to sports team.") return "You learned teamwork and discipline." def adulthood(): print("\nAdulthood Stage:") print("1. Start your own business") print("2. Work for a big company") choice = input("Choose 1 or 2: ") if choice == "1": return "You became an entrepreneur, facing risks and rewards." elif choice == "2": return "You enjoyed stability and climbed the corporate ladder." else: print("Invalid choice. Defaulting to own business.") return "You became an entrepreneur, facing risks and rewards." def life_preview(child, teen, adult): print("\n--- Life Preview ---") print(f"As a child: {child}") print(f"As a teen: {teen}") print(f"As an adult: {adult}") print("\nThanks for playing the Life Preview Game!") def main(): intro() child = childhood() teen = teenage() adult = adulthood() life_preview(child, teen, adult) if __name__ == "__main__": main()
How to Play
- Copy the code above into a file named
life_preview_game.py. - Run it with
python life_preview_game.pyin your terminal. - Make choices at each stage and see your life preview!
Want to expand it?
You can add more stages, more choices, or even random events for more complexity. Let me know if you want a version in another language or with a graphical interface! - Copy the code above into a file named
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.