Михаил Капелько 5 months ago
parent
commit
14a9c0334e
4 changed files with 10 additions and 9 deletions
  1. +2
    -2
      v5/gui_aux.py
  2. +5
    -5
      v5/gui_aux_test.py
  3. +1
    -0
      v5/gui_test.py
  4. +2
    -2
      v5/main-gui.py

+ 2
- 2
v5/gui_aux.py View File

@@ -1,11 +1,11 @@
from memory_Context import *

# Generate positions in cell dimensions
# Generate grid positions in cell dimensions
#
# Conditions:
# 1. 2x2 grid
# 2. 4x4 grid
def gui_aux_cellPositions(
def gui_aux_cellGridPositions(
size: int
) -> [[int]]:
if (


+ 5
- 5
v5/gui_aux_test.py View File

@@ -1,15 +1,15 @@
from gui_aux import *

def test_gui_aux_cellPositions(
def test_gui_aux_cellGridPositions(
) -> str:
items2x2 = gui_aux_cellPositions(2)
items4x4 = gui_aux_cellPositions(4)
items2x2 = gui_aux_cellGridPositions(2)
items4x4 = gui_aux_cellGridPositions(4)

if (
len(items2x2) == 4 and
len(items4x4) == 16
):
return "OK: gui_aux_cellPositions"
return "OK: gui_aux_cellGridPositions"
#}
return "ERR: gui_aux_cellPositions"
return "ERR: gui_aux_cellGridPositions"
#}

+ 1
- 0
v5/gui_test.py View File

@@ -32,6 +32,7 @@ def test_gui_generateTilePositions(

c.cellSize = 10
c.playfieldSize = 2
c.cellPositions = gui_aux_cellGridPositions(c.playfieldSize)
c.windowHeight = 200
c.windowWidth = 200
c.recentField = "windowWidth"


+ 2
- 2
v5/main-gui.py View File

@@ -52,7 +52,7 @@ print(cli_test_reportMatchedItems())
print(cli_test_reportMismatchedItems())
print(cli_test_reportVictory())

print(test_gui_aux_cellPositions())
print(test_gui_aux_cellGridPositions())
print(test_gui_generateTextureDescriptions())
print(test_gui_generateTilePositions())

@@ -102,7 +102,7 @@ ctrl.registerCallback(process)
ctrl.set("didLaunch", True)
ctrl.set("playfieldSize", 2)

ctrl.set("cellPositions", gui_aux_cellPositions(2))
ctrl.set("cellPositions", gui_aux_cellGridPositions(2))
ctrl.set("cellSize", 25)
ctrl.set("deselectMismatchedTilesDelay", 500)
ctrl.set("hideMatchingTilesDelay", 500)


Loading…
Cancel
Save