CSc 430  - S I M O N -  Prof. Domanski

Timing and Scroll Bar Controls and Programming

Right-Click image or HERE to download the .exe

Overview -- SIMON is an old children's game (still being sold in toy stores).  Your objective for this lab is to recreate a useful, playable version of the game - and along the way, to learn about using timer objects and scroll bars.  As in lab 1, try to create a program that is 'indestructible' to invalid mouse clicks coming at unexpected times.  The idea is that you'll be shown one color, then asked to enter it back.  Then you'll be shown the first 2 colors ... and you'll have to enter them back.  Then 3 colors ... and 4 ... until you can't remember the correct sequence.

How To Play -- 

  1. First, you must select an amount of time between .3 and 6 seconds for the colors to display.  You do this by moving the scroll bar.

  2. Pressing the 'Next in Sequence' button will cause SIMON to "highlight" one of the 3 colors at the top for the chosen time interval.

  3. You must remember the highlighted color!

  4. After it's been displayed, you must click on "What's the Sequence".  This will let you begin entering what you think is the correct sequence of colors.

  5. Click slowly on the color you think was shown.  If you're wrong, a message saying so will be displayed, and you'll have to start all over.

  6. If you're right, you'll get a message saying so ... and you'll be able to add another color to your sequence.

  7. Again, you'll have to click on 'Next in Sequence' to add another color ... this click will display ALL of the colors already in your sequence, plus one new color.

  8. And, as before, click on "What's the Sequence" to let you start entering/clicking what you think is the correct sequence of colors.

Little Things --

bullet

Notice the sequence number ... it is updated and erased periodically as the game progresses.

bullet

Notice the 'beep' sound whenever a color is displayed

bullet

Notice how the displayed colors are reset to black ... even if they are highlighted 2 times in succession.

bullet

Note how the time selected via the scroll bar is updated - both by making 'large' and 'small' change clicks in the scroll bar, as well as by scrolling the 'cursor'

Hard Stuff --

It will take some thinking on your part to understand how to control the timing of the different events ... my advice is to first think through the flow of the program.  Code and test little pieces at a time ... don't write the whole thing at once, and then start massive testing ... you'll lose your mind if you do that!  Think "Small is Beautiful" ... it's easier to test and find and correct your mistakes.

Due: on the PDA in 3 weeks.  Live compile & presentation required. No other type of submission is accepted.

Good Luck. 

(c)Domanski, 2000-2007.  All Rights Reserved.
Designed, coded, and maintained by DrB.   Last update on 02.18.09 20:07:35 -0500

And, as always, I make no claims that the executable program sample here is perfect, nor am I saying that it is without errors!