• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

The Crowded Chessboard

 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are given a chessboard together with 8 queens, 8 rooks, 14 bishops, and 21 knights. The puzzle is to arrange the 51 pieces on the chessboard so that no queen shall attack another queen, no rook attack another rook, no bishop attack another bishop, and no knight attack another knight. No notice is to be taken of the intervention of pieces of another type from that under consideration - that is, two queens will be considered to attack one another although there may be, say, a rook, a bishop, and a knight between them.
1 - Queen, 2 - Bishop, 3 - Knight, 4 - Rook
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a long time a tough puzzle.. will definately give a try.. hope there a is a solution for this
 
Karthikeyan Rajendraprasad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm got the result atlast

 
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Karthikeyan Rajendraprasad:
hmm got the result atlast



How many Kings could be added to the puzzle and still have it solvable? Given this solution, I could easily add 7 King that can't attack each other. Is there a solution that allows 8, 9, or even 10 Kings to be added?
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean Knights? Given this solution there are zero knights that can be added. Each empty square can be attacked by at least one knight. If those were kings it wouldn't be a solution because nearly all of them can attack another king.

Karthikeyan -
Awesome job solving this puzzle - I always wound up one piece shy. Either rook or knight as I was playing around with which one of these to try to place last.
 
Ryan McGuire
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tim LeMaster:
You mean Knights? Given this solution there are zero knights that can be added. Each empty square can be attacked by at least one knight. If those were kings it wouldn't be a solution because nearly all of them can attack another king.

Karthikeyan -
Awesome job solving this puzzle - I always wound up one piece shy. Either rook or knight as I was playing around with which one of these to try to place last.



No, I'm fairly certain I mean Kings.

Starting with Karthikeyan's solution, I can place seven kings that can't atack each other:


(...where a kIng is represented by an 'I'.)

So there's seven kings. Every space that STILL empty is threatened by at least one of the seven kings, so we can't get another king on there without rearranging other pieces. Is it possible to rearrange the other 51 pieces so that you could fit on more kings that don't attack other kings?
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see I didn't realize you were adding a new piece to the puzzle.
 
Karthikeyan Rajendraprasad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wrote a program that ran for hourssss to get this solution..

im tweaking it a little bit to get the required solution in a lesser time.

adding the king logic to it should not be a great deal.

lets see whether we can fill the remaining board with the kings.
 
Ryan McGuire
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Karthikeyan Rajendraprasad:
wrote a program that ran for hourssss to get this solution..

lets see whether we can fill the remaining board with the kings.



I assume your program uses a brute-force method -- is that right?

What is your outer-most loop? A loop through each of the pieces, trying to find a good place to put it? ...or a loop through each space on the board, looking for a good piece to put there?

Either way would work, but I wonder which would go faster.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic