TOPIC

Python Runtime error

Hélio Júlio Massaaki Yamachi asked 1 year ago

I cant find the error

String = None
x1 = None
x2 = None
y1 = None
y2 = None
movimentos = None

while String != "0 0 0 0":
    String = list(raw_input())
    x1 = int(String[0])
    y1 = int(String[2])
    x2 = int(String[4])
    y2 = int(String[6])

    if x1 == x2 and y1 == y2:
        movimentos = 0
    elif x1 == x2 or y1 == y2:
        movimentos = 1

    elif x1 + y2 == x2 + y1:
        movimentos = 1
    else:
        movimentos = 2
    if x1 < 1 or x2 < 1 or y1 < 1 or y2 < 1 or x1 > 8 or x2 > 8 or y1 > 8 or y2 > 8:
        movimentos = None
    else:
        print (str(movimentos) + str('\n'))

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.