From dd87d668bd9d5cc468059611cb1d17db2d1df88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sat, 15 Jun 2024 22:49:52 +0300 Subject: [PATCH] d --- v5/main-gui.py | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ v5/run-gui-py | 2 ++ 2 files changed, 85 insertions(+) create mode 100644 v5/main-gui.py create mode 100755 v5/run-gui-py diff --git a/v5/main-gui.py b/v5/main-gui.py new file mode 100644 index 0000000..09372e3 --- /dev/null +++ b/v5/main-gui.py @@ -0,0 +1,83 @@ +import arcade +from cli import * +from cli_test import * +from ctx import * +from ctx_test2 import * +#from ctx_test import * +#from ctx_test_Python 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()) + +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, + 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)) + +ctrl.set("didLaunch", True) +ctrl.set("playfieldSize", 2) + +arcade.open_window(800, 600, "Hello, Arcade Memory") +arcade.set_background_color(arcade.color.WHITE) + +arcade.start_render() +arcade.draw_circle_filled(400, 300, 15, arcade.color.BLUE) +arcade.finish_render() + +arcade.run() diff --git a/v5/run-gui-py b/v5/run-gui-py new file mode 100755 index 0000000..70e119b --- /dev/null +++ b/v5/run-gui-py @@ -0,0 +1,2 @@ +#!/bin/bash +/Users/mk/py3.12venv/bin/python3.12 main-gui.py