diff options
-rwxr-xr-x | solver.py | 14 | ||||
-rw-r--r-- | tests_solver/level_test_type_short.yaml | 9 |
2 files changed, 6 insertions, 17 deletions
@@ -257,10 +257,10 @@ def repr_grid(grid, grid_size): 'froz': ('\x1b[36m[', ']\x1b[0m'), 'rock': (' \x1b[1;40m', '\x1b[0m '), 'myst': ('\x1b[33m?', '?\x1b[0m'), - 'ar_u': ('\x1b[30m∧\x1b[0m', '\x1b[30m∧\x1b[0m'), - 'ar_r': ('\x1b[30m>\x1b[0m', '\x1b[30m>\x1b[0m'), - 'ar_d': ('\x1b[30m∨\x1b[0m', '\x1b[30m∨\x1b[0m'), - 'ar_l': ('\x1b[30m<\x1b[0m', '\x1b[30m<\x1b[0m'), + 'ar_u': ('\x1b[31m∧\x1b[0m', '\x1b[31m∧\x1b[0m'), + 'ar_r': ('\x1b[31m>\x1b[0m', '\x1b[31m>\x1b[0m'), + 'ar_d': ('\x1b[31m∨\x1b[0m', '\x1b[31m∨\x1b[0m'), + 'ar_l': ('\x1b[31m<\x1b[0m', '\x1b[31m<\x1b[0m'), } lines = [] kana_iter = iter(grid) @@ -299,10 +299,8 @@ def generate_possible_grids(kanagrid): for x in range(kanagrid.width): for action_type in ("reveal", "up", "right", "down", "left"): new_grid = kanagrid.action((x, y), action_type) - #if new_grid and new_grid.grid != kanagrid.grid: - # yield (x, y), action_type, new_grid - if new_grid is not None and new_grid.grid != kanagrid.grid: - yield (x, y), action_type, new_grid # debug test + if new_grid and new_grid.grid != kanagrid.grid: + yield (x, y), action_type, new_grid def generate_all_possible_grids(grid, grids, max_actions): diff --git a/tests_solver/level_test_type_short.yaml b/tests_solver/level_test_type_short.yaml deleted file mode 100644 index 7fa3a9a..0000000 --- a/tests_solver/level_test_type_short.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# kana quest grid level 1.1 -size: [2, 2] -max_actions: 3 -target_score: 3 -grid: [ - [myst, ka ], [ar_d, ne ], - [void, null], [froz, ke ], -] -# The kana 'no' need to be protected else the program convert it into False... |