mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Refactoring
This commit is contained in:
parent
780ac558d5
commit
76ba6f7d2b
1 changed files with 7 additions and 4 deletions
|
@ -743,15 +743,18 @@ class Base_Solver_Hint:
|
|||
def config(self, **kw):
|
||||
self.options.update(kw)
|
||||
|
||||
def card2str1(self, card):
|
||||
def _card2str_format(self, fmt, card):
|
||||
# row and reserves
|
||||
rank = (card.rank-self.base_rank) % 13
|
||||
return "A23456789TJQK"[rank] + "CSHD"[card.suit]
|
||||
return fmt % {'R': "A23456789TJQK"[rank], 'S': "CSHD"[card.suit]}
|
||||
|
||||
def card2str1(self, card):
|
||||
# row and reserves
|
||||
return self._card2str_format('%(R)s%(S)s', card)
|
||||
|
||||
def card2str2(self, card):
|
||||
# foundations
|
||||
rank = (card.rank-self.base_rank) % 13
|
||||
return "CSHD"[card.suit] + "-" + "A23456789TJQK"[rank]
|
||||
return self._card2str_format('%(S)-s%(R)s', card)
|
||||
|
||||
# hard solvable: Freecell #47038300998351211829 (65539 iters)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue