Михаил Капелько 7 months ago
parent
commit
b273079e01
3 changed files with 53 additions and 1 deletions
  1. +3
    -0
      v3/main.py
  2. +0
    -1
      v3/memory_api_test.py
  3. +50
    -0
      v3/memory_seq_test.py

+ 3
- 0
v3/main.py View File

@@ -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())

+ 0
- 1
v3/memory_api_test.py View File

@@ -1,6 +1,5 @@
from memory_api import *
from memory_api_Context import *
from llm import *

def memory_api_test_deselectMismatchedItems(
) -> str:


+ 50
- 0
v3/memory_seq_test.py View File

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


Loading…
Cancel
Save