Howdy, Stranger!

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

Supported by

[open] Random number addition and presentation

edited March 2015 in OpenSesame

Hi there!

I'm starting to get desperate here, I think I tried everything to make this work, but I couldn't manage to find a solution for this.

I'm making an experiment, where I try to run a 10-cycles loop which presents a random number (randint(1,9)) in every 2 seconds.
I want these random numbers to be added to each-other sequentially (there's an initial number at the beginning, which is 150), and if the participant loses track of the calculations, the result of the addition could be made present by simply pressing the space button. After this, the presentation and the addition of the random numbers would continue, and the showing of the result by pressing space could be repeated as many times as necessary.

The problem is that somehow OpenSesame doesn't remember the random numbers, or it adds too many random numbers at once, because, for instance, when the experiment shows 150 then 3 (at the very beginning of the sequence) and I push the space bar, the next thing that appears could be 164.

I'm at the point where I even define the OpenSesame experiment variables in inline code.

I have an inline code before the loop where I set the initial number (rand_add = 150). Note, that I present this number before the loop.

In the GUI I don't define any variables anymore, just set the cycle count to 10 (also the presentation is sequential, not random). In the embedded sequence the random number (from 1 to 9) is always made shown except for when the space is pressed, and the result number is only shown when someone presses the space. In the sequence there's a keyboard response tool as well.

And then I have an inline code in the loop:

   #this is the random number generator
rand = random.randint(1,9)
   #this adds the appearing random numbers to the initial 150 in every cycle with a constantly increasing value
rand_add = rand_add + rand
   #I figured that maybe by using convenience variables, OpenSesame would remember the number
   #these set the variables for the experiment
exp.set('trial_rnumber', rand)
exp.set('trial_result', rand_add)

Can you tell me what's the real problem here? How can I make this work?
Thanks!

P.S. When I create a list element to collect the random numbers, at the end I only get back an empty list.

Comments

  • edited 2:44PM

    Hi,

    From what I understand, your approach is correct. Set rand_add to some initial value before the loop, and then increment it on every trial. But your question is a bit vague in what you want to do and how you have implemented this right now. Could perhaps upload the experiment somewhere, and explain in more detail what you'd like the experiment to do?

    Cheers,
    Sebastiaan

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 http://45.77.173.118/ 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