Who's for chess?

Discussion in 'C++' started by Paul Franklin, Feb 16, 2004.

  1. Hi,
    I am writing some C++ code, and the problem is analogous to the
    following situation:

    Take a Chess Board of 8x8 (nxn) blocks and I have 8 (n) horses. Like
    in chess, the horses are placed at a distance of 2 and a half blocks
    apart from the preceding horse. For example, Horse B is at a distance
    of 2 and a half blocks from horse A, Horse C is at a distance of 2 and
    a half blocks from horse B and so on. If one of the horses is moved
    to any different block on the board, the other horses should realign
    themselves so that the distances between the horse and the preceding
    horse should always be 2 and a half blocks.

    So, how can I ensure this?

    Thanks!
    Paul.
     
    Paul Franklin, Feb 16, 2004
    #1
    1. Advertising

  2. Paul Franklin wrote:
    > Hi,
    > I am writing some C++ code, and the problem is analogous to the
    > following situation:
    >
    > Take a Chess Board of 8x8 (nxn) blocks and I have 8 (n) horses. Like
    > in chess, the horses are placed at a distance of 2 and a half blocks
    > apart from the preceding horse. For example, Horse B is at a distance
    > of 2 and a half blocks from horse A, Horse C is at a distance of 2 and
    > a half blocks from horse B and so on. If one of the horses is moved
    > to any different block on the board, the other horses should realign
    > themselves so that the distances between the horse and the preceding
    > horse should always be 2 and a half blocks.
    >
    > So, how can I ensure this?
    >
    > Thanks!
    > Paul.


    This is a good discussion issue for news:comp.programming,
    where algorithms are discussed. This isn't a C++ language
    issue, so I am setting the followups.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
    http://www.sgi.com/tech/stl -- Standard Template Library
     
    Thomas Matthews, Feb 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nick
    Replies:
    1
    Views:
    464
    bugbear
    Nov 19, 2004
  2. Tidds

    chess board

    Tidds, Nov 10, 2003, in forum: HTML
    Replies:
    18
    Views:
    8,717
    Greg Griffiths
    Nov 25, 2003
  3. Michael Loggel

    Who succeeded in compiling Crafty Chess source code?

    Michael Loggel, Dec 6, 2003, in forum: C Programming
    Replies:
    4
    Views:
    728
  4. Will McGugan

    New Python chess module

    Will McGugan, Sep 29, 2005, in forum: Python
    Replies:
    5
    Views:
    425
    Dave Hansen
    Sep 30, 2005
  5. Varun Hiremath
    Replies:
    1
    Views:
    492
    Will McGugan
    Sep 18, 2006
Loading...

Share This Page