Python. I cannot figure out why changing one array is affecting another
Go to solution
Solved by Deopwr,
2 minutes ago, aconncep said:It also looks like the variable k is not being used inside the diffuse() method. Are you meaning to assign that instead of 0?
the variable was used in some other code that was not relevant to the question also i managed to fix the problem by using this:
import copy gridN = [[copy.copy(cell_obj) for cell_obj in line] for line in grid]
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now