Hacker News new | ask | show | jobs
by plg94 792 days ago
I was given [1,2] in the second run. Even easier to see it's impossible.
1 comments

Yeah the generation is very simple, 2-4 random numbers between 1 and 9 inclusive. Definitely gives impossible puzzles sometimes (because I don't know a general algorithm for generating possible ones only).
If you only have numbers up to 9 an exhaustive search shouldn't be too bad (should be ~9! states if you memoize), you could implement a solver in Javascript and see whether a solution can be found before you give it to the user.