Help with Program - Simon Says
ktdid07
Posts: 8
Hi, everyone.
I am trying to build a simple Simon Says game with 10VDC lights...you know, like the one you used to have where the game would flash a series of lights at you, and you would repeat the pattern. Correct repetition would earn you points or access to a new level and incorrect repetition would lead to something unpleasant, like a loud buzzer or imminent death. [noparse]:)[/noparse]
Anyway, I was wondering if anybody had some suggestions on programming using PBASIC. I am trying to figure out a "random" pattern generator, and also how to allow the program to interpret the data coming back in.
Can anybody help?? I really appreciate it.
Thanks.
I am trying to build a simple Simon Says game with 10VDC lights...you know, like the one you used to have where the game would flash a series of lights at you, and you would repeat the pattern. Correct repetition would earn you points or access to a new level and incorrect repetition would lead to something unpleasant, like a loud buzzer or imminent death. [noparse]:)[/noparse]
Anyway, I was wondering if anybody had some suggestions on programming using PBASIC. I am trying to figure out a "random" pattern generator, and also how to allow the program to interpret the data coming back in.
Can anybody help?? I really appreciate it.
Thanks.
Comments
Make a tight loop with a counter that monitors a switch. This will be the start switch. When the user presses the button, use the counter number as a seed for the RANDOM command. Random isn't really random, if you use the same seed, you will get the same patterns. Using the counter as a seed will make it much more "random".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
BTW, I give out this same problem (program Simon into a BS1) in a course I teach on toy design. It's a great problem, and an opportunity to use 4 pins as both inputs and outputs. That is, light the LED and then monitor its switch with one pin.
Hey, wait, ktdid07, you had better not be a student in my class, soliciting help from all these Basic Stamp gurus in this forum! JK
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support