Question: This is part of the code 1. Problem Statement: The primary goal of this programming assignment is to give students experience with two-dimensional arrays in
This is part of the code
1. Problem Statement: The primary goal of this programming assignment is to give students experience with two-dimensional arrays in C++. To do this you will be implementing a simple game called "Keep Away Chess". This game is played on a standard 8x8 chess board. The object is for two players to take turns putting pieces on the chess board so they can not be taken by any other piece. The first person that places a piece on the board that can be taken by another piece loses the game. To start off, your program should ask the user if they want to play the game with rooks (which move horizontally and vertically) or queens (which move horizontally vertically and diagonally). This will determine what chess piece will be used for the whole game. Then your program should take turns prompting player1 and player2 asking them where they want to place their piece. You should check that the row and column they enter is a valid location, and prompt the user to re-enter their location if it is out of bounds. Next, you should check the chess board to see if the player will lose if the piece is placed at that location. Finally, you should place the piece on the chess board, and print the chess board again. For example, here is a portion of a game played with Rooks where player1 places a rook safely, and player2 places a rook in a bad location and loses the game. - Player 1 - Enter row [0.7]: 0 Enter col [0..7]: 0 2 3IRII 5I 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
