In my program, the user can build buildings on specific coordinates on a 5x5 map. Once a building has been placed, the user can no longer build on that coordinate. I want to print these coordinates as red when they're used up. How can I achieve this? Is there a subroutine I can write and call to make it easier?
The map is based on a 2D list that looks like this:
# x=0 x=1 x=2 x=3 x=4
map = [["a1", "a2", "a3", "a4", "a5"], # y = 0
["b1", "b2", "b3", "b4", "b5"], # y = 1
["c1", "c2", "c3", "c4", "c5"], # y = 2
["d1", "d2", "d3", "d4", "d5"], # y = 3
["e1", "e2", "e3", "e4", "e5"]] # y = 4
When the user builds on a coordinate, it's appended to a list called "constructed" so that it can't be done a second time.
The map is printed here, this is where I want to color values that are also in "constructed":
print("Select a coordinate to build on.")
print()
print(map[0])
print(map[1])
print(map[2])
print(map[3])
print(map[4])