Question: C++, no extra classes it can all be located in main. Thanks for your help Chess is a popular board game that pits two persons
Chess is a popular board game that pits two persons against each other. Each player starts the game with a set of 16 pieces, one set is black in color and the other is white Each player's set includes 8 pawns, 2 knights, 2 bishops, 2 rooks, 1 queen, and 1 king The pieces are arranged onto a board that is divided into 8 rows of 8 squares per rovw Each square can have only one piece on it at any given time During the game, players move their pieces on the board according to rules that we do not need to know for this assignment. Sometimes players remove or "take" their opponent's pieces from the board, leaving that player with a weaker set of pieces than before. Different pieces have different values, so a person who knows the values of chess pieces can look at a game in progress and figure out which side has more value in their pieces on the board You are to write a program that both reads chess boards from a text file and also figures out two things: 1) what pieces each side has on the board, and 2) the value of each side's pieces. Game boards are stored as a collection of 64 characters arranged as an 8x8 grid. Each character represents a space on the chessboard. A period character, ', indicates th the space is empty. A space that contains a piece will have a letter character that indicates what piece is there and to which side it belongs. The letters are shown in chart below. Uppercase letters are black pieces and lowercase letters are white pieces at the Piece name: Letter: Value: Pawn Knight Bishop Rook You don't know the name of the file the chessboards are stored in. You must ask the user ask for another file name and try again until the user enters a file name that works. The input file stream functions.close) and.clear) are needed to reset the stream after a file opening has failed. P or Norn 3 Borb 3 Rorr5 een Kin or Kork o There is no need to count the You don't know how many chessboards are in the kings because if a king is lost, the file, but you may assume that they will all be correct chess boards. No bad data will be in the file game is over Some sage advice: Break this program up into pieces or you will almost certainly fail. Do not start coding until you know exactly what you are doing. Implement this program one piece at a time. If you try to program too many things at once (more than one is too many) you will almost certainly make your job harder on yourself. Start early and develop a complete plan. Modularize, modularize, modularize Don't try random changes when debugging
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
