Question: I need it in c++. Mostly everything needs to be in functions not main, please use basic c++ syntax. Overview You will create a problem

 I need it in c++. Mostly everything needs to be in

I need it in c++.

Mostly everything needs to be in functions not main, please use basic c++ syntax.

Overview You will create a problem that takes in a board with chess pieces rom file. For this exercise, the board will only contain pawns and rooks. The dimensions ofthe board will b some M N dimensions where both M and N are greater han 1 Given a board, you will mark all pawns that can be attacked by a rook. Recall, a rook can move horizontally or vertically through empty spaces until it reaches an end of the board or another piece. You job is to read in the file, find all the pawns that can be attacked, and print an updated board to the screen. Piece and Board Representations Rooks: R .Pawns: P Empty spaces:" . When you find a pawn that can be attacked, change it from a 'P' to a T Sample file The files will contain the dimensions on the first line of the file then contain a board with a mix of empty spaces, pawns, and rooks. Command-line argument: s>./labe8 sample.txt Contents of sample.tt input file 4 5 P*P Output to terminal Rx Notes .The pawn at position (3,0) cannot be attacked because there is no rook in its row or column . The pawn at position (3,4) cannot be attacked because there is a piece between it and the rook in its column

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!