Create a experiment with dots appearing random on a screen

David McFarlane mcfarla9 at msu.edu
Mon Mar 9 15:21:03 UTC 2009


On Friday 6 March 2009 at 4:37 p.m. nyu.nirs at gmail.com wrote:
> And these zones you talk about, would that be images on a slide or is
> there another way to do it?

You can program it however you like.  Sure, SlideImages on a Slide might 
work well, or just draw directly to the Canvas (see topic in online 
E-Basic Help).  I cannot give you any more details because I have not 
thought this through any further myself, so you will have to take it 
from there.

But just to illustrate this with a few numbers...  Let's say I have 10 
dots and want to disperse these among 10 zones in a 640x480 screen with 
a buffer of 2 pixels around the edge of each zone.  So each zone might 
have a size of 64x48, and I would use only the 60x44 area within each 
zone for dot placement.  Zone 1 would start with its corner at (0, 0), 
zone 2 at (64, 0), etc.  For the first dot I could pick a random x from 
2 to 61 (because of the 2-pixel buffer) and a random y from 2 to 45, 
let's say we get (5, 41).  I could then add that xy displacement to the 
corner coordinate of zone 1 to put my first dot at (5, 41).  I then pick 
another random xy displacemet for the second dot, let's say we get (59, 
13) this time.  Then I could add that to the corner coordinate of zone 2 
to put my second dot at (123, 13).  And so on.

Once again this is only an illustrative sketch.  I must leave the 
programming details to you.

> Further, if we want to keep the ratio between the two different types
> of dots to either 1:1, 1:2, 3:4, or 5:6, is there a way I could do
> that?

Yes.  And I am sure that you can figure it out.

> A lot of problem solving in creating this project and it is driving me
> a bit bonkers. Ugh.

Indeed, writing a good program for an intricate behavioral task takes a 
lot of hard work and learning.  A firm grounding in computer programming 
or math helps.  So welcome to the club!

-- David McFarlane, Professional Faultfinder


--~--~---------~--~----~------------~-------~--~----~
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