We all gotta start somewhere. I don't think we should feel ashamed of our past coding mistakes as a result, providing you don't still do those mistakes.
Anyway, does anybody here have funny or ridiculous coding mishaps from their past to share?
I start this topic because since I am porting a 2002 game to the CSE I just realized how much of a disaster the code in this game can be. For example, the map engine is about 35% of the entire game size despite being very rudimentary.
Anyway, here I start with something I just found after the title screen, which slipped by when I started remaking the game but went unnoticed until now for odd reasons:
If Z=13:Goto 1
Lbl 1
The following is a sign that the game in question is IN DIRE NEED of a map engine rewrite
:
If [A](PV,PMT)=11
[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1]]->[B]
If [A](PV,PMT)=12
[[1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]->[B]
If [A](PV,PMT)=13
[[1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0][1,1,1,1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,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1]]->[B]
If [A](PV,PMT)=10
[[1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]->[B]
ClrHome
prgmMFMR
If (PV=10 and PMT=10 and FV=8) or (FV=5 and PV=1 and M=0) or (PV=1 and PMT=1 and FV=1 and I=0) or (PV=2 and PMT=5 and FV=2 and J=0) or (PV=1 and FV=3 and K=0) or (PV=4 and PMT=5 and L=0 and FV=4) or (PV=4 and PMT=14 and L1(5)=7 and N=0
Output(5,8,"o"
The following had different values for Z because the controls were changed in this version, but you can still see relics of the past:
Repeat (Z>=11 and Z<=22) or Z=31 or (Z=23 and I+J+K+L+M+N>4
getKey->Z
If Z=11
1->L1(5
If Z=12
2->L1(5
If Z=13
3->L1(5
If Z=14
4->L1(5
If Z=15
5->L1(5
If Z=21
6->L1(5
If Z=22
7->L1(5
If Z=23 and I+J+K+L+M+N>4
8->L1(5
End
I am sure I had even worse stuff before, though. One example I remember is Hinkel from the Omnimaga Pack, which uses Lbl/Gotos to move the snake around. When the game was merged with several other games, this resulted in massive lag when pressing keys (half a second).