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.

112 lines
2.9KB

  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. print(test_gui_generateTilePositions())
  51. ctrl = ctx_Controller(memory_createContext())
  52. ctrl.registerFunctions([
  53. # cli_exit,
  54. # cli_goOn,
  55. # cli_greetUser,
  56. # cli_promptSecondItemSelection,
  57. # cli_reportMatchedItems,
  58. # cli_reportMismatchedItems,
  59. # cli_reportVictory,
  60. # cli_selectItem,
  61. # cli_showHelp,
  62. gui_generateTextureDescriptions,
  63. gui_generateTilePositions,
  64. memory_detectMismatchedItems,
  65. memory_detectVictory,
  66. memory_generateConstPlayfield,
  67. memory_hideMatchingItems,
  68. memory_selectItem,
  69. ])
  70. def printOutput(c):
  71. if c.recentField.startswith("output"):
  72. print(c.field(c.recentField))
  73. ctrl.registerCallback(printOutput)
  74. ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
  75. p = desktop_Platform()
  76. # Keep copy of ctrl in platform, too.
  77. p.ctrl = ctrl
  78. # Copy context to platform.
  79. def copyContext(c):
  80. p.c = c
  81. ctrl.registerCallback(copyContext)
  82. ctrl.set("didLaunch", True)
  83. ctrl.set("playfieldSize", 2)
  84. ctrl.set("cellSize", 25)
  85. ctrl.set("tileImage", "res/tiles.png")
  86. ctrl.set("tileImageCount", 3)
  87. ctrl.set("tileImageHeight", 100)
  88. ctrl.set("tileImageWidth", 75)
  89. ctrl.set("windowWidth", 900)
  90. ctrl.set("windowHeight", 600)
  91. ctrl.set("windowAntialiasing", False)
  92. ctrl.set("windowBackgroundColor", "#ffffff")
  93. ctrl.set("windowTitle", "OGS Memory")
  94. desktop_loadTextures(p)
  95. desktop_createDeselectedTiles(p)
  96. desktop_createSelectedTiles(p)
  97. wnd = desktop_Window(p)
  98. arcade.run()