Counter FOR...NEXT loops
Hey, guys (it's me again).
I was looking for a little (more) programming help. What I'm trying to do is make a counter count up by "round" and as each round gets higher, it sends it to another subroutine. In other words, the first Round is Round 1, and when it hits round one, it goes to RANDOM_SEQUENCE1 subroutine and does what is there. When it finishes that and the user gets the answer right, I want it to count up another 1 and go to Round 2, and thus RANDOM_SEQUENCE2. Get what I'm saying?
The code in my non-computer programmer head looks something like this, which is a combination of BASIC stamp language and what I wish BASIC stamp language could say.
SETUP:
FOR Round = 1 TO 6
· GOTO RANDOM_SEQUENCEX
With X indicating the round as it counts up. Is there a way to make BASIC stamp recognize variables like that? I am sure that I've seen the use of variables somewhere in BASIC stamp, but could anybody help me out with the routine?
Thanks so much.
·
I was looking for a little (more) programming help. What I'm trying to do is make a counter count up by "round" and as each round gets higher, it sends it to another subroutine. In other words, the first Round is Round 1, and when it hits round one, it goes to RANDOM_SEQUENCE1 subroutine and does what is there. When it finishes that and the user gets the answer right, I want it to count up another 1 and go to Round 2, and thus RANDOM_SEQUENCE2. Get what I'm saying?
The code in my non-computer programmer head looks something like this, which is a combination of BASIC stamp language and what I wish BASIC stamp language could say.
SETUP:
FOR Round = 1 TO 6
· GOTO RANDOM_SEQUENCEX
With X indicating the round as it counts up. Is there a way to make BASIC stamp recognize variables like that? I am sure that I've seen the use of variables somewhere in BASIC stamp, but could anybody help me out with the routine?
Thanks so much.
·
Comments
Take a look at ON...GOTO in PBASIC Help
NumberPicker:
numgen = 11500
RANDOM numgen
DEBUG DEC ? numgen
myNum = numgen/6550 MIN 1
DEBUG DEC ? myNum
'IF myNum > 0 < 4 THEN AssignPress
'IF myNum > 4 OR 0 THEN
RETURN
RANDOM needs a different seed value each time
Brad