From rusin@washington.math.niu.edu Mon Jan  9 11:51:40 CST 1995
Article: 15613 of sci.math
Path: mp.cs.niu.edu!rusin
From: rusin@washington.math.niu.edu (Dave Rusin)
Newsgroups: sci.math
Subject: Re: Minesweeper is driving me nuts.
Date: 7 Jan 1995 17:47:43 GMT
Organization: Northern Illinois University, Math
Lines: 51
Message-ID: <3emk3v$ir7@mp.cs.niu.edu>
References: <3edq9b$in3@news.doit.wisc.edu> <3elan2$8vg@mp.cs.niu.edu>
NNTP-Posting-Host: washington.math.niu.edu

In article <3elan2$8vg@mp.cs.niu.edu>,
Dave Rusin <rusin@washington.math.niu.edu> wrote:

...nothing useful. (Mailreading from home makes me more prone to screw-ups).
Here's what I intended to say:

Whenever a new game enters the house, Daddy seems to disappear for a few
days until he has analyzed it, run computer simulations, and so on.
One time I taught the computer to play a solitaire game -- that is, I
didn't play solitaire on the computer, I had the computer doing it. [It was
a card game called 10-20-30 and I was interested in studying strategies.]
Minesweeper was no exception last year. Claiming to be doing it 'for the
kids' I wrote a simulation which would run on our old non-Windows machine.
Along the way I tried to teach it how I solved the problem. An
undocumented feature of the program allowed me to hit 'X' to automatically
do the thinking I do methodically.

Each time you make a move, you're solving a set of linear equations: one
equation for each number revealed on the board, with one variable for each
uncovered cell representing the number of bombs hidden there (0 or 1).
What we do when playing is solve this system (partially) in a fast way.
I wrote the computer program to carry out the tricks I knew.

The program I posted will give you an indication of why I'm not a professional
programmer. It's written in -- don't laugh now -- Turbo Pascal III.

After I posted it (of course) I kept rummaging around and found a version
produced a few days later, which has the  eXpert  option working correctly.
It automatically handles situations like this:
     1  1  ?
     ?  ?  ?
and knows that the two cells in the last column are not bombs. Having
already breached netiquette once by posting long code, I won't do it again,
but if anyone wants I can send them the source or PC executable for
this fancier version of my minesweeper solver.

In examining the newer version I see it still fails to solve certain sets
of equations; I think it's the ones which would require combining three or more
at a time; for example, in
   0   1   ?
   1   2   ?
   ?   ?   ?
you know the last cell is safe. I don't intend to pursue this project since
the eXpert mode I have already works splendidly  in many cases.

Also, I have not addressed the question of how best to select the next
square to uncover when you must make a guess.

dave (always on the lookout for games amenable to mathematical analysis)
(Anyone got Chutes and Ladders?)



