the most stupid randomization problem
Michiel Spape
Michiel.Spape at nottingham.ac.uk
Thu Mar 18 13:49:33 UTC 2010
Hi,
What's so stupid about the question? Okay, I get that the problem is quite easily explained, but once you'd be able to exactly state how one would do something about it to solve it, just with words, it's a breeze to solve in programming. In a way, finding it really simple (but not knowing how), is similar to what most of us deal with in daily life once we're trying to really explain what we're working on in psychology: 'I'm trying to understand how people segregate objects from the background'... reply: 'what's so difficult about that?'... 'so you tell me how a brain can do this?' ... 'well, you just *DO* it, see? Simple!'
Anyway, never mind the rant (bit sick, feel like ranting), here's a stupid way to solve your problem:
Dim myTrials(90) as integer
Dim I as integer
Dim thistry as integer
For I = 1 to 90
myTrials(I) = I mod 10
Next I
TryAgain: 'this is the syntax for a label
RandomizeArray myTrials 'randomising the array
Thistry = thistry + 1
Debug.print "Try " & cstr(Thistry) 'so that we can see how often it randomised it
For I = 1 to 89
If myTrials(I) = myTrials(I+1) then goto TryAgain 'very ugly programming, but should work.
Next I
...Something like that. Basically, we keep on randomising until no subsequent number is the same as the current. Then have a trialcountervariable that is updated every trial and dosomething like c.SetAttrib "myFavouriteAttribute", myTrials(trialcountervariable).
Can't check if my syntax is correct now though (failed install of the net station package files, and now e-prime doesn't work anymore).
Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of leylo
Sent: 18 March 2010 02:33
To: E-Prime
Subject: the most stupid randomization problem
Hello everyone!
I'm really new in this world of e-prime, and I am embarassed to post
this question that will probably make you all laugh, but I would
really appreciate your help because I'm stuck with this part and I
have to finish this experiment, and I have to do it fast.
Problem is: 90 trials of random numbers from 0 to 9, but so that
every number follow every other once and only once, and consecutive
presentations are not allowed.
I guess I would have to use that "No Repeat" Script, but you can get
the idea from my question that my knowledge of programing is not so
great, so if someone could explain this to me using my example or if
someone have some other idea.... that would help me a lot.
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list