goto and labels

BlitzMax Forums/BlitzMax Beginners Area/goto and labels


Excessive use of Goto's/Gosub's (with short variable names and only rare comments due to memory limits) led to code as clear as mud back in the old days:

750 FOR I=1 TO K3:GOSUB 5200:A$=KL$:Z1=R1:Z2=R2:GOSUB 5240
760 K(I,1)=R1:K(I,2)=R2:K(I,3)=S9:NEXT I
770 IF B3=0 THEN 790
780 FOR I=1 TO B3:GOSUB 5200:A$=BA$:Z1=R1:Z2=R2:GOSUB 5240:NEXT I
790 IF S3=0 THEN 810
800 FOR I=1 TO S3:GOSUB 5200:A$=ST$:Z1=R1:Z2=R2:GOSUB 5240:NEXT I
810 IF K3<=0 THEN 840
820 IF RND(1)>.333 THEN 840
830 GOSUB 3690
840 GOSUB 4100

That's from one of the many Star Trek games on this site. Ahh, the memories... <g>