Research portable Memory game | Исследовать портируемую игру Память
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.1KB

  1. from cli import *
  2. from cli_test import *
  3. from ctx import *
  4. from ctx_test2 import *
  5. #from ctx_test import *
  6. #from ctx_test_Python import *
  7. from llm_test import *
  8. from llm_test_Python import *
  9. from memory_test import *
  10. import sys
  11. print(ctx_test_Controller_executeFunctions_registerFunction_set())
  12. print(ctx_test_Controller_processQueue())
  13. print(ctx_test_Controller_registerFieldCallback_match())
  14. print(ctx_test_Controller_registerFieldCallback_mismatch())
  15. print(ctx_test_memoryContext_field())
  16. print(ctx_test_memoryContext_setField())
  17. print(llm_test_Python_copyByValue())
  18. print(llm_test_isDigit_digit())
  19. print(llm_test_isDigit_notDigit())
  20. print(llm_test_strToInt())
  21. print(memory_test_detectMismatchedItems())
  22. print(memory_test_detectMismatchedItems_itemTwice())
  23. print(memory_test_detectVictory())
  24. print(memory_test_generateConstPlayfield())
  25. print(memory_test_hideMatchingItems())
  26. print(memory_test_selectItem_1x())
  27. print(memory_test_selectItem_2x())
  28. print(memory_test_selectItem_3x())
  29. print(cli_test_exit_e())
  30. print(cli_test_exit_exit())
  31. print(cli_test_exit_victory())
  32. print(cli_test_exit_q())
  33. print(cli_test_exit_quit())
  34. print(cli_test_goOn())
  35. print(cli_test_greetUser())
  36. print(cli_test_showHelp_h())
  37. print(cli_test_showHelp_help())
  38. print(cli_test_selectItem())
  39. print(cli_test_promptSecondItemSelection())
  40. print(cli_test_reportMatchedItems())
  41. print(cli_test_reportMismatchedItems())
  42. print(cli_test_reportVictory())
  43. ctrl = ctx_Controller(memory_createContext())
  44. ctrl.registerFunctions([
  45. cli_exit,
  46. cli_goOn,
  47. cli_greetUser,
  48. cli_promptSecondItemSelection,
  49. cli_reportMatchedItems,
  50. cli_reportMismatchedItems,
  51. cli_reportVictory,
  52. cli_selectItem,
  53. cli_showHelp,
  54. memory_detectMismatchedItems,
  55. memory_detectVictory,
  56. memory_generateConstPlayfield,
  57. memory_hideMatchingItems,
  58. memory_selectItem,
  59. ])
  60. def printOutput(c):
  61. if c.recentField.startswith("output"):
  62. print(c.field(c.recentField))
  63. ctrl.registerCallback(printOutput)
  64. ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
  65. ctrl.set("didLaunch", True)
  66. ctrl.set("playfieldSize", 2)
  67. for line in sys.stdin:
  68. ln = line.rstrip()
  69. ctrl.set("input", ln)