Prev: nike air max 2003 ney style hot sell ....free shipping to worldwide
Next: cluttered code prevention?
From: Jorge on 20 Oct 2009 16:50 On Oct 20, 10:40 pm, The Natural Philosopher <t...(a)invalid.invalid> wrote: > Jorge wrote: > > > The truly "alternative" if syntax is :-) > > res += ( ((i * j) % 8) && " " ) || "*"; > > Cute, and getting cuter... > > Hey Jorge, set up a call table in an array Yeah ! You're right ! I forgot that one ! a= [" ", "*"]; res+= a[!((i * j) % 8)]; :-) -- Jorge.
From: The Natural Philosopher on 20 Oct 2009 16:55 Jorge wrote: > On Oct 20, 10:40 pm, The Natural Philosopher <t...(a)invalid.invalid> > wrote: >> Jorge wrote: >> >>> The truly "alternative" if syntax is :-) >>> res += ( ((i * j) % 8) && " " ) || "*"; >> Cute, and getting cuter... >> >> Hey Jorge, set up a call table in an array > > Yeah ! You're right ! I forgot that one ! > > a= [" ", "*"]; > res+= a[!((i * j) % 8)]; > > :-) > -- > Jorge. Better, but no banana given function return_star() { return "*"; } f8uncton return_blamk() { return " "; } now set up an array and a function that calls the correct one by indexing off an array.
From: Jorge on 20 Oct 2009 17:05 On Oct 20, 10:55 pm, The Natural Philosopher <t...(a)invalid.invalid> wrote: > Jorge wrote: > > On Oct 20, 10:40 pm, The Natural Philosopher <t...(a)invalid.invalid> > > wrote: > >> Jorge wrote: > > >>> The truly "alternative" if syntax is :-) > >>> res += ( ((i * j) % 8) && " " ) || "*"; > >> Cute, and getting cuter... > > >> Hey Jorge, set up a call table in an array > > > Yeah ! You're right ! I forgot that one ! > > > a= [" ", "*"]; > > res+= a[!((i * j) % 8)]; > > > :-) > > -- > > Jorge. > > Better, but no banana > > given > function return_star() > { > return "*";} > > f8uncton return_blamk() > { > return " "; > > } > > now set up an array and a function that calls the correct one by > indexing off an array. That's the same as above, just put functions into the array to have them called afterwards: a= [fBlank, fStar]; res+= a[!((i * j) % 8)](); -- Jorge.
From: SAM on 20 Oct 2009 18:50 Le 10/20/09 11:05 PM, Jorge a �crit : > On Oct 20, 10:55 pm, The Natural Philosopher <t...(a)invalid.invalid> > wrote: >> Jorge wrote: >>> On Oct 20, 10:40 pm, The Natural Philosopher <t...(a)invalid.invalid> >>> wrote: >>>> Jorge wrote: >>>>> The truly "alternative" if syntax is :-) >>>>> res += ( ((i * j) % 8) && " " ) || "*"; >>>> Cute, and getting cuter... >>>> Hey Jorge, set up a call table in an array >>> Yeah ! You're right ! I forgot that one ! >>> a= [" ", "*"]; >>> res+= a[!((i * j) % 8)]; >>> :-) >>> -- >>> Jorge. >> Better, but no banana >> >> given >> function return_star() >> { >> return "*";} >> >> f8uncton return_blamk() >> { >> return " "; >> >> } >> >> now set up an array and a function that calls the correct one by >> indexing off an array. > > That's the same as above, just put functions into the array to have > them called afterwards: > > a= [fBlank, fStar]; > res+= a[!((i * j) % 8)](); ? ? ? javascript:b=function(){return'blank'};c=function(){return'star'};a=[b,c];alert(a[!(250.23*2)%8]()); javascript:b=function(){return'blank'};c=function(){return'star'};a=[b,c];alert(a[!('z'*2)%8]()); javascript:b=function(){return'blank'};c=function(){return'star'};a=[b,c];alert((250.23*2)%8);alert(!((250.23*2)%8));alert(a[!((250.23*2)%8)]()); -- sm
From: graderex on 20 Oct 2009 19:35
On Oct 20, 12:54 pm, Osmo Saarikumpu <o...(a)weppipakki.com> wrote: > optimistx kirjoitti: > > >> Stevo wrote: > >> It doesn't take long for people to figure out how unfriendly > >> PointedEars is. > > I share the feelings of the OP. > > What exactly was so "unfriendly" or "crude" as the OP put it? I could > not have responded more civilly even if I had three weeks to practice. > In fact, TL's response was not only civil, but also cordial. Go ahead, > read it, parse it and get the correct returned value. Simply, he made the OP (which may or may not be myself ;) feel like he didn't have a right to ask the question. What he was saying in so many words was, "Don't bother me with your stupid question. Read the manual and figure it out for yourself." (except he was ruder). OK, fine. But if you feel that way, why respond at all? It's much *quicker* and *easier* to just ignore my question entirely then to get into a long- winded answer (that went *way* beyond what I asked, by the way), and then insult me for asking it!!! And he calls me (err... the OP) an idiot! |