CSST-Experiment

Hi there!

I have to program a CSST (spatial span test) experiment in Psychopy. To do this, 25 squares must be visible on each side of the screen (left and right). I created these squares in the builder. I called them L1-L25 an R1-R25:

Now only one of the five squares may be visible per line and per half of the screen, the others should not be visible (i.e. transparent). In total, only 10 of the squares should be visible at random. One in each line per screen half. Like thtat:

Unbenannt2

Can anyone help me with what the code should look like so that I can implement this? I can’t get any further with the previous entries in forums and with Chat GPT.

Thank you already from the bottom of my heart!

Does it have to work out that every row AND every column only gets one filled square?

assuming squares are indexed in list from 0 to 24

if so, I would do something like

filled=[ 0,1,2,3,4]
random.shuffle( filled)
for row in range (5):
    col=filled.pop()     # pulls last item in filled and puts it in 'col'
    square[col + row*5 ].setCol  ...

#  this will do one of the 5x5 squares then repeat for other side
#  assuming there is no dependence from left 5x5 to right 5x5