PennController for IBEX › Forums › Support › Randomized separator in randomized sequence of trials › Reply To: Randomized separator in randomized sequence of trials
October 27, 2023 at 9:55 am
#10927
Jeremy
Keymaster
Hi,
If you already know how many trials you will have of each type, I would probably use the pick
function, like this:
N_SEP = 4; N_STIM = 8; stims = randomize("theStimuli") seps = randomize("theSeparator") subseq = [] for (let i=0; i<N_STIM; i += N_STIM/N_SEP) { subseq.push( pick(stims, N_STIM/N_SEP) ) subseq.push( pick(seps, 1) ) } Sequence( "intro" , ...subseq , "end" )
Jeremy