aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarianne Chevrot <blackmoor+git@devys.org>2020-05-09 23:27:44 +0200
committerMarianne Chevrot <blackmoor+git@devys.org>2020-05-09 23:27:44 +0200
commit8e4f016a05809f3e09e92fac2f5fae5d5d21aa89 (patch)
tree867d71a21dab23395353666043cc99322f7c70b3
parentcaf7494e8412336b74ca143dac1356870c39fe13 (diff)
downloadkana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.tar.gz
kana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.tar.bz2
kana_quest_solver-8e4f016a05809f3e09e92fac2f5fae5d5d21aa89.zip
Cosmetic and aesthetic
-rwxr-xr-xsolver.py14
-rw-r--r--tests_solver/level_test_type_short.yaml9
2 files changed, 6 insertions, 17 deletions
diff --git a/solver.py b/solver.py
index 9584f74..e435c8a 100755
--- a/solver.py
+++ b/solver.py
@@ -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...