Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Shuffling and randomization


I have four variable in a loop :

"word" that is included with 64 words

"type" that included with singular (e.g., apple) or plural nouns (apples)

"location" that is included with -320 and 320

"counter" that is included with the numbers form 0-31

After a random selection, two words to be selected out of 64 words, one from singular and one from the plural words. One of them to be presented in the middle screen and the second on the periphery (-320 or 320) in a fully randomized way.

The words are added to the sketchpad at the -320, middle screen and 320 and I need help to know how manage the opensesame to randomize presentation so each time only one word is selected from singular and one from plurals and such the selection has no repetitions for both the selected words. I do not want two similar words (apple and apple) or two words from one category (both singular or both plurals) together in one trial. In addition, the total number of presented trails for each person needs to be 32.

Please can you kindly help managing this experiment?




  • Dear Masoud,

    As Eduard already suggested in response to your previous comment, you should define your word lists in an inline_script item rather than in your block_loop. Next, you'll need a second inline_script item to retrieve the words for the current trial.

    More precisely:

    • Append an inline_script item to your block_sequence and place something like below in the Prepare phase tab:
    import random # We need this module to shuffle the lists
    # Define the two lists of 32 words:
    list_singular = ["apple", "banana", "book", "script", \
    list_plural = ["apples", "bananas", "books", "scripts", \
    # Shuffle the lists:

    • Append another inline_script item to your trial_sequence and put something like this in the Prepare phase tab:
    while True:
    	# Get the next word from the shuffled list:
    	var.word_singular = list_singular.pop()
    	var.word_plural = list_plural.pop()
    	# Check whether the plural is not the plural of the singular word:
    	# (I assumed that the stem is the plural minus the last letter (i.e., the 's'):
    	stem = var.word_plural[:-1]
    	if stem != var.word_singular:

    • In your block_loop, you'll only have to define the variables for the x-loxation of the plural and the singular word of the current trial.

    All together, your experimental structure should resemble something like this:

    NOTE that for checking that your trials won't contain 'apple' and 'apples', I assumed that all your plural words are formed by placing an 's' at the end of the singular form. So 'book' -> 'books', but not 'bunny' -> 'bunnies'.

    I attached a working example script. I hope this helps!



    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Dear Lotje

    Thanks very much. I have used the singular and plural names just as an example. In fact, I am using the words from two categories including "A reading Stuff" and "A four foot animal".

    I have 32 words for the reading stuffs (e.g., book, story etc) and the same from animals (cat, dog etc). I want to have roughly the same number of words from each categories to be resented in the middle/right or left the screen. To have it completely randomized, the 64 words are pooled together (32 plurals + 32 singulars) and each of two lists comes with 64 words, both are similar. I want 32 selections or 32 trials out of possible compositions of 64 (+64 similar) words.

    The program not presents the same number of words on each location and it also shows repetitions.

    Can we change the inline script so for each of the 32 trials, it selects one word from each list and and to present them by random in the middle/left or right the screen so the number of presentations remained the same across the locations and lists with no repetitions?



Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games