mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
Extract more.
This commit is contained in:
parent
ead021aca0
commit
00ded37a0e
1 changed files with 7 additions and 4 deletions
|
@ -827,7 +827,9 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
|
||||||
RANKS_S = "A23456789TJQK"
|
RANKS_S = "A23456789TJQK"
|
||||||
RANKS0_S = '0' + RANKS_S
|
RANKS0_S = '0' + RANKS_S
|
||||||
RANKS_RE = '[' + RANKS_S + ']'
|
RANKS_RE = '[' + RANKS_S + ']'
|
||||||
CARD_RE = RANKS_RE + '[CSHD]'
|
SUITS_S = "CSHD"
|
||||||
|
SUITS_RE = '[' + SUITS_S + ']'
|
||||||
|
CARD_RE = RANKS_RE + SUITS_RE
|
||||||
|
|
||||||
def cards():
|
def cards():
|
||||||
return game.talon.cards
|
return game.talon.cards
|
||||||
|
@ -843,13 +845,14 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
|
||||||
s_game.moveMove(1, game.talon, target, frames=0)
|
s_game.moveMove(1, game.talon, target, frames=0)
|
||||||
|
|
||||||
def put_str(target, str_):
|
def put_str(target, str_):
|
||||||
put(target, "CSHD".index(str_[1]), RANKS_S.index(str_[0]))
|
put(target, SUITS_S.index(str_[1]), RANKS_S.index(str_[0]))
|
||||||
|
|
||||||
for line_p in fh:
|
for line_p in fh:
|
||||||
line = line_p.rstrip('\r\n')
|
line = line_p.rstrip('\r\n')
|
||||||
m = re.match(r'^(?:Foundations:|Founds?:)\s*(.*)', line)
|
m = re.match(r'^(?:Foundations:|Founds?:)\s*(.*)', line)
|
||||||
if m:
|
if m:
|
||||||
g = re.findall(r'\b([HCDS])-([' + RANKS0_S + r'])\b',
|
g = re.findall(
|
||||||
|
r'\b(' + SUITS_RE + r')-([' + RANKS0_S + r'])\b',
|
||||||
m.group(1))
|
m.group(1))
|
||||||
for gm in g:
|
for gm in g:
|
||||||
for foundat in game.foundations:
|
for foundat in game.foundations:
|
||||||
|
|
Loading…
Add table
Reference in a new issue