Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shell.py 1.1KB

6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
6 kuukautta sitten
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. from cli import *
  2. from llm import *
  3. from shell_Context import *
  4. # Greet the user upon start
  5. @llm_by_value
  6. def shell_launch(
  7. c: shell_Context
  8. ) -> shell_Context:
  9. c.cCLI = cli_greetUser(c.cCLI)
  10. c.cCLI.input = "help"
  11. c.cCLI = cli_showHelp(c.cCLI)
  12. c.output = c.cCLI.outputGreeting + "\n" + c.cCLI.outputHelp
  13. return c
  14. #}
  15. # Switch among CLI functions based on input
  16. #
  17. # Conditions:
  18. # 1. User requested to quit the game
  19. # 2. User plays the game
  20. @llm_by_value
  21. def shell_processInput(
  22. c: shell_Context
  23. ) -> shell_Context:
  24. # Exit
  25. if (
  26. c.input == "e" or
  27. c.input == "exit" or
  28. c.input == "q" or
  29. c.input == "quit"
  30. ):
  31. c.exit = True
  32. return c
  33. #}
  34. c.cCLI.input = c.input
  35. c.output = ""
  36. # Help (aka commands)
  37. c.cCLI = cli_showHelp(c.cCLI)
  38. if (
  39. c.cCLI.recentField == "outputHelp"
  40. ):
  41. c.output += c.cCLI.outputHelp
  42. #}
  43. c.cCLI = cli_selectItem(c.cCLI)
  44. # Game actions.
  45. if (
  46. c.cCLI.recentField == "cMemory"
  47. ):
  48. psCLI = cli_shouldPromptSelection(c.cCLI)
  49. if (
  50. psCLI.recentField == "outputPromptSelection"
  51. ):
  52. c.output += psCLI.outputPromptSelection
  53. #}
  54. #}
  55. return c
  56. #}