Hi everyone. I have a custom code in my experiment and this is the code:
LIST2=[standard,standard,devient]
count1=0
count2=0
count3=0
maxRes = 10
seqs = 30
def findDev(l):
return l.index(devient)
def check(maxRes,l):
global count1,count2,count3
shuffle(l)
d = findDev(l)
if(d == 0):
if(count1 < maxRes):
count1 += 1
return l
else:
return check(maxRes,l)
elif(d == 1):
if(count2 < maxRes):
count2 += 1
return l
else:
return check(maxRes,l)
else:
if(count3 < maxRes):
count3 += 1
return l
else:
return check(maxRes,l)
for i in range(0,seqs):
check(maxRes,LIST2)
But I get the error /* Syntax Error: Fix Python code */ when it want to compile it to javascript. and it seems the global is the problem. What should I do to make it translate this piece of code to js?