muodov / kociemba

A pure Python and pure C ports of Kociemba's algorithm for solving Rubik's cube
GNU General Public License v2.0
566 stars 126 forks source link

Program crashes on Windows when cache exists #29

Closed Wh0DKnee closed 6 years ago

Wh0DKnee commented 6 years ago

I changed some stuff, similar to the pull request, to get the C-code working on Windows. The first execution runs fine, the prune tables are calculated and the folder is created, a correct solution is displayed. However, if I run the program a second time, it crashes. I also tried it with the code from the pull request, same thing. I believe it has to do with folder permissions (the mkdir() call on windows doesn't set them), but I'm not sure. I tried changing the folder permissions via the CreateDirectory method instead, but without success. I can just let them program recalculate the tables on every execution, but that's rather annoying.

jarheadjoe commented 6 years ago

@Wh0DKnee Hi! You should change the way to read/write files

horizonzzz commented 6 years ago

@Wh0DKnee @jarheadjoe @muodov oh. That is exactly what I am facing now. Is this problem solved? I copy the files in cprunetables and paste them into cache. It works, but it often works with the wrong solution.

Wh0DKnee commented 6 years ago

@horizonzzz Hey, I ended up using a different solver program written in C++. If C++ works for you as well, check out http://rubiksolve.com/help.php on the bottom of the page there's a link to the source code.

horizonzzz commented 6 years ago

@Wh0DKnee thank you. I try to debug it, but the C++ version is too old. Can you share your code? My email is herenzhie@gmail.com

muodov commented 6 years ago

@Wh0DKnee @jarheadjoe @horizonzzz I've just got the windows environment ready, and will try to address the Windows compatibility. As far as I understand, the main problem is the file manipulation and variable declaration syntax. Did you guys come across any other problems?

horizonzzz commented 6 years ago

@muodov Thank you. I think it is the file manipulation that has some problem. I changed some declaration syntax as the pull requests said and it works. But as Wh0DKnee said, it failed the second time. I think if we can change the storage methods.

muodov commented 6 years ago

Fixed by https://github.com/muodov/kociemba/pull/31