Лиляна обнови решението на 25.10.2022 01:53 (преди около 2 години)
+def calculate_final_vector(coordinates, listColours):
+ if len(coordinates) <= 1 or len(coordinates) > 2:
+ print("Not enough values to unpack")
+ return ()
+
+ x, y = coordinates
+ for move in listColours:
+ checker = move.upper()
+ if checker == 'C0FFC0':
+ x -= 1
+ elif checker == '00C000':
+ x += 1
+ elif checker == 'FFFFC0':
+ y -= 1
+ elif checker == 'C0C000':
+ y += 1
+ elif checker == 'FFC0C0':
+ x += 1
+ elif checker == 'C00000':
+ x -= 1
+ elif checker == 'C0C0FF':
+ y += 1
+ elif checker == '0000C0':
+ y -= 1
+ elif checker == '000000':
+ break
+ else:
+ continue
+
+ result = (x, y)
+ return result