mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-22 03:04:09 -04:00
Deal MS Deals up to 1<<31.
This commit is contained in:
parent
0d444b407d
commit
9cec5cae00
2 changed files with 4 additions and 2 deletions
|
@ -157,10 +157,12 @@ def init():
|
||||||
try:
|
try:
|
||||||
kw = {'shell': True,
|
kw = {'shell': True,
|
||||||
'stdout': subprocess.PIPE,
|
'stdout': subprocess.PIPE,
|
||||||
'stderr': subprocess.PIPE}
|
'stderr': subprocess.PIPE,
|
||||||
|
'stdin': subprocess.PIPE,}
|
||||||
if os.name != 'nt':
|
if os.name != 'nt':
|
||||||
kw['close_fds'] = True
|
kw['close_fds'] = True
|
||||||
p = subprocess.Popen(settings.FCS_COMMAND+' --help', **kw)
|
p = subprocess.Popen(settings.FCS_COMMAND+' --help', **kw)
|
||||||
|
p.stdin.close()
|
||||||
if p.stdout.readline().startswith('fc-solve'):
|
if p.stdout.readline().startswith('fc-solve'):
|
||||||
settings.USE_FREECELL_SOLVER = True
|
settings.USE_FREECELL_SOLVER = True
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
|
|
|
@ -221,7 +221,7 @@ def constructRandom(s):
|
||||||
if not s:
|
if not s:
|
||||||
return None
|
return None
|
||||||
seed = long(s)
|
seed = long(s)
|
||||||
if 0 <= seed <= 32000:
|
if 0 <= seed < (1<<31):
|
||||||
return LCRandom31(seed)
|
return LCRandom31(seed)
|
||||||
return PysolRandom(seed)
|
return PysolRandom(seed)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue