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

118 lines
3.2KB

  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_SequentialTimer import *
  9. from desktop_Window import *
  10. from gui import *
  11. from gui_aux_test import *
  12. from gui_test import *
  13. from llm_test import *
  14. from llm_test_Python import *
  15. from memory_test import *
  16. import sys
  17. print(ctx_test_Controller_executeFunctions_registerFunction_set())
  18. print(ctx_test_Controller_processQueue())
  19. print(ctx_test_Controller_registerFieldCallback_match())
  20. print(ctx_test_Controller_registerFieldCallback_mismatch())
  21. print(ctx_test_memoryContext_field())
  22. print(ctx_test_memoryContext_setField())
  23. print(llm_test_Python_copyByValue())
  24. print(llm_test_isDigit_digit())
  25. print(llm_test_isDigit_notDigit())
  26. print(llm_test_strToInt())
  27. print(memory_test_detectMismatchedItems())
  28. print(memory_test_detectMismatchedItems_itemTwice())
  29. print(memory_test_detectVictory())
  30. print(memory_test_generateConstPlayfield())
  31. print(memory_test_hideMatchingItems())
  32. print(memory_test_selectItem_1x())
  33. print(memory_test_selectItem_2x())
  34. print(memory_test_selectItem_3x())
  35. print(cli_test_exit_e())
  36. print(cli_test_exit_exit())
  37. print(cli_test_exit_victory())
  38. print(cli_test_exit_q())
  39. print(cli_test_exit_quit())
  40. print(cli_test_goOn())
  41. print(cli_test_greetUser())
  42. print(cli_test_showHelp_h())
  43. print(cli_test_showHelp_help())
  44. print(cli_test_selectItem())
  45. print(cli_test_promptSecondItemSelection())
  46. print(cli_test_reportMatchedItems())
  47. print(cli_test_reportMismatchedItems())
  48. print(cli_test_reportVictory())
  49. print(test_gui_aux_cellPositions())
  50. print(test_gui_generateTextureDescriptions())
  51. print(test_gui_generateTilePositions())
  52. ctrl = ctx_Controller(memory_createContext())
  53. ctrl.registerFunctions([
  54. # cli_exit,
  55. # cli_goOn,
  56. # cli_greetUser,
  57. # cli_promptSecondItemSelection,
  58. # cli_reportMatchedItems,
  59. # cli_reportMismatchedItems,
  60. # cli_reportVictory,
  61. # cli_selectItem,
  62. # cli_showHelp,
  63. gui_generateTextureDescriptions,
  64. gui_generateTilePositions,
  65. memory_detectMismatchedItems,
  66. memory_detectVictory,
  67. memory_generateConstPlayfield,
  68. memory_hideMatchingItems,
  69. memory_selectItem,
  70. ])
  71. def printDbg(c):
  72. print(f"Dbg key/value: '{c.recentField}'/'{c.field(c.recentField)}'")
  73. ctrl.registerCallback(printDbg)
  74. ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
  75. p = desktop_Platform()
  76. p.ctrl = ctrl
  77. p.sequentialTimer = desktop_SequentialTimer()
  78. p.sequentialTimer.callback = lambda key, value: ctrl.set(key, value)
  79. # Copy context to platform.
  80. # And process lots of functions that are interested in changes.
  81. def process(c):
  82. p.c = c
  83. desktop_displaySelectedTile(p)
  84. desktop_hideMatchingTiles(p)
  85. desktop_scheduleHidingOfMatchingTiles(p)
  86. ctrl.registerCallback(process)
  87. ctrl.set("didLaunch", True)
  88. ctrl.set("playfieldSize", 2)
  89. ctrl.set("cellSize", 25)
  90. ctrl.set("hideMatchingTilesDelay", 500)
  91. ctrl.set("tileImage", "res/tiles.png")
  92. ctrl.set("tileImageCount", 3)
  93. ctrl.set("tileImageHeight", 100)
  94. ctrl.set("tileImageWidth", 75)
  95. ctrl.set("windowWidth", 900)
  96. ctrl.set("windowHeight", 600)
  97. ctrl.set("windowAntialiasing", False)
  98. ctrl.set("windowBackgroundColor", "#ffffff")
  99. ctrl.set("windowTitle", "OGS Memory")
  100. desktop_loadTextures(p)
  101. desktop_createDeselectedTiles(p)
  102. desktop_createSelectedTiles(p)
  103. wnd = desktop_Window(p)
  104. arcade.run()