Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I wonder if we can obfuscate the code so much that it doesn’t look like you’re hardcoding it.
-
It could be worse. When I was on Programming basics at university, we had a test. I was about reading a string and print it in diagonal. Most of my partners took the code from Yahoo answers. The teacher noticed it and put a zero of everybody’s test except 3 (including me, fortunately).
-
I once had to do a similar fibonnaci sequence task in a programming olympiad, i had no idea wtf i did or how i did it, but i managed to get it working, i didnt even understand my own code at the time. My IT and maths teacher approached me asking me why im in lower grade maths when i could do that fibonnaci sequence... I still to this day dont understand what i did and probably cant redo it 😂 but i got an awesome gold certificate to put in my portfolio 😎 Keep in mind i had no prior knowledge of what a fibonnaci sequence was nor did they explain, they just gave examples and said replicate the pattern. If i had to look at an explanation of it now i could probably replicate it easily.
-
The task wasn't phrased well enough: up to n terms would have forced the solution to be calculated instead of hardcoded
-
Technically you coded exactly what was required. Most programming languages also have a hardcoded PI constant.
Best is the recursive Haskell implementation though, infinite list of all fib numbers:
f = 0 : 1 : zipWith (+) f (tail f)
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
cansik2This Fibonacci joke is as bad as the last two you heard combined.
Teacher: Write a program to print fibonacci series up to 8 terms
Me: *hardcodes 0,1,1,2,3,5,8,13*
Teacher: *runs the programs*
Me: *relieved*
Teacher: *checks the code*
Me:
joke/meme
turbo c++
india
morgan freeman
messed up
fibonacci
rip
turbo
cbse
hackerman
hardcodes
c++