Millisecond Forums

Select items but avoid something presented recently

https://forums.millisecond.com/Topic30939.aspx

By kev_dent - 2/27/2021

I wish to present participants with 16 digits in a sequence on one trial, with these 16 items selected from 8 possible digits.
How can I set this up so that the sequence of digits participants see is such that any repetition of items is separated by at least 3 other intervening different items?
Any help appreciated.
Best
Kevin
By Dave - 3/1/2021

kev_dent - 2/27/2021
I wish to present participants with 16 digits in a sequence on one trial, with these 16 items selected from 8 possible digits.
How can I set this up so that the sequence of digits participants see is such that any repetition of items is separated by at least 3 other intervening different items?
Any help appreciated.
Best
Kevin

You may be able to adapt e.g. https://www.millisecond.com/forums/Topic7122.aspx
By Dave - 3/1/2021

Dave - 3/1/2021
kev_dent - 2/27/2021
I wish to present participants with 16 digits in a sequence on one trial, with these 16 items selected from 8 possible digits.
How can I set this up so that the sequence of digits participants see is such that any repetition of items is separated by at least 3 other intervening different items?
Any help appreciated.
Best
Kevin

You may be able to adapt e.g. https://www.millisecond.com/forums/Topic7122.aspx

Actually, this should be easier with using a bunch of lists and /not constraints. Something like

<values>
/ n1 = 0
/ n2 = 0
/ n3 = 0
/ the_sequence = ""
</values>

<list digits>
/ items = (1,2,3,4,5,6,7,8)
/ not = (values.n1)
/ not = (values.n2)
/ not = (values.n3)
/ selectionmode = random
/ replace = true
/ selectionrate = always
</list>

<list digitsequence>
/ selectionmode = sequence
/ selectionrate = always
</list>

<trial exampletrial>
/ ontrialbegin = [
    values.n1 = 0;
    values.n2 = 0;
    values.n3 = 0;
    values.the_sequence = "";
    list.digits.reset();
    list.digitsequence.reset();
]
/ ontrialbegin = [
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n2 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n3 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n2 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n3 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n2 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n3 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n2 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n3 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n2 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n3 = list.digits.currentvalue;
    list.digitsequence.appenditem(list.digits.nextvalue);
    values.n1 = list.digits.currentvalue;
]
/ ontrialbegin = [
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
    values.the_sequence = concat(values.the_sequence, list.digitsequence.nextvalue);
]
/ stimulusframes = [1=the_sequence]
/ validresponse = (57)
</trial>

<text the_sequence>
/ items = ("<%values.the_sequence%>")
</text>