|
|
I'm struggling to get this to work.
For ease of explanation, let's say I entered 3 into EntryText and my
groupsize:=2
The 'Randomlist' generates a list of random numbers determined by the
parameters of EntryText which works fine. So I get [2, 1, 3] as my answer.
The 'ResponseList' generates 3 lists of random numbers. So I get as my answer:
[[[2, 1, 3],[2, 1, 3]],[[2, 1, 3]]]
I was hoping my answer would be for the group of 3 to be broken down into 2
separate groups (of say 1,3 and 2).
My full code is this:
randomlist:=""
ResponseList:=""
TempString:=LowerCase(EntryText)
groupsize:=2 -- set value as appropriate
randomlist:= []
repeat with i:=1 to Number(TempString)
AddLinear(randomlist,i,Random(1,i,1))
end repeat
ResponseList:=[]
repeat with i:=1 to Number(TempString)
if MOD(i-1,groupsize)=0 then AddLinear(ResponseList,[])
AddLinear(ResponseList[ListCount(ResponseList)],randomlist)
end repeat
|
|