
I'll try to improve it myself, and then I'll show you what I got

The script is not polished; it was just cloned from Python in a hurry. You probably have a memory handling issue, as it crashes on large puzzles. I've encountered this before with similar scripts.
