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" +#} +