From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e08c98d7ce85399 X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: Eight Queens problem (was Re: Kindness) Date: 1999/09/06 Message-ID: #1/1 X-Deja-AN: 521812486 References: <37CC6844.AB898EEE@rational.com> <37CE93CD.799A225A@pwfl.com> <37CF0FE0.2B299477@acenet.com.au> <37CFF7DC.CFF9717C@pwfl.com> <1999Sep3.125818.1@eisner> <37D02CC0.BEF1BC69@mitre.org> Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 1999-09-06T00:00:00+00:00 List-Id: Daryle Walker wrote in message ... >In article <37D02CC0.BEF1BC69@mitre.org>, "Robert I. Eachus" > wrote: > > >What is this Eight Queens Problem? I've heard of it only in passing; I >never had to do it as an assignment (BTW, I've been out of school for 2 >years). I'm guessing it's how to place eight queen chess pieces on a >chess board without any of them threatening another. Where can I find >more information about it? What is Nico Lomuto's Ada-task solution? > >[For those who haven't heard of chess, a chess board has a grid of 64 >squares in a 8-by-8 square. A queen piece can attack any enemy piece that >can be directly intercepted via a row, column, or 45-degree diagonal.] > >[Just from a minimal description, I can guess a solution: > 1. Put a queen on a random square > 2. Mark the queen's square, squares on the same row and column, > and squares diagonally connected, invalid > 3. Repeat the previous steps for the next 7 queens > (using valid squares only, of course) > I got the feeling that there's some gotchas to this newbie approach, > like all good CS problems have.] Eight Queens Problem and was discussed and illustrated in "Programming in Modula-2" written by Niklaus Wirth. There were several editions of this book. Third edition was published by Springer-Verlag in 1985. This book may be useful not only for those using Modula-2 but also for those learning Ada. Regards.