macromedia.authorware
[Top] [All Lists]

Re: Random number generator help

Subject: Re: Random number generator help
From: "Chris Forecast"
Date: Thu, 13 Nov 2008 10:32:27 -0000
Newsgroups: macromedia.authorware

"dd4455" <webforumsuser@xxxxxxxxxxxxxx> wrote in message 
news:gfgtmd$evd$1@xxxxxxxxxxxxxxxxxxxxxxxx
> Chris, you must be having a laugh at my expense because there's no 
> difference
> between the two:
>
> "Nope, one ends in:
>
> ...randomlist)
>
> and the correct version ends in:
>
> ...randomlist)"
>
> And there was me thinking you were trying to help...

Hmmm, that's curious. If I view them on the web forum (which I assume is 
where you're looking?) they're the same, if I view them in OE (which is 
where I posted from) they're different.

It looks as though it's interpreting my open square bracket, followed by i, 
followed by close square bracket as a turn on italics instruction - which 
isn't very helpful!

Try the following, where I've used the variable name j rather than i.

groupsize:=2 -- set value as appropriate

randomlist:=[]
repeat with j:=1 to Number(TempString)
  AddLinear(randomlist,j,Random(1,j,1))
end repeat

ResponseList:=[]
repeat with j:=1 to Number(TempString)
  if MOD(j-1,groupsize)=0 then AddLinear(ResponseList,[])
  AddLinear(ResponseList[ListCount(ResponseList)],randomlist[j])
end repeat

Chris Forecast



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