Question: Chess rook moves horizontally or vertically. Given two dierent cells of the chessboard, determine whether a rook can go from the rst cell to the
Chess rook moves horizontally or vertically. Given two dierent cells of the chessboard, determine whether a rook can go from the rst cell to the second in one move. The program receives the input of four numbers from 1 to 8, each specifying the column and row number, rst two - for the rst cell, and then the last two - for the second cell. The program should output "YES" if a rook can go from the rst cell to the second in one move, or "NO" otherwise
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
