E prime casino game code

82 views
Skip to first unread message

Corey Christner

unread,
May 21, 2013, 9:19:52 PM5/21/13
to e-p...@googlegroups.com
Hey everyone,

I'm a Junior psychology student, and am conducting an experiment dealing with Gambler's Fallacy this fall. I am trying to find code for a roulette wheel game, or at least get tips on how to write one. I'm brand new to the E prime program so any help would be appreciated. If you would like any more information or have any questions to ask, feel free!

-Corey

Pip

unread,
May 22, 2013, 8:22:53 AM5/22/13
to e-p...@googlegroups.com, e-p...@googlegroups.com
What's your experimental procedure? 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/c6cecb9a-c34f-4afd-a9b3-72178bd99bb7%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ben robinson

unread,
May 22, 2013, 9:36:10 AM5/22/13
to eprime
It won't be the easiest thing to do if you've never programmed before, but not impossible. Take it one step at a time. Here's how I made a roulette wheel recently:
1) Learn to drawn a circle onscreen in an inline. This will eventually be your roulette wheel.
2) Learn to drawn radii at regular intervals around the circle, for as many slices as you'll want on your wheel. Use code to iterate the drawing of the first radius as many times as you need around the circle (For radiusNumber = 1 to NUMBER_OF_TOTAL_RADII; Next radiusNumber).
3) Try to assign a different color to each slice for as many outcomes as you anticipate needing on your wheel - if it's just win vs not win, you'll only need two colors.
4) Now whatever code you've used to accomplish the above, try to make that iterative (using a similar For Loop) so that the same wheel you've just drawn can be drawn once for each step of a full rotation, because eventually the wheel will need to spin and you want the colors of your slices to travel with their respective slices around a full rotation.
5) Save each step of this iterative drawing process to a different offScreenCanvas so that you can later copy and paste the various offScreenCanvases onto your main cavas.
6) Draw a little arrow or something to indicate visually the location where a winning slice will be determined. You know, the ticker thing that goes tic-tic-tic-tic-tic like in The Price Is Right.
7) Write code to draw the wheel spinning for a period of time. Maybe find a .wav file online for the sound of a roulette wheel spinning, and draw the wheel spinning for as long as it takes the .wav file to play to completion. Make sure you add enough randomness to this spinning process or it will be easy for the participant to anticipate given the wheel's starting position, which slice will wind up a winner.
8) Write code to check the color of the pixel shown near the point of your arrow, and perform different actions given this color. This way, when the wheel finishes spinning, you check to see the color of the slice immediately in front of the arrow. This is the winning slice, and the color of the pixel should tell you what outcome to present the participant.

Hope that helps.



-Corey

--

Corey Christner

unread,
May 22, 2013, 11:31:18 PM5/22/13
to e-p...@googlegroups.com
I am having subjects play and bet certain amounts of money based on their perception of riskiness.

Cognitology

unread,
May 23, 2013, 3:59:44 AM5/23/13
to e-p...@googlegroups.com

Hi,

Personally, I would just show a little movie (E-Prime 2, otherwise movie converted to BMP) of a roulette wheel (easy to make in flash, for instance), show that spinning for a bit and write a big number in a central square that is either black or red. More to the point, it seems to me like Corey has never used E-Prime before and should first work through the tutorial or http://step.psy.cmu.edu/materials/EPrimer.pdf because otherwise it’s a bit like telling an illiterate how to write an essay in ms word.

 

(I did like your all-out canvas approach to the problem, btw)

Best,

Michiel

Reply all
Reply to author
Forward
0 new messages