Random(3) often returns 1

Sarah Reichelt sarah.reichelt at gmail.com
Thu Jun 8 09:00:43 EDT 2006


On 6/8/06, Thomas McCarthy <tominjapan at excite.com> wrote:
>
> Has anyone noticed this?
> I have two games that sort a container (three lines, one line is the answer) by random the number of lines. The "answer" should be in any one of the three resulting lines, but is overwhelmingly in the first

I think if you sort using only the number of lines as your randomiser,
you will get some lines with the same sort value and so their order
will remain the same.

When doing this type of sort, I alwasy got for a ridiculously large
randome number to reduce this possibility e.g.

  sort lines of fld "Answers" by random(1000000)

HTH,
Sarah



More information about the use-livecode mailing list