program works a little

The program finnaly can solve simple puzzles, but it needs more
sofisticated algorithms to solve harder puzzles