EDIT: In python I'm working on a for loop creating several trials, I'm showing random stimuli which can be repeated several times, but I don't want it to be the same as the previous one. I noticed the function random.sample but I have more trials than stimuli to show so I'll get an error if I try that option. I've also tried using something like:
last_stimulus = ""
a = random.randint(0, 9)
a != last_stimulus
But that didn't work either. I think there is some kind of way to write something in this part of code so there won't be any 'double' stimuli after each other, while the stimuli overall can be used more than once (they have to, considering the amount of trials I would like to create).
I'm working in psychopy and my code looks like this for the part with random stimuli:
for i in range(trials):
x = random.randint(0, 9)
stimulus[x].draw()
window.flip()
# and the for loop continues
Thanks
Aucun commentaire:
Enregistrer un commentaire