D
Daun Jaun
statArr=[]
for i in 0...3
statArr=[]
for j in 0...3
statArr[j]=[]
for k in 0...2
statArr[j][k]=0
end
end
end
p statArr
statArr[0][2][1]+=3
statArr[1][0][0]+=2
statArr[2][2][1]+=1
p statArr
statArr=Array.new(3,Array.new(3,Array.new(2,0)))
p statArr
statArr[0][2][1]+=3
statArr[1][0][0]+=2
statArr[2][2][1]+=1
p statArr
what is going on in the above code why is there the discrepancy in the output
is it a bug or paraller processing feature
please figure it out and explain
for i in 0...3
statArr=[]
for j in 0...3
statArr[j]=[]
for k in 0...2
statArr[j][k]=0
end
end
end
p statArr
statArr[0][2][1]+=3
statArr[1][0][0]+=2
statArr[2][2][1]+=1
p statArr
statArr=Array.new(3,Array.new(3,Array.new(2,0)))
p statArr
statArr[0][2][1]+=3
statArr[1][0][0]+=2
statArr[2][2][1]+=1
p statArr
what is going on in the above code why is there the discrepancy in the output
is it a bug or paraller processing feature
please figure it out and explain