Feb-13-2018, 09:20 PM
(Feb-13-2018, 03:01 PM)sparkz_alot Wrote:(Feb-13-2018, 10:26 AM)pritesh Wrote: Now on a more generic note, here's some issues I have observed with my programming technique/method. I would be thankful if someone could let me know how to circumvent these issues
I don't think you're ever going to reach a point where you circumvent these issues. I know I go through your 3 steps all the time. In some cases, I spend more time trying to break my code than I spent creating it. Case in point, when I asked you above if you could use the abs() function, I thought I had the perfect solution, then this morning I thought "wait, that was to easy, what did I miss", so this morning I tried the one sequence I hadn't thought of last night, and sure enough I broke the code. By the way, I had 4 'print' functions not necessary for the script, but just so I could see what the 'program' saw. The 'print' function is probably one of the best tools the programmer has.
Since you seem satisfied, I'll go ahead and post this link Finger Excersise 2, you will have to scroll down almost to the end (a post by Archery1234), which also highlights the fact that there can be more than one solution to a problem.
Congratulations on solving the exercise. Onward and upward.
Hi,
Glad to know I am not the only one who is facing these 3 issues. :)
As for the code solution by Archery1234, it's far more elegant and succinct than mine. One day, I will write something as good as that, but till then, I will have to live with my own overly verbose code.