Ah, the +1 is to add clarity to the program. updown is either 1, or -1,
or, better in this case, as +1 or -1. It's quite possible the code will
be read by others eventually. I'm emphasizing the purpose of the
variable by reminding the reader of its significance. Plus is
associated with moving forward along a line, and negative in the order
direction. I suppose this is similar to something I did long ago for a program that I called p, just one letter. A colleague who was working with me asked why I did that. It takes one key stroke to execute it was my answer. When it got out of development, I gave it a more fitting name. It also kept it easily visible from other programs and files in my folder when I was looking for it. I suspect I really called it a. Yes, variations on !=, <>, not equal, .ne., ... Just a hold over from former languages. Alan Gauld wrote:
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet "Though no one can go back and make a brand new start, ANYONE can start from now and make a brand new end." -- Anonymous Web Page: <www.speckledwithstars.net/> |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor