Finished minesweeper after looking at doubleclick.
Was able to optimize for when it is impossible.