Hello everyone I am high school student and I need everyone's help. So
I have to do a program in C++, I must place 9 queens in chess table
without matching one with another. I already placed eight queens but
nine is imposible, can somebone please help me... 5 5287
* de******@yahoo.com: Hello everyone I am high school student and I need everyone's help. So I have to do a program in C++, I must place 9 queens in chess table without matching one with another. I already placed eight queens but nine is imposible, can somebone please help me...
9 queens is impossible under ordinary rules of chess, since at least one
row must then contain at least 2 queens.
This is, however, OFFTOPIC in [comp.lang.c++].
Followups therefore set to [comp.programming], and please post to
appropriate forums.

A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Topposting.
Q: What is the most annoying thing on usenet and in email? de******@yahoo.com wrote: Hello everyone I am high school student and I need everyone's help. So I have to do a program in C++, I must place 9 queens in chess table without matching one with another. I already placed eight queens but nine is imposible, can somebone please help me...
Nine is impossible, even in C++.
Think aout it, a chess board is 8x8, so with nine queens at least two
queen must be on the same row. Therefore they attack each other,
therefore nine queens is impossible.
john
In article <CW******************@newsfe4win.ntli.net>,
John Harrison <jo*************@hotmail.com> wrote: de******@yahoo.com wrote: Hello everyone I am high school student and I need everyone's help. So I have to do a program in C++, I must place 9 queens in chess table without matching one with another. I already placed eight queens but nine is imposible, can somebone please help me...
Nine is impossible, even in C++.
Think aout it, a chess board is 8x8, so with nine queens at least two queen must be on the same row. Therefore they attack each other, therefore nine queens is impossible.
john
Actually, a better answer is "You haven't given us enough information". A
more interesting problem is placing N queens on an NxN board with no two
queens attacking each other. It's trivial to prove, for example, that this
is impossible for N=2. Maybe he was talking about solving this, more
complex, problem for N=9?
Roy Smith wrote: In article <CW******************@newsfe4win.ntli.net>, John Harrison <jo*************@hotmail.com> wrote:
de******@yahoo.com wrote:
Hello everyone I am high school student and I need everyone's help. So I have to do a program in C++, I must place 9 queens in chess table without matching one with another. I already placed eight queens but nine is imposible, can somebone please help me...
Nine is impossible, even in C++.
Think aout it, a chess board is 8x8, so with nine queens at least two queen must be on the same row. Therefore they attack each other, therefore nine queens is impossible.
john
Actually, a better answer is "You haven't given us enough information". A more interesting problem is placing N queens on an NxN board with no two queens attacking each other. It's trivial to prove, for example, that this is impossible for N=2. Maybe he was talking about solving this, more complex, problem for N=9?
Maybe, its quite advanced programming for high school, so I'm not sure
what is really going on.
In any case if he has solved it for eight, then solving it for nine is easy.
OP, post your solution for eight and explain why you can't do the same
for nine.
john
"John Harrison" <jo*************@hotmail.com> wrote in message
news:41****************@newsfe6win.ntli.net... Roy Smith wrote: In article <CW******************@newsfe4win.ntli.net>, John Harrison <jo*************@hotmail.com> wrote:
de******@yahoo.com wrote:
Hello everyone I am high school student and I need everyone's help. So I have to do a program in C++, I must place 9 queens in chess table without matching one with another. I already placed eight queens but nine is imposible, can somebone please help me...
Nine is impossible, even in C++.
Think aout it, a chess board is 8x8, so with nine queens at least two queen must be on the same row. Therefore they attack each other, therefore nine queens is impossible.
john
Actually, a better answer is "You haven't given us enough information". A more interesting problem is placing N queens on an NxN board with no two queens attacking each other. It's trivial to prove, for example, that this is impossible for N=2. Maybe he was talking about solving this, more complex, problem for N=9?
Maybe, its quite advanced programming for high school, so I'm not sure what is really going on.
In any case if he has solved it for eight, then solving it for nine is easy.
OP, post your solution for eight and explain why you can't do the same for nine.
I take it you don't play chess? A queen in chess can attack across a row, a
column or diagonally. So for his problem he can not have 2 queens in the
same row, column or diagonal. This can be done with 8 queens on an 8x8
chessboard, but is impossible for 9 queens on an 8x8 chessboard because 2
queens must be on the same row (or column. It's both actually) This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by William C. White 
last post: by

2 posts
views
Thread by Albert Ahtenberg 
last post: by

3 posts
views
Thread by James 
last post: by

reply
views
Thread by Ollivier Robert 
last post: by

1 post
views
Thread by Richard Galli 
last post: by

4 posts
views
Thread by Albert Ahtenberg 
last post: by

1 post
views
Thread by inderjit S Gabrie 
last post: by

2 posts
views
Thread by Jack 
last post: by

3 posts
views
Thread by Sandwick 
last post: by
          