From 4ee830ae2f93cfd3ce01381d55624acadeb75ce7 Mon Sep 17 00:00:00 2001 From: skomoroh Date: Tue, 5 Jun 2012 18:44:08 +0000 Subject: [PATCH] Display final statistics in solver git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@279 efabe8c0-fbe8-4139-b769-b5e6d273206e --- pysollib/hint.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pysollib/hint.py b/pysollib/hint.py index 57c7632a..ba53daac 100644 --- a/pysollib/hint.py +++ b/pysollib/hint.py @@ -26,6 +26,7 @@ import os import time import subprocess +import re # PySol imports from settings import DEBUG, FCS_COMMAND @@ -888,9 +889,16 @@ class FreeCellSolver_Hint: for s in pout: if DEBUG: print s, - # TODO: - # Total number of states checked is 6. - # This scan generated 6 states. + m = re.match('Total number of states checked is (\d+)\.', s) + if m: + iter = int(m.group(1)) + self.dialog.setText(iter=iter) + + m = re.match('This scan generated (\d+) states\.', s) + + if m: + states = int(m.group(1)) + self.dialog.setText(states=states) if not s.startswith('Move'): continue