Пламена обнови решението на 25.10.2022 17:53 (преди около 2 години)
+def calculate_final_vector(vector, colors):
+ x1 = vector[0]
+ y1 = vector[1]
+ for color in colors:
+ color = color.lower()
+ if color == 'c0ffc0':
+ x1 -= 1
+ elif color == '00c000':
+ x1 += 1
+ elif color == 'ffffc0':
+ y1 -= 1
+ elif color == 'c0c000':
+ y1 += 1
+ elif color == 'ffc0c0':
+ x1 += 1
+ elif color == 'c00000':
+ x1 -= 1
+ elif color == 'c0c0ff':
+ y1 += 1
+ elif color == '0000c0':
+ y1 -= 1
+ elif color == '000000':
+ break
+ elif color == 'ffffff':
+ continue
+
+ return x1, y1
+
+
+print(calculate_final_vector((1, 1), ['00C000', 'C0FFC0', 'C00000', 'FFFFFF', 'C0C000']))