Мария обнови решението на 24.10.2022 18:04 (преди около 2 години)
+def calculate_final_vector(starting_point, color_list):
+ x = starting_point[0]
+ y = starting_point[1]
+ for color in color_list:
+ color = color.upper()
+ match color:
+ # light green
+ case 'C0FFC0':
+ x -= 1
+ # dark green
+ case '00C000':
+ x += 1
+ # light yellow
+ case 'FFFFC0':
+ y -= 1
+ # dark yellow
+ case 'C0C000':
+ y += 1
+ # light red
+ case 'FFC0C0':
+ x += 1
+ # dark red
+ case 'C00000':
+ x -= 1
+ # light blue
+ case 'C0C0FF':
+ y += 1
+ # dark blue
+ case '0000C0':
+ y -= 1
+ # black
+ case '000000':
+ print("end game")
+ break
+
+ result = (x, y)
+ return result