r/badcode • u/DiskoverOfficial • Mar 09 '22
c++ this monstrosity of a recursive function which I wrote for one of my University assignments
471
Upvotes
r/badcode • u/DiskoverOfficial • Mar 09 '22
54
u/O_X_E_Y Mar 09 '22
boggle.cppbecause this truly boggles the minddid you pass with this?
3
u/jarfil Mar 09 '22 edited Dec 02 '23
CENSORED
92
u/[deleted] Mar 09 '22
If else is always the key đ
55
u/[deleted] Mar 09 '22
Ok, next assignment... Translate to Haskell.
37
u/anirudhp06 Mar 09 '22
Now where's the guy who writes this images into code?
34
u/Knuffya Mar 09 '22
i wrote a regex to highlight everything that should deduct points:
.*11
u/nomokatsa Mar 09 '22
How to write this better?
1
u/Furry_69 Mar 12 '22
Is this calling itself with different arguments, and those arguments affect later calls with the else if statements? That sounds like hell to debug.
3
u/CunningJelly Mar 09 '22
my eyes
3
u/Jackie_Jormp-Jomp Mar 10 '22
What the fuck OP
2
u/maifee Mar 10 '22
Did your course instructor name this file?
1
u/DeWaldi Mar 09 '22
I have a similar one but I wrote it 3 times. Each is slightly different from the other, will do the same calculations but do a totally different job.
1
u/TheLauch Mar 10 '22
The x-0 and x+0 statements remind me of my dark past :0