From 1592b012c6fb8283cfc2f00ca4e78eeb87629f80 Mon Sep 17 00:00:00 2001 From: AccidentallyOnPurpose <4935931+AccidentallyOnPurpose@users.noreply.github.com4935931+AccidentallyOnPurpose@users.noreply.github.com> Date: Mon, 23 Dec 2019 22:56:25 +0800 Subject: [PATCH] enter a number to choose a suggested action --- .vscode/settings.json | 3 +++ play.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cb17472 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/home/wassname/.pyenv/versions/jup3.7.3/bin/python" +} \ No newline at end of file diff --git a/play.py b/play.py index ac3c05f..3ea8f6c 100644 --- a/play.py +++ b/play.py @@ -229,6 +229,8 @@ def play(): action = "" result = story_manager.act(action) colPrint(result, colors["ai-text"]) + elif action in [str(i) for i in range(len(suggested_actions))]: + action = suggested_actions[int(action)] elif action[0] == '"': action = "You say " + action