I wrote a simple Python program that implements the classic solution, and the classic solution applied row-wise to the 2d version. Some things I've found:
It takes a non-trivial amount of time to run. It took me a few minutes to run 100 random test cases. As I mentioned in a comment, there is no feasible way to fully extend the classic solution to 2d, as ...
What I'm going to describe is a rather gung-ho strategy which, frankly, shoudn't work, but to my surprise hasn't failed a single time in all of 100,000 trials I performed.
It finds the secret pattern after
or fewer trials.
As pattern space is vast this doesn't rule out that there are worst case patterns defeating the strategy.
The heuristics that ...