1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

sanity check

This commit is contained in:
Shlomi Fish 2017-12-27 15:24:08 +02:00
parent ed4f1ae516
commit 788965a55a

View file

@ -869,8 +869,11 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
continue continue
m = re.match(r'^(?:FC:|Freecells:)\s*(.*)', line) m = re.match(r'^(?:FC:|Freecells:)\s*(.*)', line)
if m: if m:
g = re.findall( RE = r'(' + CARD_RE + r'|\-)'
r'\b(' + CARD_RE + r'|\-)\b', m.group(1)) s = m.group(1)
assert re.match(r'^\s*(?:' + RE + r')?(?:\s+'
+ RE + r')*\s*$', s)
g = re.findall(r'\b' + RE + r'\b', s)
while len(g) < len(game.reserves): while len(g) < len(game.reserves):
g.append('-') g.append('-')
for i, gm in enumerate(g): for i, gm in enumerate(g):