I am currently trying to replace elements in a 2D list with elements in another list, so as to implement a game I am making in python. Here is what I have so far:
listA = [1, 3, 5]
listB = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for a in range(len(listA)):
alpha = (a/3) #number of rows in listB
beta = (a/3) #number of columns in listB
listB[alpha][beta] = 123
When I do this, I get
[[123, 123, 123], [0, 0, 0], [0, 0, 0]]
instead of what I want given the parameters,
[[0, 123, 0], [123, 0, 123], [0, 0, 0]]
Am I doing something wrong?
(a/3)to be? It'll never be anything else but 0..