Some backstory: the last snippet was real code my TA friend saw in a 1000 level CS course, apparently the kid spent an hour on stackoverflow and was convinced that was the proper way to do it and he was so proud
some schools operate on a four-digit system. The last number is almost always a zero, the only exception is for labs and subsidiary material. so 101 is 1010
22
u/TheSinfulKing Nov 22 '18
Some backstory: the last snippet was real code my TA friend saw in a 1000 level CS course, apparently the kid spent an hour on stackoverflow and was convinced that was the proper way to do it and he was so proud
95
u/Lost4468 Nov 21 '18
39
u/Miserable_Fuck Nov 21 '18
This is the story of a person writing the same piece of code as they develop degenerative brain cancer. That's a tumor explosion in the last pic.
10
u/TicTacMentheDouce Nov 22 '18
Isn't the last one kind of like how Python handles for loops ?
7
u/[deleted] Nov 22 '18
It's missing one thing. You're not writing the input to a plaintext file then calling the contents with a separate script.
4
u/ciras Nov 21 '18
Needs more ternary operators
6
u/[deleted] Nov 21 '18
TBF, that last one is pretty idiomatic Java code.
5
u/tdammers Nov 21 '18
I take it your language has TCO, yes?
2
u/Xiefux Nov 22 '18
1
u/techworker123 Nov 22 '18
I'll make it easier for you. Just set a limit of scans and if the limit arrived cancel the function.
You're welcome
2
u/[deleted] Nov 22 '18
[removed] — view removed comment