Join us on Discord!
You can help CodeWalrus stay online by donating here.

Your worst programming fails

Started by Dream of Omnimaga, February 17, 2015, 02:15:23 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Dream of Omnimaga

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. :P 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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,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]]->[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).
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Yuki

Just yesterday, I wondered during a full day why the smiley thing didn't work and tried all the imaginable stuff in the hopes it would work. Turns out I initialized my array that holds the smileys with [] instead of {}. Although it's not the first time I call myself idiot in a git commit.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

I think I had something similar happen in HP PPL with FILLPOLY_P >.<.  My most common mistake back then though was omitting an End or using inverted boolean signs (eg < instead of >). But those tend to be common even among more experienced coders I think.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

#3
When I was first learning TI Basic I typed this out using Alpha :p

Clrhome
Disp A
Pause


I was so puzzled when I realized that nothing was happening.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

James Oldiges

I think we can all say out worst fail was not backing up before running faulty code + ram clear.

Keoni29

Yesterday I tried to debug a loader program and I could not figure out what was causing it to fail. It turned out that I ran it from the wrong start address. There was just one absolute jump used in the program, so most of it worked except for this one jump. That made it hard to find out my mistake.
If you like my work, why not give me an internet?

Hayleia

It was some time ago so I don't recall what it was about exactly. But I had a program that worked quite well, except for one little bug when exiting. I thought "lol, I just forgot to put that command at the end of the program". So I added that command, compiled again, ran again... and the bug was still there. In fact, nothing seemed to have changed. I checked, I really added that line that was supposed to solve the bug.

It took me at least 10 minutes to figure out it would of course never be executed if I put it after the final Return...

Snektron

#7
I don't recall my worst mistake, but this happens sometimes to me >.<:

if (x);
{
     //code
}


(the ';' returns the if block causing "code" to run everytime)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Hayleia

Lol, that can be hard to detect indeed :P
And glad you mentionned it, I'll add that to my list of reasons why I think the opening bracket should be at the end of the line with the if and not alone on its line :P

Dream of Omnimaga

#9
Oh wow, I do that often on the HP Prime Cumred >.<. Also I still sometimes forget semicolons at the end of some lines and since the HP Prime always throw Syntax Error no matter the error, it can get extremely hard to find out. In CSS it isn't a problem for me though (although CSS isn't really programming lol) because I use the SMF CSS editor which previews the result in real-time.
Quote from: James Oldiges on February 17, 2015, 08:34:57 AM
I think we can all say out worst fail was not backing up before running faulty code + ram clear.
^This. Although on the CSE I noticed that sometimes when the screen messes up it doesn't necessarily mean a RAM clear. Sometimes you just have to turn the calc OFF (although you can't see anything, so be careful to not launch another program) then ON again to fix it.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

Quote from: James Oldiges on February 17, 2015, 08:34:57 AM
I think we can all say out worst fail was not backing up before running faulty code + ram clear.
Thank science for Axe Backup amirite?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DarkestEx

Pressing "No" when being asked for Garbage Collect, compiling Axe code.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Duke "Tape" Eiyeron

Programming anything, because it'll fail.
  • Calculators owned: A lot.

matrefeytontias

This. It gave me nightmares when it came to releasing nKaruga.

  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Dream of Omnimaga

Quote from: DarkestEx on February 17, 2015, 04:52:14 PM
Pressing "No" when being asked for Garbage Collect, compiling Axe code.
i remember when people did that regularly. As for Axe backups I never relied on them because in 2011 or so some people reported that they often corrupted easily.

One CSE thing that can result into crashes is if you run Assemblybandit's apps via Doors CSE 8.1. It usually results into a bad crash on exit. The problem is that in DCSE it's very easy to enter the APPS menu by accident since it's the first item in the list, but it's very hard to exit if you forgot the keypad shortcut.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal