• Nice problem

Question related to mission _X Minesweeper-old


Nice problem. A little analysis of the different solutions.

20 solutions, but none which solved the complete problem. For example, consider this problem:

0000000000 1211111111 M2M11M11M1 1211111111 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000

Let's imagine only the first two rows are given, the rest is unknown to the solver.

A human can easily reason that position 2,2 must be a mine due to the clues in 1,0 and 1,1. Similarly, a human can reason that position 2,7 can not be a mine due to the clues in 1,8 and 1,9.

No published solution could make either reasoning. The honourably mention is clearly for AndriusMk who used probability-based guessing and with that was able to fill almost all of the whole diagram (Unfortunately, it made an error when only two fields were remaining).

Of the others, two made guesses; eight did not return anything or gave an error; and the other nine returned some fixed position.

Of the 20 solutions, 10 had the size of the map hardcoded. The other 10 where dynamic. An honourable mention goes to papernode who also checked for a height of zero before determining the width. (similar to: width = len(open_map[0]) if height > 0 else 0).

So I guess the bonus prize goes to the first solution which is able to solve the above problem! :)