Skip to content

Commit

Permalink
Use for-loops in setup_pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Apr 17, 2015
1 parent 56bb201 commit c90932a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions chess/syzygy.py
Expand Up @@ -498,14 +498,10 @@ def setup_pairs(self, data_ptr, tb_size, size_idx, wdl):

d.base = [0 for _ in range(h)]
d.base[h - 1] = 0
i = h - 2
while i >= 0:
for i in range(h - 2, -1, -1):
d.base[i] = (d.base[i + 1] + self.read_ushort(d.offset + i * 2) - self.read_ushort(d.offset + i * 2 + 2)) // 2
i -= 1
i = 0
while i < h:
for i in range(h):
d.base[i] <<= 64 - (min_len + i)
i += 1

d.offset -= 2 * d.min_len

Expand Down

0 comments on commit c90932a

Please sign in to comment.