Thread: Chess horse

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by muted View Post
    If anyone can write a program that will be a display on the screen would be very grateful
    Code:
    void dump( char b[] )
    {
        size_t row,col;
        for( row = 0; row < 8; row++ )
            for( col = 0; col < 8; col++ )
            {
                putchar( b[ (row * 8) + col ] );
                if( col == 7 )
                    putchar( '\n' );
            }
    }
    That looks about right.


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

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,664
    Is it like the 8 queens problem, only applied to knights?
    Eight queens puzzle - Wikipedia, the free encyclopedia

    Or maybe it's the knight's tour?
    Knight's tour - Wikipedia, the free encyclopedia
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #18
    Registered User
    Join Date
    Dec 2010
    Posts
    10
    do you know how to make my map correctly. ?

  4. #19
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by muted View Post
    do you know how to make my map correctly. ?
    I just showed you how. How wide is a chess board? 8 spaces. You have one long array, so every eight spaces, print a newline to the screen, before continuing to draw the contents of the board from your array.


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

  5. #20
    Registered User
    Join Date
    Dec 2010
    Posts
    10
    Quote Originally Posted by Salem View Post
    Is it like the 8 queens problem, only applied to knights?
    Eight queens puzzle - Wikipedia, the free encyclopedia

    Or maybe it's the knight's tour?
    Knight's tour - Wikipedia, the free encyclopedia
    No problem with the queens that they arrange so that they do not beat each other! and knight tour is also not suitable

    is to tasks on the chess board to withdraw the minimum number of knights so that every cell in the field was under attack knight

  6. #21
    Registered User
    Join Date
    Dec 2010
    Posts
    10
    Quote Originally Posted by Salem View Post
    Is it like the 8 queens problem, only applied to knights?
    Eight queens puzzle - Wikipedia, the free encyclopedia

    Or maybe it's the knight's tour?
    Knight's tour - Wikipedia, the free encyclopedia
    Quote Originally Posted by quzah View Post
    I just showed you how. How wide is a chess board? 8 spaces. You have one long array, so every eight spaces, print a newline to the screen, before continuing to draw the contents of the board from your array.


    Quzah.
    you can write code, I did not quite understand you

  7. #22
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by muted View Post
    you can write code, I did not quite understand you
    What part don't you understand? I put it into words and into code. See that pair of loops up at the top of the page?


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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL Chess Game problem
    By Lesshardtofind in forum Game Programming
    Replies: 0
    Last Post: 07-02-2010, 04:49 PM
  2. Chess problem Horse
    By Cyberman86 in forum C Programming
    Replies: 18
    Last Post: 05-03-2009, 02:20 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