Problem: The queen on the ACSL chess board is the most versatile piece. It can move at most N cells (where N is determined at the start of each game) in the following directions:
1. Left or Right to the borders of the chess board
2. Up or Down to the borders of the chess board
3. Diagonally to the borders of the chess board
Since the queen can range in so many directions to capture an opponent’s pieces, where can those pieces be safely placed? The ACSL chess board will be a 5x5 grid as labeled and shown above.
Input: There will be five lines of input. Each line will give the location of the queen as an ordered pair in a row, column order and the value of N.
Output: Print the number of locations where a chess piece is safe from capture.
Accepts 1 input line-x,y,N
Create a 5x5 array containing all 1's.
Translates the coordinates onto the array, store a 0 at that location.
Use a few loops to 'draw' lines of 0's where the queen can move.
*Don't forget to watch out for the edges of the board.
After all your lines are done, count the number of 1's left-this is the output forthis configuration
In the main function...
1 2 3
Get the 5 inputs.
Using a loop, or just batch style, call the above function for each input.
Display the function result.