diff options
| -rwxr-xr-x | gpt_adventure.py (renamed from ai_dungeon.py) | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/ai_dungeon.py b/gpt_adventure.py index bd39133..c2137db 100755 --- a/ai_dungeon.py +++ b/gpt_adventure.py @@ -1,6 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -i python3 -p "python3.withPackages (pkgs: with pkgs; [ keras nltk pytorch transformers ])" -"""AI Dungeon is a text-adventure style game powered by AI.""" +"""GPT adventure is a text-adventure style game powered by AI.""" import argparse import re @@ -68,18 +68,6 @@ def pick_flavor() -> str: "purifier for your settlement. You arrive at an\n" "abandoned settlement to the east of your home." ), - "doctor": ( - "Your name is Amelia Plenn. Today is your doctors appointment.\n" - "You're kind of not looking forward to it because your doctor\n" - "is kind of weird, but today when you get to the doctor's office\n" - "it's a different person than usual.\n" - 'The new doctor says to you, "Hello, my name is Doctor Cockman.\n' - "It's my pleasure to see you today.\"\n" - "Doctor Cockman is very handsome, and you feel yourself blush as\n" - "he leads you to the doctor's seat. You sit in the seat and he\n" - "runs his warm hands up and down your arms.\n" - '"Are you feeling alright?" Doctor Cockman asks.' - ), "political": ( "You are a political dissident and revolutionary named\n" "Vladimir Lenin, hiding in exile in Finland while your homeland \n" @@ -96,6 +84,7 @@ def pick_flavor() -> str: for i, (scenario, script) in enumerate(flavors.items()): print(f"{i}.\t{scenario}") choices.append(script) + print(f"{len(choices)}.\tcustom") while True: choice = input("Choose a scenario: ") try: @@ -103,6 +92,9 @@ def pick_flavor() -> str: except ValueError: print("Input must be an integer.") continue + if choice_int == len(choices): + print("Enter a custom prompt. Press control-D when you're done.") + return sys.stdin.read().strip() try: return choices[choice_int] except IndexError: |
