From 54c1e2ae9b1d9aee32e8bd7a8569aa3dd8516678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 23 May 2024 22:35:10 +0300 Subject: [PATCH] d --- v4/shell.cpp | 52 ------------------------------ v4/shell.h | 9 ------ v4/shell.py | 91 ---------------------------------------------------- 3 files changed, 152 deletions(-) delete mode 100644 v4/shell.cpp delete mode 100644 v4/shell.h delete mode 100644 v4/shell.py diff --git a/v4/shell.cpp b/v4/shell.cpp deleted file mode 100644 index 4577c81..0000000 --- a/v4/shell.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include "cli.h" -#include "cli_Context.h" -#include "memory.h" -#include "memory_Context.h" -#include "shell.h" - -// Greet the user upon start - -shell_Context shell_launch( - shell_Context c -) { - c.cCLI = cli_greetUser(c.cCLI); - c.cCLI.input = "help"; - c.cCLI = cli_showHelp(c.cCLI); - c.output = c.cCLI.outputGreeting + "\n" + c.cCLI.outputHelp; - return c; -} - -// Switch among CLI functions based on input -// -// Conditions: -// 1. User requested to quit the game -// 2. User plays the game - - - -shell_Context shell_processInput( - shell_Context c -) { - if ( - c.input == "e" || - c.input == "exit" || - c.input == "q" || - c.input == "quit" - ) { - c.exit = true; - return c; - } - c.cCLI.input = c.input; - c.output = ""; - c.cCLI = cli_showHelp(c.cCLI); - if ( - c.cCLI.recentField == "outputHelp" - ) { - c.output += c.cCLI.outputHelp; - } - return c; -} - diff --git a/v4/shell.h b/v4/shell.h deleted file mode 100644 index a06e959..0000000 --- a/v4/shell.h +++ /dev/null @@ -1,9 +0,0 @@ -#include "shell_Context.h" - -#ifndef shell_HEADER -#define shell_HEADER - -shell_Context shell_launch(shell_Context); -shell_Context shell_processInput(shell_Context); - -#endif // shell_HEADER diff --git a/v4/shell.py b/v4/shell.py deleted file mode 100644 index 33f84a4..0000000 --- a/v4/shell.py +++ /dev/null @@ -1,91 +0,0 @@ -from cli import * -from llm import * -from shell_Context import * - -# Greet the user upon start -@llm_by_value -def shell_launch( - c: shell_Context -) -> shell_Context: - c.cCLI = cli_greetUser(c.cCLI) - c.cCLI.input = "help" - c.cCLI = cli_showHelp(c.cCLI) - - c.output = c.cCLI.outputGreeting + "\n" + c.cCLI.outputHelp - return c -#} - -# Switch among CLI functions based on input -# -# Conditions: -# 1. User requested to quit the game -# 2. User plays the game -@llm_by_value -def shell_processInput( - c: shell_Context -) -> shell_Context: - # Exit - if ( - c.input == "e" or - c.input == "exit" or - c.input == "q" or - c.input == "quit" - ): - c.exit = True - return c - #} - - c.cCLI.input = c.input - c.output = "" - - # Help (aka commands) - c.cCLI = cli_showHelp(c.cCLI) - if ( - c.cCLI.recentField == "outputHelp" - ): - c.output += c.cCLI.outputHelp - #} - - c.cCLI = cli_selectItem(c.cCLI) - - # Game actions. - if ( - c.cCLI.recentField == "cMemory" - ): - # Prompt second item. - cli = cli_shouldPromptSelection(c.cCLI) - if ( - cli.recentField == "outputPromptSelection" - ): - c.output += cli.outputPromptSelection - #} - - # Check matching items. - cli = c.cCLI - cli.cMemory = memory_shouldHideMatchingItems(c.cCLI.cMemory) - cli.recentField = "cMemory" - # Report matched items. - cli = cli_shouldReportMatchedItems(cli) - if ( - cli.recentField == "outputMatchedItems" - ): - c.output += cli.outputMatchedItems - c.cCLI.cMemory = memory - #} - - # Check mismatching items. - memory = memory_shouldDeselectMismatchedItems(c.cCLI.cMemory) - c.cCLI.recentField = "cMemory" - # Report mismatched items. - cli = cli_shouldReportMismatchedItems(c.cCLI) - if ( - cli.recentField == "outputMismatchedItems" - ): - c.output += cli.outputMismatchedItems - c.cCLI.cMemory = memory - #} - - #} - - return c -#}