<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Chess program' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Chess program' posted on the 'Beginner C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2010 Programmers Heaven</copyright>
    <pubDate>Mon, 15 Mar 2010 20:43:55 -0700</pubDate>
    <lastBuildDate>Mon, 15 Mar 2010 20:43:55 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Chess program</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/409361/409361/chess-program/</link>
      <description>Hi all,&lt;br /&gt;
&lt;br /&gt;
I'm trying to do a practice from a book I learn from,&lt;br /&gt;
and no success so far.&lt;br /&gt;
&lt;br /&gt;
"This program will be asked to answer whether the black king is threatened – by white Tools (condition called chess), or not threatened. &lt;br /&gt;
Threat to the King is that there is a white tool that can access the square which is the black king &lt;br /&gt;
during one play.&lt;br /&gt;
The program prompts the user to enter three numbers of the row, column, tool, and return on it in a loop &lt;br /&gt;
until final input. Input series ends when one of the values of the column, row or tool exceeds &lt;br /&gt;
Defined boundaries. I.e.: tool less than - 1, greater than - 5 or coordinates tile extends beyond the boundaries &lt;br /&gt;
Board. As in the previous sections, the negative coordinates are considered exception limits the board. &lt;br /&gt;
There is no limit on the amount of different types of white tolls on the board, but the black king appears exactly once. (You may assume that the input does contain black king greater than once), given an input for a slot that already taken, error message will appear: "Already taken!" &lt;br /&gt;
After the input sequence, the program prints "check!" Or "! No check" in accordance with the state board."&lt;br /&gt;
&lt;br /&gt;
I translate it, so sorry for bad english.&lt;br /&gt;
can some help me with an idea? or code?&lt;br /&gt;
&lt;br /&gt;
R.E:&lt;br /&gt;
1- King black. &lt;br /&gt;
2- white queen. &lt;br /&gt;
3 - White Rook.&lt;br /&gt;
4 - white knight. &lt;br /&gt;
5 - white runner.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I'm a beginner so no functios an such:(&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/409361/409361/chess-program/</guid>
      <pubDate>Mon, 16 Nov 2009 03:54:48 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Chess program</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/409361/409365/re-chess-program/#409365</link>
      <description>&lt;span style="color: Blue;"&gt;You need a 2D array representing a chess board. Next, you need functions (yes! functions are easy!) to work with the board: put a piece on the cell or check the state of a cell, using its coordinates: row, column.&lt;br /&gt;
&lt;br /&gt;
For example: if you have a KNIGHT at ROW=4 COLUMN=2, then you need to apply the offsets for KNIGHT jump (and you need to do it 8 times, well you should know the steps for a KNIGHT). The same example - one of KNIGHT steps is shift 2 rows up and 1 column to the right - that means you need to ADD these offsets to the KNIGHT location and check the resulting cell for 1) is that cell OFF the board? and 2) is a WHITE KING there? You need to do same checks for each chess piece according to the laws of the game.&lt;br /&gt;
&lt;br /&gt;
The simple model of the board would be a 2D array:&lt;/span&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;int board [8][8];
int row = 5;
int col = 4;
int cell = board [row][col]; // or is it board[col][row]?.. not sure&lt;/pre&gt;&lt;br /&gt;
&lt;span style="color: Blue;"&gt;Just my opinion: that task is not a beginner task.&lt;/span&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/409361/409365/re-chess-program/#409365</guid>
      <pubDate>Mon, 16 Nov 2009 05:00:31 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Chess program</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/409361/409414/re-chess-program/#409414</link>
      <description>first of all thnks!&lt;br /&gt;
its an assiment that shoud be written without functions/state machine,&lt;br /&gt;
this is the diffcukty for me.&lt;br /&gt;
&lt;br /&gt;
I know the Idea, but don't know how to implement it.&lt;br /&gt;
I wrote 4 loops, on for each tool, that each one of them have in side more loops that chacking varied of directions, but it's dosn't work.&lt;br /&gt;
I will write my program later here..&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/409361/409414/re-chess-program/#409414</guid>
      <pubDate>Tue, 17 Nov 2009 00:01:18 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>