Thursday, April 23, 2009

"Clever"

Here's one for you. Given two boolean variables A and B, and a language where booleans are real types and not masqueraded integers, consider this:

if ( ! (A ^ B) ) { do_something(); }


Think about how you would have written this two-bool operation. Laugh with me.

No comments:

Post a Comment