macromedia.authorware
[Top] [All Lists]

Re: Random number generator help

Subject: Re: Random number generator help
From: "dd4455"
Date: Wed, 12 Nov 2008 08:05:35 +0000 UTC
Newsgroups: macromedia.authorware

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



<Prev in Thread] Current Thread [Next in Thread>