this should be obvious
The forms are not equivalent
Form 1 looks like this:
if var2 != 0 jmp @1 beep 9 @1 if var2 != 1 jmp @2 bgmplay ... @2 ... @4 ...Form 2 looks like this
if var2 != 0 jmp @1 beep 9 jmp @end @1 if var2 != 1 jmp @2 bgmplay ... jmp @end @2 ... @endThe difference is that the second form, on finding a successful case, does not have to evaluate all the other comparisons. If the value of VAR2 is randomly and uniformly distributed across [0,3] then on average it will evaluate 2 of the four cases before succeeding. Edit: this is ONLY for mutually exclusive cases, where you only want one outcome, though. If it's possible to execute multiple cases in one pass (like for checking multiple button states), you can't use ELSEIF here for the same reason: you don't want to skip over that intersecting check.
evil goto mode
For the sake of completeness, ON GOTO is faster here because it just uses an index instead of doing any comparisons:'Precondition: ' VAR2 is between -1 and 3 inclusive ON VAR2 GOTO @0,@1,@2,@3 GOTO @break @0 BEEP 9 GOTO @break @1 BGMPLAY ... GOTO @break @2 INC DDIP% GOTO @break @3 DEC DDIP% @break