Ever have a challenging pastime to which you applied analytical skills and ended up making it so easy it ceased to be fun? This happens to me occasionally. A couple years back we had a sort of "puzzle craze" in the United Stated over "sudoku", a sort of numeric logic puzzle originating from Japan.
The basic puzzle is a 9x9 box of squares in which some of the squares have been filled in with numbers. Your assignment is to fill in the rest of the squares by following 3 simple rules: (1) each number can appear only once in each row, (2) each number can appear only once in each column, (3) each number can appear only once in each "major square". The major squares are nine 3x3 boxes superimposed over the 9x9 puzzle in a non-overlapping fashion (so the first major square is formed by columns 1, 2, and 3 where they pass through rows 1, 2, and 3, the next at the intersection of columns 4, 5, and 6 with rows 1, 2, and 3, and so on.) Since every row contains 9 squares, and every column contains 9 squares, and every major square contains 9 squares, the only numbers you will ever add to the puzzle are the numbers 1 to 9.
There are larger and more complex variants on the basic sudoku, but the above is the most popular and familiar variety. I did sudokus for awhile but eventually tired of them and moved on to new pastimes.
One reason I tired of them is that a large part of sudoku is simple, repetitive, busy work. You eliminate the possibilities for each square until a solution pops out for one square and then you fill that in and go back and reevaluate the possibilities for the other squares. For example, a given square can be any number between 1 and 9. But if you look at the column that square is in and find 1, 5, and 6 are already used, those are no longer possibilities for that square. If the row that square is in contains 2, 3, and 7, then those possibilities are also eliminated. Further if the major square it is in already contains 4 and 9, then those possibilities are eliminated too, leaving only 8, so in this case the square must be 8.
It's much more interesting when you start getting into the more complicated bits of reasoning that involve multiple squares. Like for instance if a major square is filled in except for two squares, then those two squares have only two possibilities. Let's say the possibilities are 5 and 9. Further assume that these two squares are in the same row (or column). Immediately we can say of all the other squares in that row (or column) that none can be 5 or 9 since those two options have to be used up by those two squares. But getting to that point involves getting through a period of tedious repetition.
But when you are stuck in a cabin in the rain for a day, away from the amenities you typically would enjoy, even a tedious pastime is welcome. However, I've found one thing consistently true among software engineers: they generally hate doing tasks by hand which would be better done by a simple computer program. So I was plonking along with sudoku puzzles, eliminating options by hand when I said "this is stupid, I could make a simple spreadsheet macro to do this for me."
So I built a spreadsheet that would show me the remaining possibilities for each row and column as a row or column header. Then when I was eliminating possibilities for major squares I said "this is stupid, I can use the same macro to do this for me." So I added a bit to my spreadsheet to show me the possibilities remaining for every major square. So now for a given cell I could compare the possibilities for its row, to the possibilities for its column, and the possibilities for its major square and the intersection of those three would represent the possibilities for the cell. (For example, if the cell is in a row with 4,5,6,7 available, and a column with 2,3,5,7,8 available, and a major square with 1,5,7,9 available, the possibilities for that cell are only 5 and 7, because that is the intersection of the three sets of possibilities.)
I suppose you can guess what happened next. "This is stupid, I can write a simple function to take the intersection of these possibilities."
One other basic sudoku-solving technique is to look for "loners". A loner is the only square in a row (or column or major square) that includes a particular number as one of its possibilities. For example if you have four unfilled squares in a major square and their possibilites are (2,3,4), (2,3,5), (3,5), and (2,5) you can say the first one has to be 4. Even though 2 and 3 are possibilities for this square, since it is the only square that can be 4, then it must be 4. Finding loners is also tedious, and you can imagine what I did as a result. "This is stupid, yadda yadda yadda..."
So now I had a spreadsheet that would eliminate all the impossible values for a square based on simple cross checking and which would identify loners for me. But I found as I was entering puzzles that this solved so much of the puzzle automatically, there was very little left for me to do. The spreadsheet would notify me when I caused an error (forced the possibilities for a cell to dwindle to nothing) and in those cases where I needed to make a guess to explore one possible solution, the spreadsheet would allow me to snapshot the puzzle at that point so I could get back to it if the puzzle didn't work out. With these features available puzzles rated "difficult" were taking under 2 minutes to solve. After 5 or 6 of them I shut Excel done and was done with sudoku for the day. Why bother? It was too easy now.
The pastime had become writing the code to perform the tedious operations. Once that was accomplished I was no longer interested in performing those operations. Go figure. ![]()


Search
Recent Comments




