Boolean38. The coordinates of two different chessboard fields x1, y1, x2, y2 (integers, lying in the range 1-8) are given. Verify the truth of the statement: "The bishop can go from one field to another in one move".

Solution in Python 3:

import random

x1,y1,x2,y2 = [random.randrange(1, 9) for i in range(0,4)]
#x1,y1,x2,y2 = [2,2,2,1]

c = (x1 == x2) or (y1 == y2)

print("The 1st field:")
print("x1: ", x1)
print("y1: ", y1)
print()
print("The 2nd field:")
print("x2: ", x2)
print("y2: ", y2)
print()

print("Bishop can move in one turn \
from one field to another: ",(c))