Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Flipping variable

Name: Anonymous 2010-11-05 16:50


if(foo == 0)
    foo = 44;
else
    foo = 0;



How do I change that into a single line that does the trick using arithmetic?

Name: Anonymous 2010-11-06 6:31

>>14
>I could do that in Scheme:

No. You can't, ``retard''
>(set! foo (if (= foo 0) 44 0))

is equivalent to foo = foo == 0 ? 44 : 0 (>>2), not
foo ?= 0 : 44; (>>13). Count how many times variable name "foo" is encountered in your expression, >>2-kun's expression and how many times in >>13-chan's expression.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List