Geschrieben von:/Posted by: Dann Corbit at 26 June 2004 00:32:43:
Als Antwort auf:/In reply to: Re: More WBEC output examination... {LGPGNVER} geschrieben von:/posted by: Uri Blass at 26 June 2004 00:07:19:
I agree with your suggestions. One minor point later
"I will always get correct data from the user." is an intentional oversight. So (for instance) if you are expecting a FEN position, and you get one megabyte of binary data instead, your program does bad things. The reason I call it an intentional oversight is that it is not reasonable to assume perfect input.
There are also unintentional oversights. For instance, you may assume that no board position has more than 255 distinct moves possible. After all, the maximum ever discovered is 218. But the reasonable assumption may be incorrect. Perhaps there is some strange position with 257 moves possible.
323 moves will be enough for legal chess positions. 9 Q, 2 R, 2 B, 2 N, 1 K
9*27+2*14+2*13+2*8+10 (including 2 castling moves).
castling move are moves of the king and if the king can castle then by definition it have not more than 7 moves so you can replace 10 by 8.
If you are intersted in the maximal number of legal moves of 9 queens then you can try to solve by a program the maximal number of n queens for smaller n by trying all possibilities.
It is clear even without a program that 2 queens cannot contol 54 squares because if both of them are in the middle of the board they even do not get 50 squares together and queen not in the middle of the board can see at most
25 squares.
It means that you can easily replace 27*9 by 27+25*8(I believe that it is easy to prove that you it is not the best but I courld prove easily that you have not more than 305 moves.
I believe that not more than 300 moves is easy to calculate.
We need first table for maximal number of moves that n queens can goto.
1 queen 27 moves
2 queens 52 moves(d5 e3)
3 queens 77 moves(d5 e3 f6)
4 queens probably 100 moves(c4 e3 d6 f5)
1 queen in the centre d5 allow only 2 queens that do not prevent another queen to move in c3,e3,f4,f6 and queen not at the centre 4*4 board can see at most 23 squares so it does not help.
Interesting problem but I have no time to think about it now.
Maybe some mathematician can prove a general theorom about it(Tord?)
These are the 92 solutions to the n-queens problem for an 8x8 board:
1Q6/3Q4/5Q2/7Q/2Q5/Q7/6Q1/4Q3 - -
1Q6/4Q3/6Q1/3Q4/Q7/7Q/5Q2/2Q5 - -
1Q6/4Q3/6Q1/Q7/2Q5/7Q/5Q2/3Q4 - -
1Q6/5Q2/7Q/2Q5/Q7/3Q4/6Q1/4Q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