• Welcome to Valhalla Legends Archive.
 

Fun chess problem

Started by nslay, May 25, 2005, 12:10 AM

Previous topic - Next topic

nslay

Given a standard 8x8 chess board, find the positions of 8 queens such that no queen threatens any other.  I have a very systematical (and non bruteforcing) way of solving it, I'll post the solution in a few days.

dxoigmn

Quote from: nslay on May 25, 2005, 12:10 AM
Given a standard 8x8 chess board, find the positions of 8 queens such that no queen threatens any other.  I have a very systematical (and non bruteforcing) way of solving it, I'll post the solution in a few days.

This was a fun relational programming exercise in my programming languages course. We were using Mozart-Oz as the language. Wonder if I can find the code...bah can't access blackboard :(

MyndFyre

I don't know about a systematical way, but I did it intuitively in one shot:

-----------------
|X| | | | | | | |
-----------------
| | | | | | |X| |
-----------------
| | | | |X| | | |
-----------------
| | |X| | | | | |
-----------------
| | | | | | | |X|
-----------------
| | | | | |X| | |
-----------------
| | | |X| | | | |
-----------------
| |X| | | | | | |
-----------------

I'm interested to see what the systematical way is.  Obviously there are other ways to do this -- I *believe* can think of at least 7 other positions that would do this.  *shrug*
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

UserLoser.

How do you play chess?

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

dxoigmn

Quote from: MyndFyre on May 25, 2005, 07:16 PM
Quote from: UserLoser on May 25, 2005, 07:11 PM
How do you play chess?

http://www.google.com/search?hl=en&q=how+to+play+chess

To whom was that question directed?

Probably you. There is a flaw in your logic. Note the two c's conflict.


-----------------
|c| | | | | | | |
-----------------
| | | | | | |X| |
-----------------
| | | | |X| | | |
-----------------
| | |X| | | | | |
-----------------
| | | | | | | |X|
-----------------
| | | | | |c| | |
-----------------
| | | |X| | | | |
-----------------
| |X| | | | | | |
-----------------


nslay

#6
Quote from: dxoigmn on May 25, 2005, 09:35 PM
Quote from: MyndFyre on May 25, 2005, 07:16 PM
Quote from: UserLoser on May 25, 2005, 07:11 PM
How do you play chess?

http://www.google.com/search?hl=en&q=how+to+play+chess

To whom was that question directed?

Probably you. There is a flaw in your logic. Note the two c's conflict.


-----------------
|c| | | | | | | |
-----------------
| | | | | | |X| |
-----------------
| | | | |X| | | |
-----------------
| | |X| | | | | |
-----------------
| | | | | | | |X|
-----------------
| | | | | |c| | |
-----------------
| | | |X| | | | |
-----------------
| |X| | | | | | |
-----------------



Alright, stop drawing chess boards.  To make this efficient, I have found this problem is analogous to finding a sequence of numbers using 12345678 in which no countings may overlap.

Consider
24683571

Notice if I count from 1
I get 654321
which overlaps at 6 despite 8357 in between
this means if you position a queen in the last column in the 1st row, it will conflict with a queen in 3rd column positioned in the 6th row.

12345678
draws a perfectly diagonal line of queens.
Basically, the columns are the index of the digits, the digits themselves are the rows of placement.

So this should be easier to write numerically than drawing strange figures of chess boards with the ascii characters.  It is also easy to verify if you don't have a chess board.

MyndFyre

Quote from: dxoigmn on May 25, 2005, 09:35 PM
Probably you. There is a flaw in your logic. Note the two c's conflict.
Oooh good eye.  I need to go home and look at an actual board.  Doing this in Notepad doesn't work.  ;)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

dxoigmn

#8
Quote from: MyndFyre on May 25, 2005, 10:01 PM
Quote from: dxoigmn on May 25, 2005, 09:35 PM
Probably you. There is a flaw in your logic. Note the two c's conflict.
Oooh good eye.  I need to go home and look at an actual board.  Doing this in Notepad doesn't work.  ;)

Pen and paper seem to work fine for me. Alternatively, you could write a program :P

nslay

Quote from: dxoigmn on May 25, 2005, 10:02 PM
Quote from: MyndFyre on May 25, 2005, 10:01 PM
Quote from: dxoigmn on May 25, 2005, 09:35 PM
Probably you. There is a flaw in your logic. Note the two c's conflict.
Oooh good eye.  I need to go home and look at an actual board.  Doing this in Notepad doesn't work.  ;)

Pen and paper seem to work fine for me. Alternatively, you could write a program :P

Or you could numerically analyze it :P  It might be easier :D

UserLoser.

No really, how do you play.  I never played it in my life (and don't want to learn so google link no bueno), just saying that I don't know how because sometimes I am random like that

Blaze

Basicly you have two rows of pieces. The people in the front are called Pawns. Then you have several different pieces in the back row:
Quote
Pawn   Pawn    Pawn    Pawn   Pawn  Pawn  Pawn  Pawn
Rook   Knight   Bishop  Queen  King  Bishop  Knight  Rook

Pawns can move forward 1 space or 2 on its first move. The Pawn can only attack diagonally 1 space.

The Rook looks like a tower. It can move straight left or right as many spaces as it can without hitting any other pieces.

The Knight can move in an L shape. Example: forward 2, left 1. backwards 2, right 1. Left two, left one. Right two, left one.
The knight can also jump over pieces.

The Bishop can move diagonally.

The Queen can move in any direction. This is one of the most useful pieces.

The king is the most important piece. It can move in any direction 1 space. If the king is in a position that it can be attacked, its called Check. The player who owns the king must either move the king so it isn't in attack range of any opponents pieces, kill the attacking piece, or move something infront of it. If it cannot it is called Checkmate and the attacking player has won.

The board is a grid of black and white squares. The queen show be on the same colour square of what she is.  If your black, the queen should also be on black square, and the king on the white. The board is a grid of 8x8.

Here is an example of a set up board.

Quote
Rook  Knight   Bishop   King   Queen  Bishop Knight  Rook
Pawn  Pawn   Pawn      Pawn  Pawn   Pawn  Pawn  Pawn





Pawn   Pawn    Pawn    Pawn   Pawn  Pawn  Pawn  Pawn
Rook   Knight   Bishop  Queen  King  Bishop  Knight  Rook

Well, I think that is the basics of the game, if you are still interested go buy a book on the game, they can give you some good pointers and good strategy's to help you on your chess carrear.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Soul Taker

I think you screwed up your knight examples.

shout

Left two, left one. That would be convenient in some cases.

Blaze

Quote
[ ] [X] [ ]
[ ] [ ]  [ ]
[X][ ]  [ ]
You could from from X to X
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No