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