Reference no: EM13938949
Create table game characters 8x8, where will store THE POSITION OF Figure each time on this chessboard. The creation of the list must be made with commitment memory. In addition create structure (struct move) to be used for the registration movements with the elements:
CHAR OVER, char prevpos[2], char nexpos[2], move *next, move *prev. The program, with the start-up phase, shows the screen menu the following options:
MAIN MENU Thema 1
[N] Start New Game Thema 2
[S] Score Thema 3
[U] Undo Thema 4
[E] End Program
Selection (N, S, U, E):
The program will goes only in the case given valid choice (one of the above mentioned letters), in any other case will again expects to one new selection. After the execution of a selection return in the mainly menu. TERMINATES WHEN given E.
Choice N Starts a new game. Firstly make a double connected list Moves with nodes move, where it will be stored in sequence of moves.Create two stacks black and white, where will be maintained file of pieces of figures that wins every player. The list black (white) corresponds in the player with black (white) pieces and are stored the white (blacks) Figures. Afterwards the game begins and the computer asks the sequence of movements with the way as it is descriped in subjects 3 and 4 at the first work project. You Can use or your own corresponding code or the proposed solutions of first work where shape suitably.
For each valid movement, you supplement suitably the elements of one node move and add in the double connected list, and inform proportionally the table game. If in final square of movement exists rival piece, it is eaten and removed from the dash (game), it is registered in stack the player (white or black) and is added node with nexPos= ` - - `. If piece Figure is the King of opponent, then is not placed in no list and we consider that the player that makes the movement it Wins: is printed suitable message in the screen and the game terminates. If exists his own piece Figure, the movement is cancelled and is required to give a valid move. The process is repeated up to the user types instead of movement the symbol baluster (#), therefore will return in main Menu.
Choice S will evaluate the existing situation and will elect the winner for the case that the game terminates without winner (for example when has been agreed concrete biggest duration game). In order to becomes this, from each stack are removed the Figure pieces, are printed message description in the screen and are registered the points in the corresponding player, according to the values that appear in table 1. The player with most points, is the winner and it is announced in the screen. If there is equal total points, is printed message of draw.
Subject 4: Undo of movements
When is given the choice U in the main Menu, the program asks the player how much movements it wants it reverses. The figure that is given concerns successive movements, independent player, beginning from the last one. For the recantation is used the double connected list, from where a-one movements are described in the screen and are informed suitably the table. Proportionally they become also changes in the two stacks. Obviously, it should it is recognized in who belongs the movement
Image 1
Figures piece
|
White Figures
|
Black Figures
|
Points
|
king
|
k
|
K
|
∞
|
queen
|
q
|
Q
|
9
|
rook
|
r
|
R
|
5
|
bishop
|
b
|
B
|
3
|
knight
|
n
|
N
|
3
|
pawn
|
p
|
P
|
1
|
table 1
How customers perceive various brands
: Discuss the concept of perceived value and its importance to consumer behaviour and marketing. Discuss the theory and then give practical examples of how customers perceive various brands and how this impacts on their behaviour.
|
Calculate the total revenues per distributor category
: Calculate the total revenues per distributor category, and assign the customer costs to each distributor type by using revenues as the allocation base. Selling price for one unit is $125.
|
What divides the parietal from the frontal lobe
: What is the advantage of having a cerebrum that is highly convoluted? What term is used to indicate its grooves? Its outward folds?
|
Unexpired risks in the case of fire insurance in addition
: An additional reserve of 10% of the net premium was made for the unexpired risks in the case of fire insurance in addition to the balance brought forward.
|
Program to create a game named chess
: Create table game characters 8x8, where will store THE POSITION OF Figure each time on this chessboard. The creation of the list must be made with commitment memory. In addition create structure (struct move) to be used for the registration moveme..
|
Evaluate potential new marketing opportunities for a company
: For this assessment one is to identify and evaluate potential new marketing opportunities for a company of the choice. Refer below for details regarding the client.
|
What is the function of the basal nuclei
: What is the function of the basal nuclei? Which basal nuclei form the lentiform nucleus? Which arches over the diencephalon?
|
Determine people attitudes toward poverty
: In this assignment, your objective is to try to determine people's attitudes toward poverty and toward poor people. First, get some background information by reading up on the topic of poverty. There has been quite some amount of academic research c..
|
Differences that impact international business activities
: Examine and interpret the macroeconomic changes and various national differences that impact international business activities K2 Relate key economic concepts, trade, FDI theories, and national non-market issues essential for designing strategy
|