Stuck? Need help? Ask questions on our forums.

Beginner C/C++

Moderators: Lundin
Number of threads: 4841
Number of posts: 15800

This Forum Only
Post New Thread

Report
Chess program Posted by powerranger on 16 Nov 2009 at 3:46 AM
Hi all,

I'm trying to do a practice from a book I learn from,
and no success so far.

"This program will be asked to answer whether the black king is threatened – by white Tools (condition called chess), or not threatened.
Threat to the King is that there is a white tool that can access the square which is the black king
during one play.
The program prompts the user to enter three numbers of the row, column, tool, and return on it in a loop
until final input. Input series ends when one of the values of the column, row or tool exceeds
Defined boundaries. I.e.: tool less than - 1, greater than - 5 or coordinates tile extends beyond the boundaries
Board. As in the previous sections, the negative coordinates are considered exception limits the board.
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!"
After the input sequence, the program prints "check!" Or "! No check" in accordance with the state board."

I translate it, so sorry for bad english.
can some help me with an idea? or code?

I'm a beginner so no functios an such:(




 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.