I can't seem to be able to override a variable in my ruby code.
i have two 2d arrays called tableand updated_table, updated_table inherits the values of table and that works, but then later in the code, changes are made to the values of the updated_table and when i try to set the updated_table back to the same values(state) of table this doesn't work.
why is that? very simple example of what im trying to do.
class SomeClass
table = [[0,20,5,1000,1000], [20,0,10,8,20], [5,10,0,1000,40], [1000,8,1000,0,6], [1000,20,40,6,0]]
updated_table = table
##
then here i have some code that makes changes to the values in the updated_table
##
2.times do
updated_table = table # this dosent work??
## do some more calculations and so on ##
end
end
2.times)