J
Joel Yliluoma
Obviously, this program outputs 1 3 6 4 7 6 2 3 6 4 7 6 0.
Except it doesn't. It outputs:
1
3
6
4
7
6
2
3
6
4
7
6
[No trailing 0].
Weird, it does output the trailing zero for me.
(What idiot came up with B_RETURN_TO? When would it possibly be useful?)
Spaghetti code is not spaghetti code without irregular execution paths.
B_RETURN_TO of course models the "RETURN <label>" statement in BASIC.
One such use for it would be for example, in a game where "GOSUB gamemain"
could be matched with a "RETURN" that asks for a new game and "RETURN endgame"
that cleans up and terminates.
It is a crude mechanism resembling function return values in languages
such as C++.