Re: Help with for loops :)

Originally Posted by gimbal2

People underestimate just how full of wisdom this advice is. Especially because of the attached prerequisite: the need to actually make sense of it first.

School is back in session so we're getting a lot of students with questions like "how do I improve this code", and it's confusing to them because the honest answer is "don't." As long as the code makes sense to you and works, move on and keep coding. Anything you write at this point will make you cringe in 6 months anyway, so why bother wasting time on premature optimizations?

Re: Help with for loops :)

Yeah well, those are lessons only the worthy really learn, some quicker than others :) When starting out it is not too bad to want to improve on yourself as a learning exercise, as long as you take the time to actually reason and learn what is actually an improvement. The assumption quickly goes towards less code = faster code, but that was only really true before compilers started to become good at optimizing.

My question is, anyone knows a more effective/better organized way to set up this code (maybe a more elegant way to print out the line between the top numbers and the table)?Im only allowed to use for loops and print statements :) :)

If you're forever cleaning cobwebs, it's time to get rid of the spiders.