Telling livecode to randomize conditionally
Posted: Sun Aug 26, 2012 7:24 pm
Hi all,
I'm putting the same field into two different bins. I want to ensure that the last line of bin1 does not equal the first line of bin2. There are 30 lines in each bin (matlistF and matlistB). I've already randomized both matlistF and matlistB, so it is unlikely that the last line of matlistF = the first line of matlistB (but I want to be absolutely sure that this cannot occur).
Here is what I came up with:
However, the re-randomization of matlistB is not guaranteed to fix the issue. Is there a way to tell livecode to re-randomize matlistB so that the first item CANNOT be the last item of matlistF?
Thanks in advance.
I'm putting the same field into two different bins. I want to ensure that the last line of bin1 does not equal the first line of bin2. There are 30 lines in each bin (matlistF and matlistB). I've already randomized both matlistF and matlistB, so it is unlikely that the last line of matlistF = the first line of matlistB (but I want to be absolutely sure that this cannot occur).
Here is what I came up with:
Code: Select all
if item 1 of line 30 of matlistF = item 1 of line 1 of matlistB then
sort lines of matlistB by random(30)
end if
Thanks in advance.