Use list comprehension to generate Syzygy candidate file names (#90)
This commit is contained in:
1 parent
fa1f189cac
commit
cf313e4e57
1 file changed
+5
-5
+5
-5
@@ -179,13 +179,13 @@ def validate_syzygy_exists():
|
|||||||
|
|
||||||
def tablebase_names(K=6):
|
def tablebase_names(K=6):
|
||||||
|
|
||||||
letters = ['', 'Q', 'R', 'B', 'N', 'P']; candidates = []
|
letters = ['', 'Q', 'R', 'B', 'N', 'P']
|
||||||
|
|
||||||
# Generate many potential K[] v K[], including all valid ones
|
# Generate many potential K[] v K[], including all valid ones
|
||||||
for N in range(1, K - 1):
|
candidates = ['K%svK%s' % (''.join(lhs), ''.join(rhs))
|
||||||
for lhs in combinations_with_replacement(letters, N):
|
for N in range(1, K - 1)
|
||||||
for rhs in combinations_with_replacement(letters, K - N - 2):
|
for lhs in combinations_with_replacement(letters, N)
|
||||||
candidates.append('K%svK%s' % (''.join(lhs), ''.join(rhs)))
|
for rhs in combinations_with_replacement(letters, K - N - 2)]
|
||||||
|
|
||||||
# Syzygy does LHS having more pieces first, stronger pieces second
|
# Syzygy does LHS having more pieces first, stronger pieces second
|
||||||
def valid_filename(name):
|
def valid_filename(name):
|
||||||
|
|||||||
Reference in new issue
Block a user