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

Fix a bug w the formatting of the foundations.

With the input to freecell solver. Reported by Don - thanks! The format
was wrong.
This commit is contained in:
Shlomi Fish 2018-03-19 12:11:13 +02:00
parent feca7b5658
commit c0bb252166
2 changed files with 27 additions and 1 deletions

View file

@ -755,7 +755,7 @@ class Base_Solver_Hint:
def card2str2(self, card):
# foundations
return self._card2str_format('%(S)-s%(R)s', card)
return self._card2str_format('%(S)s-%(R)s', card)
# hard solvable: Freecell #47038300998351211829 (65539 iters)

26
tests/unit/hint.py Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env python3
# Written by Shlomi Fish, under the MIT Expat License.
# imports
import sys
from TAP.Simple import diag, plan, ok
from pysollib.acard import AbstractCard
from pysollib.hint import Base_Solver_Hint
def shlomif_main(args):
plan(1)
card = AbstractCard(1001, 0, 3, 7, 3001)
h = Base_Solver_Hint(None, None, base_rank=0)
got = h.card2str2(card)
# TEST
if not ok(got == 'D-8', 'card2str2 works'):
diag('got == ' + got)
if __name__ == "__main__":
sys.exit(shlomif_main(sys.argv))