You're better off doing just one check for #UP and one for #DOWN, put a VSYNC at the end of your loop too. Do it like this:
IF B AND #DOWN THEN
IF S==2 THEN DO THIS
ELSEIF S==3 THEN DO THIS
ENDIF
ENDIF
Then do the same for #UP.
I think you're missing END statements, idk though I don't like doing it on one line. (goes against coding style) and it just makes more sense to do it with proper style.
Sorry my first example didn't show this, but just get used to doing it this way. Each indentation shows which loop/if statement it executes.Just tested and this works.
I usually use (2) because it only detects a press versus a button hold. If you press the '?' mark after typing 'button' it will explain the differennt parameters. You will see, if you use BUTTON() and hold the button it will rapidly print that text.
Sweet! That's easy.
X=RND(3) + 1
RND(3) If I remember correctly will generate a random number from 0-2, I can't remember just mess around with it, and add +1 to avoid picking zero.