[solved] how to randomly vary the length of a cycle of words
Hi,
I'm relatively new to Open Sesame and so far, I haven't had any problems that couldn't be solved with the available documentation. However, now I am stuck with a seemingly easy part of my task:
I need to present a cycle of words (200 ms each), that randomly varies between 40 and 60 words. I've created a loop with the variable 'words'. Then I've imported the module 'random' and tried to use random.randint () to limit the duration of the loop, but this doesn't seem to work.
Is there another way to accomplish this? Many thanks in advance!
Stefan
Comments
Hi Stefan.
Imagine that your loop name is
words_loop. By inserting this code:before the loop item, the loop will last according to the number of repetitions indicated by the
repvariable. So, you have no need to define awordsvariable inside the loop.Hope this helps.
Cheers,
Andrea
That definitily helped! Thanks a lot.
Stefan