Skip to content
Sign upLog in
← Back to Community

Python: Queen move

Profile icon
pole55

Chess queen moves horizontally, vertically or diagonally in any number of squares. Given two different squares of the chessboard, determine whether a queen can go from the first square to the second one in a single move.

The program receives four numbers from 1 to 8 each specifying the column and the row number, first two - for the first square, and the last two - for the second square. The program should output YES if a queen can go from the first square to the second one in a single move or NO otherwise.

Voters
Profile icon
Noor-ElhudaIssa
Profile icon
CYT56
Profile icon
KadenKozina
Profile icon
TdeD
Profile icon
SamPardoe
Profile icon
2D27Sunny2D27
Profile icon
JorJor1230
Profile icon
ArthurLaw
Profile icon
pole55
Comments
hotnewtop
Profile icon
leoNguyen19

chess

Profile icon
MATTHEWBECHTEL

Cool, but what’s this used for?

Profile icon
LilKid7129