techwithtim / Python-Checkers

95 stars 74 forks source link

Recursion leads to remainders #4

Open Amir-Sk opened 4 years ago

Amir-Sk commented 4 years ago

When trying to skip 3 pieces, you are losing some skipped pieces on your way, because of no concatenation of previous skipped pieces of previous recursion iteration.

Suggested fix (I can create a pull request and fix the issue if you grant me the access), e.g from traverse left: moves.update(self._traverse_left(r+step, row, step, color, left-1,skipped=skipped+last))

Example for a problematic board state: image

Amir-Sk commented 4 years ago

The issue has some more marks on the logic, hence suggested fix is partial. still investigating.

chinmay021 commented 4 years ago

@Amir-Sk did you find the solution?

Amir-Sk commented 4 years ago

Didn't get the time to work on it. Have you tried moving on with my suggested fix and encountered the next issue?

chinmay021 commented 4 years ago

I tried but it didn't work..faced the same issue

Qazalbash commented 3 years ago

it is also not showing all possible paths only for this position image