Re: Fastest Way to...
- Posted by euphoriCK <euphoric at cklester.com> Oct 28, 2003
- 399 views
C. K. Lester wrote: > I've got a 3-element sequence... > > { 3, -1, 0 } > > and need to turn it into this > > { 1, -1, 0 } > > That is, any positive values ( > 0 ) should be turned to one. Okay, here's my attempt: junk = pos <= 0 pos = pos * junk pos += not junk Yes, I know I could combine that into some big convoluted function, but you get the gist.