Thread: Chess Challange

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    2

    Chess Challange

    Hello Everyone!

    a friend told me about this chess riddle. I would like to share it with you (I figured that some of you might like this kind of stuff):

    on a standard 8x8 chessboard, you have to place eight black pons (or 8 any other pieces for a matter of fact).
    you have to place them, on black or white squares, so that they are not in a line.
    ie:: no 2 (or more) pieces can be in a line horizontally
    no 2 (or more) pieces can be in a line vertically
    no 2 (or more) pieces can be in any form of diagonal line


    now I managed to get 7 out of 8 pieces plcaed by using the traditional method (thinking)... I figured -> no problem: I'll just fire up my Visual Studio and I'll write a C program that goes through all the combinations and will be done in a few hours. hmm... easier said then done.

    I would like to propose this mini challange to you guys. Write a C program that goes through all the possible combinations until it finds the right anwser. I'm sure that for most of you this will be a piece of cake, but some might find this challenging or even fun...

    so give it a shot and let me know how you did,

    matt

    PS> i said to write it in C because i assumed that C will be the fastest. you are welcome to write it in any other program

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I would like to propose this mini challange to you guys.
    I would like to propose this mini challenge to you: Do your own homework instead of trying to trick people into doing it for you. This is a common question. Search for "queen's challenge", which is the true name of your homework assignment.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    2

    let's get some things straight....

    1. this is NOT a homework/assignement
    2. i don't care about the solution
    3. i'm interested in the process that leads to finding the solution

    i tried to program this and thought that it is going to be a piece of cake (a few nested forloops and if statements should do this). As i found out, there is alot more logic involved (especially when you made this graphical -> moving pons, checking validity of position, etc).

    writing a FAST program that goes all the combinations (and does it efficiantly) is not so obvious. if you are not up for this mini challange, please don't reply to this post.

  4. #4
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    Okay lets get some things str8

    ::quote::
    i tried to program this and thought that it is going to be a piece of cake
    ::quote::
    then why dont u post some of your code and then we will see of we can help you .....

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >if you are not up for this mini challange, please don't reply to this post.
    Most of us have done the 8 queens problem, possibly several times. Our problem is that you show up with a common homework problem and ask us to post the solution. This seems very much like you want us to do your homework, so if you really are serious you should post your working solution, then you might get a better response.

    >you have to place eight black pons
    I believe you mean "pawns", but this makes no sense since the problem is to set up eight pieces so that none can move without being attacked, but none are actively being threatened. This problem is a breeze with the weak pawn, so queens are used instead.

    Here's another puzzle for you, write a program that calculates the Knight's Tour. This is when a knight traverses the entire chess board touching every square only once.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Chess and Heuristics
    By Happy_Reaper in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 11-14-2006, 01:05 PM
  2. chess program.
    By myk_raniu in forum C++ Programming
    Replies: 2
    Last Post: 12-19-2005, 03:32 PM
  3. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  4. Ultra chess engine contest
    By yodacpp in forum Projects and Job Recruitment
    Replies: 8
    Last Post: 11-21-2004, 07:58 AM
  5. Ultra chess engine
    By yodacpp in forum Game Programming
    Replies: 2
    Last Post: 11-19-2004, 12:33 PM