|
- import arcade
- from cli import *
- from cli_test import *
- from ctx import *
- from ctx_test2 import *
- from desktop import *
- from desktop_Platform import *
- from desktop_SequentialTimer import *
- from desktop_Window import *
- from gui import *
- from gui_aux_test import *
- from gui_test import *
- from llm_test import *
- from llm_test_Python import *
- from memory_test import *
- import sys
-
- print(ctx_test_Controller_executeFunctions_registerFunction_set())
- print(ctx_test_Controller_processQueue())
- print(ctx_test_Controller_registerFieldCallback_match())
- print(ctx_test_Controller_registerFieldCallback_mismatch())
- print(ctx_test_memoryContext_field())
- print(ctx_test_memoryContext_setField())
-
- print(llm_test_Python_copyByValue())
- print(llm_test_isDigit_digit())
- print(llm_test_isDigit_notDigit())
- print(llm_test_strToInt())
-
- print(memory_test_detectMismatchedItems())
- print(memory_test_detectMismatchedItems_itemTwice())
- print(memory_test_detectVictory())
- print(memory_test_generateConstPlayfield())
- print(memory_test_hideMatchingItems())
- print(memory_test_selectItem_1x())
- print(memory_test_selectItem_2x())
- print(memory_test_selectItem_3x())
-
- print(cli_test_exit_e())
- print(cli_test_exit_exit())
- print(cli_test_exit_victory())
- print(cli_test_exit_q())
- print(cli_test_exit_quit())
- print(cli_test_goOn())
- print(cli_test_greetUser())
- print(cli_test_showHelp_h())
- print(cli_test_showHelp_help())
- print(cli_test_selectItem())
- print(cli_test_promptSecondItemSelection())
- print(cli_test_reportMatchedItems())
- print(cli_test_reportMismatchedItems())
- print(cli_test_reportVictory())
-
- print(test_gui_aux_cellPositions())
- print(test_gui_generateTextureDescriptions())
- print(test_gui_generateTilePositions())
-
- ctrl = ctx_Controller(memory_createContext())
- ctrl.registerFunctions([
- # cli_exit,
- # cli_goOn,
- # cli_greetUser,
- # cli_promptSecondItemSelection,
- # cli_reportMatchedItems,
- # cli_reportMismatchedItems,
- # cli_reportVictory,
- # cli_selectItem,
- # cli_showHelp,
- gui_generateTextureDescriptions,
- gui_generateTilePositions,
- memory_detectMismatchedItems,
- memory_detectVictory,
- memory_generateConstPlayfield,
- memory_hideMatchingItems,
- memory_selectItem,
- ])
-
- def printOutput(c):
- if c.recentField.startswith("output"):
- print(c.field(c.recentField))
- ctrl.registerCallback(printOutput)
- ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
-
- p = desktop_Platform()
- p.ctrl = ctrl
- p.sequentialTimer = desktop_SequentialTimer()
- p.sequentialTimer.ctrl = ctrl
-
- # Copy context to platform.
- # And process lots of functions that are interested in changes.
- def process(c):
- p.c = c
- desktop_displaySelectedTile(p)
- desktop_hideMatchingTiles(p)
- desktop_scheduleHidingOfMatchingTiles(p)
- ctrl.registerCallback(process)
-
- ctrl.set("didLaunch", True)
- ctrl.set("playfieldSize", 2)
-
- ctrl.set("cellSize", 25)
- ctrl.set("hideMatchingTilesDelay", 500)
- ctrl.set("tileImage", "res/tiles.png")
- ctrl.set("tileImageCount", 3)
- ctrl.set("tileImageHeight", 100)
- ctrl.set("tileImageWidth", 75)
- ctrl.set("windowWidth", 900)
- ctrl.set("windowHeight", 600)
- ctrl.set("windowAntialiasing", False)
- ctrl.set("windowBackgroundColor", "#ffffff")
- ctrl.set("windowTitle", "OGS Memory")
-
- desktop_loadTextures(p)
- desktop_createDeselectedTiles(p)
- desktop_createSelectedTiles(p)
-
- wnd = desktop_Window(p)
- arcade.run()
|