[comp.sources.wanted] Wanted "Eight Queen Problem" in C, Modula2, Lisp or Prolog !!

hpatel@hawk.ulowell.edu (WHY AM I HERE ???) (10/16/90)

Hello Friends,

      I need this problem called "Eight Queen Problem" very badly.
The problem is about the chess game. (8 by 8 board) The queen should be placed
the way that no queen will kill any other queen.

      If you have this problem written in C, C++, Modula2, Lisp or Prolog, 
Please mail me. 

      Thank you very much.



						-Himanshu Patel
                                                hpatel@hawk.ulowell.edu

P.S.   If you know where can I get it in Massachusetts, Please let me know.

tar@math.ksu.edu (Tim Ramsey) (10/16/90)

hpatel@hawk.ulowell.edu (WHY AM I HERE ???) writes:

>Hello Friends,

>      I need this problem called "Eight Queen Problem" very badly.
>The problem is about the chess game. (8 by 8 board) The queen should be
>placed the way that no queen will kill any other queen.

>      If you have this problem written in C, C++, Modula2, Lisp or Prolog, 
>Please mail me. 

>      Thank you very much.

Ah, I remember this homework assignment.  Does your instructor read
comp.sources.wanted?

--
Tim Ramsey (tar@hilbert.math.ksu.edu)   (913) 532-6750 (voice) 2-7004 (FAX)
Department of Mathematics, Kansas State University, Manhattan KS 66506

John.Passaniti@f201.n260.z1.FIDONET.ORG (John Passaniti) (10/18/90)

 > From: hpatel@hawk.ulowell.edu (WHY AM I HERE ???)

 >       I need this problem called "Eight Queen Problem"
 > very badly. The problem is about the chess game. (8 by 8 board)
 > The queen should be placed the way that no queen will kill any
 > other queen.
 >
 >       If you have this problem written in C, C++,
 > Modula2, Lisp or Prolog, Please mail me.

     Hmmm-- not in Pascal, eh?  No doubt because N. Wirth 
published a Pascal version of the problem in "Data + 
Algorithms = Programs" (or whatever the exact title is-- I 
forget).  I'm sure it's in your library, and I'm sure you'll 
be able to convert it to whatever language you want.

     Sounds like a homework assignment to me.


--  
*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*
John Passaniti - via FidoNet node 1:260/230
UUCP: ...!rochester!ur-valhalla!rochgte!201!John.Passaniti
INTERNET: John.Passaniti@f201.n260.z1.FIDONET.ORG
*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*%*

laird@chinet.chi.il.us (Laird J. Heal) (10/18/90)

In article <1990Oct16.125350.3405@maverick.ksu.ksu.edu> tar@math.ksu.edu (Tim Ramsey) writes:
>hpatel@hawk.ulowell.edu (WHY AM I HERE ???) writes:
 
>>Hello Friends,
 
>>      I need this problem called "Eight Queen Problem" very badly.
>>The problem is about the chess game. (8 by 8 board) The queen should be
>>placed the way that no queen will kill any other queen.
 
>>      If you have this problem written in C, C++, Modula2, Lisp or Prolog, 
>>Please mail me. 
 
>>      Thank you very much.
 
>Ah, I remember this homework assignment.  Does your instructor read
>comp.sources.wanted?
 
Sir, you jump to conclusions:  besides, that program is published, although
not too widely.  Still, it would be more entertaining to solve it directly
rather than wait for the net to cough it up.  Eight ranks, eight files, put
the queens on one rank each and use eight nested loops for file placement, 
measuring on the diagonals to determine if any can see the other.  If one is
clever he can replace the eight nested loops with a recursive algorithm to
test all combinations without ever testing to see if there were more than
one queen on a file, instead switching positions in sequence.
 
>Tim Ramsey (tar@hilbert.math.ksu.edu)   (913) 532-6750 (voice) 2-7004 (FAX)
>Department of Mathematics, Kansas State University, Manhattan KS 66506
 
It brings to mind a problem an Algol class had once, to take twelve (12) balls
eleven (11) of which had the same weight and figure out which ball was different
and by how much with only three weighings and with only three Algol statements.
I was not taking that class, but I later solved the problem and wrote it up as a
student's choice in a Fortran class.  The three Algol statements came from the
need to have an input, an output, and a very long nested if, hardly what one
should teach his students today.  The Fortran three-way if statement was well-
suited to that particular problem.

-- 
My .signature is on vacation ------------- like me!

mcastle@mcs213f.cs.umr.edu (Mike Castle) (10/19/90)

for a more interesting variation, try n-queens.  That was a problem our
local programming team pratice had (not member, just know 'em)
Much more interesting.  for extra-credit, check for mirrored images, etc
so you get total comibinations (there are multiple solutions as i
understand) instead of permutations.