summaryrefslogtreecommitdiffstats
path: root/gpt_adventure.py
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-02-16 05:39:46 +0000
committerRose Hogenson <rhogenson@posteo.net>2022-02-16 05:39:46 +0000
commit80d4689fe751b4bad22d231b8b6fdd6f16f4caa0 (patch)
tree24dd4d310fd205966b33f6512f0c7aece0c6438d /gpt_adventure.py
parent7d447d586446e82a88252ce81136a55556c09503 (diff)
downloadgpt-adventure-80d4689fe751b4bad22d231b8b6fdd6f16f4caa0.tar.zst
Add a custom scenario option.
Diffstat (limited to 'gpt_adventure.py')
-rwxr-xr-xgpt_adventure.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpt_adventure.py b/gpt_adventure.py
index c151cdc..68f8f58 100755
--- a/gpt_adventure.py
+++ b/gpt_adventure.py
@@ -73,6 +73,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:
@@ -80,6 +81,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: