Python-Checkers icon indicating copy to clipboard operation
Python-Checkers copied to clipboard

Recursion leads to remainders

Open Amir-Sk opened this issue 5 years ago • 5 comments

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 avatar Sep 23 '20 14:09 Amir-Sk

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

Amir-Sk avatar Sep 24 '20 08:09 Amir-Sk

@Amir-Sk did you find the solution?

chinmay021 avatar Oct 09 '20 16:10 chinmay021

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

Amir-Sk avatar Oct 12 '20 13:10 Amir-Sk

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

chinmay021 avatar Oct 12 '20 13:10 chinmay021

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

Qazalbash avatar Jul 07 '21 11:07 Qazalbash