I am creating a chinese checkers AI project, and I created the checkers using a for loop. What I want to ask is, is it possible to assign a variable to each checker I created with create_image
with the for loop?
I use this code:
black = []
black = PhotoImage(file="black.gif")
black_sub = black.subsample(8, 8)
for i in range(4):
black_id.append(i)
canvas.create_image(425 + 24 * i,800 - 10 - 45 * i, anchor=S,
image=black_sub)
for i in range(4):
black_id.append(i+4)
canvas.create_image(425 - 24 * i,800 - 10 - 45 * i, anchor=S,
image=black_sub)
Can I possibly assign each list number to it's corresponding checker?