r/badcode • u/Ok_Scientist_8803 • Apr 06 '23
python Throwback to some years ago that I did an AQA computer science project in 48 lines (yes the lines are so long they go off my 16:9 screen)
302
Upvotes
121
u/DavstrOne Apr 06 '23
Environment requirements :
- 8k monitor
- Eagle eyes
13
u/BaconBoy2015 Apr 07 '23
Was the challenge to do it in under 50 lines? Line 2 makes me wanna vomit lmao
22
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Apr 07 '23
Image Transcription: Code
[The end of the first line in the
calculate()function in the following code is cut off in the image.]I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
7
u/d3f_not_an_alt Apr 07 '23
Fuck me. Are they still doing this at a level?
2
u/etocasper sadistic Apr 07 '23
This might sound strange, but I like this code style. There's a lot to improve in this code, but the layout and look is very cool.
79
u/ALapsedPacifist Apr 06 '23
Just making sure that nobody accidentally used uppercase numbers, huh?
30
u/scunliffe Apr 06 '23
The rule in python is that whitespace is significant, not that you’re not allowed to use line breaks ;-) /s
7
u/Stevecaboose Apr 07 '23
I'm always amazed how students are so good at making unnecessarily complicated code logically and readability (I'm guilty of this too) lol
3
u/laffer1 Apr 07 '23
I hate this so much
2
u/modelarious Apr 07 '23
I'm curious how many lines it would be if you ran Black on it
1
u/Nilrem2 Apr 07 '23
Wish we had computing/coding at school, was stuck with ICT. Flashbacks of Publisher and Word :-(
1
u/ap999nea Apr 07 '23
Bruh...
1
u/RedDoughnut9 Apr 07 '23
My eyes are hurting.
1
u/Taldoesgarbage Apr 07 '23
Yes.
1
u/[deleted] Apr 07 '23
do it in c++ then
checkmate dude
1
u/CousCousCaptain420 Apr 10 '23
Why didn't you just fix your Enter key?