Mar 9, 2019 at 8:49pm UTC
On chess board are 2 queens. I need help to check if they are attacking.
In one line are cords of both queens, cords are separated by space.
Cords of one figure are in this form: row and column. Columns are letters from "a" to "h" and rows are numbers from 1 to 8. Examples: b3, h7, c6.
If there are attacking write "yes", if not write "no".
Can someone help me how to check if they are attacking in diagonal.
Mar 9, 2019 at 8:54pm UTC
Find the number of rows between the queens and the number of columns between the queens. If the values are equal then the queens lie on the same diagonal
Last edited on Mar 9, 2019 at 8:55pm UTC