Re:Geeks wanted (neat job application puzzle)
by uuilly on Tuesday September 18, 2007 @04:38AM
(#56189)
They're doing a bunch of bit voodoo. The ^ operator is XOR, '<<' shifts bits left and '&' is a bitwise AND. That's what they are in C++ at least.
x = a&x ? a&b : c+x
is a lot like the C++ shorthand if-then-else thingamabob:
x = ( 1 < 0 ) ? 10 : -10;
which translates to:
x = 10 if 1 < 0 else x = -10.
Not sure what they mean with their thingamabob though.
Re:Geeks wanted (neat job application puzzle)
by lojic on Wednesday September 19, 2007 @02:27AM
(#56747)
Looks pretty close to Ruby:
1) remove semi-colons
2) replace a = b - - with a = b followed by b -= 1
3) while (z) { .. } with while (z) ... end
However the if modifier (if it works as in Ruby) doesn't work out very well. I haven't touched Perl in 9 years, so I don't know how different the operator precedence is if at all.
What's the deal with the if? Is it a regular modifier?
x = a&x ? a&b : c+x is a lot like the C++ shorthand if-then-else thingamabob: x = ( 1 < 0 ) ? 10 : -10; which translates to: x = 10 if 1 < 0 else x = -10.
Not sure what they mean with their thingamabob though.
However the if modifier (if it works as in Ruby) doesn't work out very well. I haven't touched Perl in 9 years, so I don't know how different the operator precedence is if at all.
What's the deal with the if? Is it a regular modifier?
But neither of these exist:
http://www.telogis.co.nz/beokjb.html
http://www.telogis.co.nz/beokjob.html
And I give up really fast on these, so ...