Re: gnomines possible improvement
- From: spdepagn ncsu edu
- To: games-list gnome org
- Subject: Re: gnomines possible improvement
- Date: Sun, 13 Mar 2005 08:50:29 -0500 (EST)
>
> As far as desirability goes, I don't know if removing the guessing is a
> good thing. I think a bit of the fun comes from the fact that Minesweeper
> is NP-Complete. In short, it can be really hard to determine if a square
> is safe to click or if you just need to guess. To illustrate this, just
> use the solver from games-list December 2004 and run it on 'hard'. While
> most results will be returned in a second or two, others take 30 seconds,
> a minute... One of them took 11 minutes on my laptop.
>
Do you have this solver? I think it would be possible to have a fast
solving method if binary logic gates are used. For example, square 10 has
a mine if A OR (B AND C) and square 11 has a mine if B AND C etc.. then
it should be possible to quickly try every possibility for these variables
and find a match (or ambiguous case)
I implemented a very simple setup last night, it seems to make guessing
not needed in most situations, but it may allow the user to guess with
more confidence. If you want me to go into details on how this algorithm
works, just ask. I have made a patch:
http://www4.ncsu.edu/~spdepagn/gnomine_no_guessing_patch.bz2
if you run:
bzcat gnomine_no_guessing_patch.bz2 | patch -Np1
when the patch file is in the top directory of the gnome-games source
tree, it should patch the files and an option is added in the preferences
dialog.
Even if what I have done is not worth including, I would be interested to
hear comments about my code and if I need to do anything differently.
This is the first time I have created a patch and I have limited
experience adding code some someone else's project. So I don't know if I
did it the best way. If anyone has questions, or comments about this, I
would like to discuss it. I am willing to scrap it and start over, it
took me just a few hours. The main function is
minefield.c:gtk_minefield_make_fair.
There are numerous possible ways to implement this option. One way is try
to solve the puzzle using an algorithm that won't guess. Then if the user
truly guessed (from their point of view) and it is possible to solve that
square by making other moves first, the mines can be reorganized to punish
the user for this, and cause them to lose. If there is no way to solve
this square, and the user guessed, then the mines should be rearranged,
and the user would be permitted to guess in this situation.
Another possibility is to keep ahead of the user by enough moves so that
the computer solves and rearranges at each click, so there is never an
ambiguous situation revealed.
Can we vote on the best implementation? How can I join the list? Thanks
for all the replies.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]