Research portable Memory game | Исследовать портируемую игру Память
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

49 行
851B

  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. if (
  25. c.input == "e" or
  26. c.input == "exit" or
  27. c.input == "q" or
  28. c.input == "quit"
  29. ):
  30. c.exit = True
  31. return c
  32. #}
  33. c.cCLI.input = c.input
  34. c.output = ""
  35. c.cCLI = cli_showHelp(c.cCLI)
  36. if (
  37. c.cCLI.recentField == "outputHelp"
  38. ):
  39. c.output += c.cCLI.outputHelp
  40. #}
  41. return c
  42. #}