How to randomly select 'target' rectangle from xy_circle
For an experiment, I want create a canvas which shows rectangles around a central fixation dot. After showing this canvas to the participant, I want to show the canvas again, but in some cases with the 'target' rectangle in a different orientation. As you can see below, I have now used the xy_circle function to create the rectangles around the fixation dot. But I don't know how to randomly select a target, and change its orientation. Does anybody have any tips for me to do this? Or is it better to use a function other than xy_circle?
Thank you for your help!
my_canvas4 = canvas() my_canvas4.fixdot() for x, y in xy_circle(8, 200): my_canvas4.rect(x-20, y-45, 40, 90, fill=True, color=u'red')