Question: -------------------------------------all informations are here -------------- --------------------------C PROGRAMMING LANGUAGE------------------------------ In this project, you have to write a program for players to play chess. Chess board and


-------------------------------------all informations are here --------------
--------------------------C PROGRAMMING LANGUAGE------------------------------
In this project, you have to write a program for players to play chess. Chess board and pieces must be defined as follows. Chess Board: 8 BR BK BB BQ BG BB BK BR 7 BP BP BP BP BP BP BP BP 6 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 WP WP WP WP WP WP WP WP 1 WR WR WK WB WQ WG WB WK A B C D E F G H First character: W: White B: Black Second character: P: The Pawn B: The Bishop K: The Knight R: The Rook Q: The Queen G: The King You must create 6 different functions that represent feasible movements of a given piece!, a capturing function, and a print function to print chess board after each update in the given format. You must ask the user to choose a piece at first, then you must give the feasible options of where the selected piece can move. If the user selects an infeasible square, you must ask the user again until any feasible square is selected. After selecting any feasible square, you must print if any capturing is occurred and remove the corresponding piece. You must print the current board and switch to the other player. I strongly recommend you to think with a pen and paper on the algorithm before you start writing. If you spend more time on your algorithm, I believe it will be easier than it looks but I suggest you start as soon as possible. Your prints must look like the following example: Dont't forget all the pieces except the knight may not jump over other pieces. 21f the square where a piece ends its move contains an opponent's piece, the opponent's piece is captured", and it is removed from play. Chess Board (1-0) Chess Board (-0): 8 BR BK BB BQ BG BB BK BR BR BK BQ RG BR BK BR 7 BP BP BP BP BP BP BP BP 7 BP BP BP BP BP BP BP BP 6 0 0 0 O 0 0 0 6 0 0 0 0 0 0 0 S o 0 D 0 0 D 0 0 5 0 0 D 0 o 4 0 0 0 0 0 0 0 0 4 0 0 0 WP 0 0 0 0 3 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 2 WP WP WP 0 WP WP WP WP 1 WP WP WP WP WP WP WK WAWQ WG WB WK WR A B C D E F G H WR 1 WR WK WB WQ WG WB WK WR A B C D E F G H Player 2 (B): Select a piece Player 1 (W): Select a piece D2 (Should be given by user) Press 1:0 2:04 2 (should be given by user) H7 (Should be given by user) Press THS 2: H6: 2 (should be given by user) Figure 1: Time-o White Figure 2: Time-0 Black Chess Board (1-1) Chess Board (t-1): 8 BR BK BB BQ BG BB BK BR S BR BK BB BQ BG BB BK BR 17 BP BP BP BP BP BP BP 0 7 BP BP BP BP BP BP BP WB 6 0 0 0 0 0 0 BP 6 0 0 0 0 0 0 0 0 0 0 0 S 0 0 0 0 0 0 0 0 WP 0 0 0 4 0 0 0 WP 0 O 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 WP WP WP O WP WP WP WP 2 WP WP WP 0 WP WP WP WP 1 1 WK WR WR WK WB WQ WG WB WK WR A B C D E F G H WR WK 0 WQ WO WB A B C D E F G H Player 1 (W): Select a piece: Ci (Should be given by user) Press 1: D2 2: E3 3:74 4:05 5:46: 6 (should be given by user) Player 2 (B): Select a piece AS (Should be given by user) Incorrect selection, select a piece: BS (Should be given by user) Press 1: A6 2: C6: 2 (Should be given by user) Elimination: CI WB => HOBP Figure 3: Time-1 White Figure 4: Time-1 Black In this project, you have to write a program for players to play chess. Chess board and pieces must be defined as follows. Chess Board: 8 BR BK BB BQ BG BB BK BR 7 BP BP BP BP BP BP BP BP 6 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 WP WP WP WP WP WP WP WP 1 WR WR WK WB WQ WG WB WK A B C D E F G H First character: W: White B: Black Second character: P: The Pawn B: The Bishop K: The Knight R: The Rook Q: The Queen G: The King You must create 6 different functions that represent feasible movements of a given piece!, a capturing function, and a print function to print chess board after each update in the given format. You must ask the user to choose a piece at first, then you must give the feasible options of where the selected piece can move. If the user selects an infeasible square, you must ask the user again until any feasible square is selected. After selecting any feasible square, you must print if any capturing is occurred and remove the corresponding piece. You must print the current board and switch to the other player. I strongly recommend you to think with a pen and paper on the algorithm before you start writing. If you spend more time on your algorithm, I believe it will be easier than it looks but I suggest you start as soon as possible. Your prints must look like the following example: Dont't forget all the pieces except the knight may not jump over other pieces. 21f the square where a piece ends its move contains an opponent's piece, the opponent's piece is captured", and it is removed from play. Chess Board (1-0) Chess Board (-0): 8 BR BK BB BQ BG BB BK BR BR BK BQ RG BR BK BR 7 BP BP BP BP BP BP BP BP 7 BP BP BP BP BP BP BP BP 6 0 0 0 O 0 0 0 6 0 0 0 0 0 0 0 S o 0 D 0 0 D 0 0 5 0 0 D 0 o 4 0 0 0 0 0 0 0 0 4 0 0 0 WP 0 0 0 0 3 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 2 WP WP WP 0 WP WP WP WP 1 WP WP WP WP WP WP WK WAWQ WG WB WK WR A B C D E F G H WR 1 WR WK WB WQ WG WB WK WR A B C D E F G H Player 2 (B): Select a piece Player 1 (W): Select a piece D2 (Should be given by user) Press 1:0 2:04 2 (should be given by user) H7 (Should be given by user) Press THS 2: H6: 2 (should be given by user) Figure 1: Time-o White Figure 2: Time-0 Black Chess Board (1-1) Chess Board (t-1): 8 BR BK BB BQ BG BB BK BR S BR BK BB BQ BG BB BK BR 17 BP BP BP BP BP BP BP 0 7 BP BP BP BP BP BP BP WB 6 0 0 0 0 0 0 BP 6 0 0 0 0 0 0 0 0 0 0 0 S 0 0 0 0 0 0 0 0 WP 0 0 0 4 0 0 0 WP 0 O 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 WP WP WP O WP WP WP WP 2 WP WP WP 0 WP WP WP WP 1 1 WK WR WR WK WB WQ WG WB WK WR A B C D E F G H WR WK 0 WQ WO WB A B C D E F G H Player 1 (W): Select a piece: Ci (Should be given by user) Press 1: D2 2: E3 3:74 4:05 5:46: 6 (should be given by user) Player 2 (B): Select a piece AS (Should be given by user) Incorrect selection, select a piece: BS (Should be given by user) Press 1: A6 2: C6: 2 (Should be given by user) Elimination: CI WB => HOBP Figure 3: Time-1 White Figure 4: Time-1 Black
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
