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.

107 lines
2.8KB

  1. import arcade
  2. from cli import *
  3. from cli_test import *
  4. from ctx import *
  5. from ctx_test2 import *
  6. from desktop import *
  7. from desktop_Platform import *
  8. from desktop_Window import *
  9. from gui import *
  10. from gui_aux_test import *
  11. from gui_test import *
  12. from llm_test import *
  13. from llm_test_Python import *
  14. from memory_test import *
  15. import sys
  16. print(ctx_test_Controller_executeFunctions_registerFunction_set())
  17. print(ctx_test_Controller_processQueue())
  18. print(ctx_test_Controller_registerFieldCallback_match())
  19. print(ctx_test_Controller_registerFieldCallback_mismatch())
  20. print(ctx_test_memoryContext_field())
  21. print(ctx_test_memoryContext_setField())
  22. print(llm_test_Python_copyByValue())
  23. print(llm_test_isDigit_digit())
  24. print(llm_test_isDigit_notDigit())
  25. print(llm_test_strToInt())
  26. print(memory_test_detectMismatchedItems())
  27. print(memory_test_detectMismatchedItems_itemTwice())
  28. print(memory_test_detectVictory())
  29. print(memory_test_generateConstPlayfield())
  30. print(memory_test_hideMatchingItems())
  31. print(memory_test_selectItem_1x())
  32. print(memory_test_selectItem_2x())
  33. print(memory_test_selectItem_3x())
  34. print(cli_test_exit_e())
  35. print(cli_test_exit_exit())
  36. print(cli_test_exit_victory())
  37. print(cli_test_exit_q())
  38. print(cli_test_exit_quit())
  39. print(cli_test_goOn())
  40. print(cli_test_greetUser())
  41. print(cli_test_showHelp_h())
  42. print(cli_test_showHelp_help())
  43. print(cli_test_selectItem())
  44. print(cli_test_promptSecondItemSelection())
  45. print(cli_test_reportMatchedItems())
  46. print(cli_test_reportMismatchedItems())
  47. print(cli_test_reportVictory())
  48. print(test_gui_aux_cellPositions())
  49. print(test_gui_generateTextureDescriptions())
  50. ctrl = ctx_Controller(memory_createContext())
  51. ctrl.registerFunctions([
  52. # cli_exit,
  53. # cli_goOn,
  54. # cli_greetUser,
  55. # cli_promptSecondItemSelection,
  56. # cli_reportMatchedItems,
  57. # cli_reportMismatchedItems,
  58. # cli_reportVictory,
  59. # cli_selectItem,
  60. # cli_showHelp,
  61. gui_generateTextureDescriptions,
  62. gui_generateTilePositions,
  63. memory_detectMismatchedItems,
  64. memory_detectVictory,
  65. memory_generateConstPlayfield,
  66. memory_hideMatchingItems,
  67. memory_selectItem,
  68. ])
  69. def printOutput(c):
  70. if c.recentField.startswith("output"):
  71. print(c.field(c.recentField))
  72. ctrl.registerCallback(printOutput)
  73. ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
  74. p = desktop_Platform()
  75. # Copy context to platform.
  76. def copyContext(c):
  77. p.c = c
  78. ctrl.registerCallback(copyContext)
  79. ctrl.set("didLaunch", True)
  80. ctrl.set("playfieldSize", 2)
  81. ctrl.set("cellSize", 25)
  82. ctrl.set("tileImage", "res/tiles.png")
  83. ctrl.set("tileImageCount", 3)
  84. ctrl.set("tileImageHeight", 100)
  85. ctrl.set("tileImageWidth", 75)
  86. ctrl.set("windowWidth", 900)
  87. ctrl.set("windowHeight", 600)
  88. ctrl.set("windowAntialiasing", False)
  89. ctrl.set("windowBackgroundColor", "#ffffff")
  90. ctrl.set("windowTitle", "OGS Memory")
  91. desktop_loadTextures(p)
  92. wnd = desktop_Window(p)
  93. arcade.run()