diff options
author | Marianne Chevrot <blackmoor+git@devys.org> | 2020-05-09 23:27:44 +0200 |
---|---|---|
committer | Marianne Chevrot <blackmoor+git@devys.org> | 2020-05-09 23:27:44 +0200 |
commit | 8e4f016a05809f3e09e92fac2f5fae5d5d21aa89 (patch) | |
tree | 867d71a21dab23395353666043cc99322f7c70b3 | |
parent | caf7494e8412336b74ca143dac1356870c39fe13 (diff) | |
download | kana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.tar.gz kana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.tar.bz2 kana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.zip |
Cosmetic and aesthetic
-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... |