Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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

1468_chess.png

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91609826
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in C/C++

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As