From b273079e01429ff8b132efaabf96aaa756092455 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, 20 Apr 2024 23:38:46 +0300 Subject: [PATCH] d --- v3/main.py | 3 +++ v3/memory_api_test.py | 1 - v3/memory_seq_test.py | 50 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 v3/memory_seq_test.py diff --git a/v3/main.py b/v3/main.py index 2d8b2ed..04b29d2 100644 --- a/v3/main.py +++ b/v3/main.py @@ -1,7 +1,10 @@ from memory_api_test import * +from memory_seq_test import * print(memory_api_test_deselectMismatchedItems()) print(memory_api_test_detectVictory()) print(memory_api_test_generateConstPlayfield()) print(memory_api_test_hideMatchingItems()) print(memory_api_test_selectItem()) + +print(memory_seq_test_selectTwoItems()) diff --git a/v3/memory_api_test.py b/v3/memory_api_test.py index b169b5f..08a9f9e 100644 --- a/v3/memory_api_test.py +++ b/v3/memory_api_test.py @@ -1,6 +1,5 @@ from memory_api import * from memory_api_Context import * -from llm import * def memory_api_test_deselectMismatchedItems( ) -> str: diff --git a/v3/memory_seq_test.py b/v3/memory_seq_test.py new file mode 100644 index 0000000..3a31bce --- /dev/null +++ b/v3/memory_seq_test.py @@ -0,0 +1,50 @@ +from memory_api import * +from memory_api_Context import * +from memory_seq import * +from memory_seq_Context import * + +def memory_seq_test_selectThreeItems( +) -> str: + seq = memory_seq_createContext() + + seq.api = memory_api_createContext() + seq.api.playfieldSize = 2 + seq.api = memory_api_generateConstPlayfield(seq.api) + + seq.itemsToSelect = [0, 1, 2] + seq = memory_seq_selectItems(seq) + + # See if only one (last) item is selected now. + if ( + seq.api.recentField == "selectedItems" and + len(seq.api.selectedItems) == 1 and + seq.api.selectedItems[0] == 2 + ): + return "OK: memory_seq_selectThreeItems" + #} + return "ERR: memory_seq_selectThreeItems" +#} + +def memory_seq_test_selectTwoItems( +) -> str: + seq = memory_seq_createContext() + + seq.api = memory_api_createContext() + seq.api.playfieldSize = 2 + seq.api = memory_api_generateConstPlayfield(seq.api) + + seq.itemsToSelect = [0, 1] + seq = memory_seq_selectItems(seq) + + # See if both items are selected now. + if ( + seq.api.recentField == "selectedItems" and + len(seq.api.selectedItems) == 2 and + seq.api.selectedItems[0] == 0 and + seq.api.selectedItems[1] == 1 + ): + return "OK: memory_seq_selectTwoItems" + #} + return "ERR: memory_seq_selectTwoItems" +#} +