How to do the following in lisp
the goal is obtain tab2 from tab1
0 = no mines
1 = mines
tab 1 tab2
11111321 00001000
21213321 01000110
22312231 01000100
12223220 00100000
12423121 00010100
11434322 01010010
12342332 00101001
01222212 00010010
Thanks to help me how to code that in lisp
help will be appreciate
Cheers
Ladislau Dantas wrote:
> Thanks to help me how to code that in lisp
> help will be appreciate
You might start by looking at the patterns in the numbers.
faa
"Ladislau Dantas" <·····@wanadoo.fr> writes:
> How to do the following in lisp
>
> the goal is obtain tab2 from tab1
> 0 = no mines
> 1 = mines
>
> tab 1 tab2
> 11111321 00001000
> 21213321 01000110
> 22312231 01000100
> 12223220 00100000
> 12423121 00010100
> 11434322 01010010
> 12342332 00101001
> 01222212 00010010
>
> Thanks to help me how to code that in lisp
> help will be appreciate
Play the game a couple of hours, then as they used to say at IBM, THINK!
--
__Pascal_Bourguignon__
http://www.informatimago.com/
Pascal Bourguignon <····@thalassa.informatimago.com> wrote in message news:<··············@thalassa.informatimago.com>...
> Play the game a couple of hours, then as they used to say at IBM, THINK!
So what do they say at IBM now? :)
Kaz Kylheku wrote:
> Pascal Bourguignon <····@thalassa.informatimago.com> wrote in message
> news:<··············@thalassa.informatimago.com>...
>> Play the game a couple of hours, then as they used to say at IBM, THINK!
>
> So what do they say at IBM now? :)
Build a model boat and sail it around...
faa
···@ashi.footprints.net (Kaz Kylheku) writes:
> Pascal Bourguignon <····@thalassa.informatimago.com> wrote in message news:<··············@thalassa.informatimago.com>...
> > Play the game a couple of hours, then as they used to say at IBM, THINK!
>
> So what do they say at IBM now? :)
Well, I don't know if they kept the posters they had in the 1940's
with these five letters...
http://images.google.es/imgres?imgurl=ed-thelen.org/comp-hist/samp-IBM-think-sign.jpg&imgrefurl=http://ed-thelen.org/comp-hist/samp-collection.html&h=316&w=326&prev=/images%3Fq%3Dthink%2Bibm%26svnum%3D10%26hl%3Des%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26sa%3DG
But then, they still seem to have it in a way:
http://images.google.es/imgres?imgurl=www.ibm.com/ch/think/archiv/12002/images/think_titelbild.gif&imgrefurl=http://www.ibm.com/ch/think/archiv/12002/&h=212&w=150&prev=/images%3Fq%3Dthink%2Bibm%26svnum%3D10%26hl%3Des%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26sa%3DG
--
__Pascal_Bourguignon__
http://www.informatimago.com/
···@ashi.footprints.net (Kaz Kylheku) writes:
> Pascal Bourguignon <····@thalassa.informatimago.com> wrote in message news:<··············@thalassa.informatimago.com>...
>> Play the game a couple of hours, then as they used to say at IBM, THINK!
>
> So what do they say at IBM now? :)
Today, they say
"on demand" !
Thinking is out of fashion these days.
Frank
"Ladislau Dantas" <·····@wanadoo.fr> wrote in message news:<············@news-reader5.wanadoo.fr>...
> How to do the following in lisp
Please describe the algorithm, and show your best attempt to translate
that to working Lisp.
Note that the comp.lang.lisp newsgroup is not a homework cheating
service.
On 8552 day of my life Ladislau Dantas wrote:
> How to do the following in lisp
>
> the goal is obtain tab2 from tab1
> 0 = no mines
> 1 = mines
>
> tab 1 tab2
> 11111321 00001000
> 21213321 01000110
> 22312231 01000100
> 12223220 00100000
> 12423121 00010100
> 11434322 01010010
> 12342332 00101001
> 01222212 00010010
>
> Thanks to help me how to code that in lisp
> help will be appreciate
I will not solve homework, but I will share ideas. I think, you have
to solve linear algebraic system.
Having mine field of (N+1)*(M+1) cells, let x_{i,j} -- number of mines
in the cell (i,j) (where 0<=i<= N+1 and 0<=j<=M+1), and c_{i,j} --
number of mines around cell (i,j). x_{i,j} may be 0 or 1 (tab 2) and
c_{i,j} may be from 0 to 8 (tab 1).
For cell which doesn't touch border (1<=i<=N and 1<=j<=M) we have:
x_{i+1,j}+x_{i+1,j+1}+x_{i+1,j+1}+x_{i,j+1}
+x_{i-1,j}+x_{i-1,j-1}+x_{i-1,j-1}+x_{i,j-1} = c_{i,j}.
Writing equation for cell at border is left as exercise to reader :)
You can solve system with Gauss method, for example (there are other
more effective methods, but Gauss is enough for you). If any of
x_{i,j} is not 0 or 1, than tab 1 is wrong.
Whit Lisp, you can find exact solution with rational arithmetics.
Or use Fortran with numeric libraries :)
Anyway, there is no any Artificial Intelligence :)
Artificial Intelligence is to obtain tab 2 from this tab:
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
:)
P.S. Sorry my terrible English, my native language is Lisp! :)
--
Ivan Boldyrev
Assembly of a Japanese bicycle requires greatest peace of spirit.
Ivan Boldyrev <···············@cgitftp.uiggm.nsc.ru> writes:
> I will not solve homework, but I will share ideas. I think, you have
> to solve linear algebraic system.
>
> Having mine field of (N+1)*(M+1) cells, let x_{i,j} -- number of mines
> in the cell (i,j) (where 0<=i<= N+1 and 0<=j<=M+1), and c_{i,j} --
> number of mines around cell (i,j). x_{i,j} may be 0 or 1 (tab 2) and
> c_{i,j} may be from 0 to 8 (tab 1).
>
> For cell which doesn't touch border (1<=i<=N and 1<=j<=M) we have:
>
> x_{i+1,j}+x_{i+1,j+1}+x_{i+1,j+1}+x_{i,j+1}
> +x_{i-1,j}+x_{i-1,j-1}+x_{i-1,j-1}+x_{i,j-1} = c_{i,j}.
>
> Writing equation for cell at border is left as exercise to reader :)
>
> You can solve system with Gauss method, for example (there are other
> more effective methods, but Gauss is enough for you). If any of
> x_{i,j} is not 0 or 1, than tab 1 is wrong.
That's possible, but that sounds quite complex. I would do it with
some deductive rules and I think that it would be less hungry
cycle-wise.
What's more, I doubt you're way would be effective in case of partial
information. Here he's given an array full of data, but when you play
the game you only have partial information. For example, knowing that
n[1,2]=1 or that n[1,3]=2 (indexing from top-left) would be impossible
because that would mean you've stepped on a mine.
--
__Pascal_Bourguignon__
http://www.informatimago.com/
"Ladislau Dantas" <·····@wanadoo.fr> wrote in message news:<············@news-reader5.wanadoo.fr>...
> How to do the following in lisp
>
> the goal is obtain tab2 from tab1
> 0 = no mines
> 1 = mines
>
> tab 1 tab2
> 11111321 00001000
> 21213321 01000110
> 22312231 01000100
> 12223220 00100000
> 12423121 00010100
> 11434322 01010010
> 12342332 00101001
> 01222212 00010010
>
> Thanks to help me how to code that in lisp
> help will be appreciate
>
> Cheers
I assume that when you say "HELP me how to code that in lisp" you
mean, "Don't code it for me, but please give me some hints."
Why do people get so indignant and self-righteous about not answering
homework questions on this newsgroup. Cripes!
This is off the top of my head but it seems like you can look for
patterns
in tab1 that would imply something about tab2. For example look at the
pattern
in the top left of tab 1:
1 1 1
x 1 x
It seems that that "T" shaped pattern of 1's in tab1 implies that the
top
left corner of tab2 must be:
0 0 0
0 1 0
because if there were any other ones in the top left block of tab 2
then
you wouldn't see the T pattern of 1's in tab1.
By the way if you really did mean "Please write the lisp code for me."
Well then send me $50 through paypal and I'll give it shot, though I
don't guarantee results or grades.
"larry" <··········@hotmail.com> wrote in message
································@posting.google.com...
> "Ladislau Dantas" <·····@wanadoo.fr> wrote in message
news:<············@news-reader5.wanadoo.fr>...
> I assume that when you say "HELP me how to code that in lisp" you
> mean, "Don't code it for me, but please give me some hints."
I like to assume this too, but given nothing more than the problem copied
straight from the assignment, with no evidence whatsoever of any thought or
attempted solution, it is not unreasonable to conclude it is more likely an
effort to cheat than to learn.
> Why do people get so indignant and self-righteous about not answering
> homework questions on this newsgroup. Cripes!
Some people do not appreciate cheaters.
> By the way if you really did mean "Please write the lisp code for me."
> Well then send me $50 through paypal and I'll give it shot, though I
> don't guarantee results or grades.
others, I guess, hope to profit from them. Sheesh!
--
Coby Beck
(remove #\Space "coby 101 @ big pond . com")
From: Thomas A. Russ
Subject: Re: need help for writing minesweeper algo in lisp
Date:
Message-ID: <ymismktv2yf.fsf@sevak.isi.edu>
"Coby Beck" <·····@mercury.bc.ca> writes:
> "larry" <··········@hotmail.com> wrote in message
> ································@posting.google.com...
> > "Ladislau Dantas" <·····@wanadoo.fr> wrote in message
> news:<············@news-reader5.wanadoo.fr>...
> > I assume that when you say "HELP me how to code that in lisp" you
> > mean, "Don't code it for me, but please give me some hints."
>
> I like to assume this too, but given nothing more than the problem copied
> straight from the assignment, with no evidence whatsoever of any thought or
> attempted solution, it is not unreasonable to conclude it is more likely an
> effort to cheat than to learn.
In marked contrast, for example, to the gentleman from Georgia Tech, who
also asked for aid in understanding and improving his implementation --
while scrupulously observing his institution's academic honesty policy.
--
Thomas A. Russ, USC/Information Sciences Institute