good idea! I played code golf/obfuscation with this one; I'm working on making it shorter
to understand this you need to be very aware of operator precedence, short circuit logic of logical operators, know what the comma operator is, and that += and ++ operators return a reference to their arguments.
This post has been edited by ishkabible: 10 July 2012 - 11:34 AM
Can I just point out that the point of PE is that you don't know the answers until you solve the problem, and also that solving a particular problem gives you access to a discussion forum for that problem on the PE site? Yes, I know that answers to particular problems are available, and are even discussed here, but the idea of collating solutions to the problems in one thread seems well beyond disrespectful to the expressed intention of the people maintaining that site.
We preserve a certain level of quality of discussion here at DIC by, among other things, chasing off the "gimme teh codez" crowd and those who cater to them. We expect them to respect the way things are done here. I think it'd be good to give the PE folks at least the level of respect we expect for ourselves.
I agree with Jon plus this topic doesn't really fit this forum. This is a "challenge" forum not a discussion forum. I think this could have been a decent challenge for our beginning members if it would have been posted as such.
I agree - the initial post had merit (and I do enjoy talking about a particular problem or devious solution), but having a one stop thread of just answers seems a bit... less than up and up. I'll close this now.