2
I’m having this mistake when I run the code.
If I define pos=(algum numero qualquer)
code runs normally ,but if I use this error function.
'int' Object is not iterable in line 20 at first.
Where am I missing? in the Deposit function I’m sending y.sub=matrix of zeros.
import numpy as np
import random
def Deposito(x):
for i in range(16):
pos=randint(0,15)
D=(pos+1)%16;
E=(pos+15)%16;
h=0
while h<30:
if (x[h,D]==1 and x[h,pos]==0):
x[h,pos]=1
break
elif (x[h,E]==1 and x[h,pos]==0):
x=[h,pos]=1
break
elif (x[h,pos]==1):
x[h-1,pos]=1
break
h=h+1
if h==29:
x[h,pos]=1
class Amostra:
substrato=np.zeros((30,16))
sub=substrato
y=Amostra()
Thank you very much . Total lack of attention even .
– Vitor Bento
Now the error message makes sense until.
– Vitor Bento