News for hackers. Stuff that matters.
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 brett on Tuesday September 18, 2007 @05:06AM (#56198)
Their ternary operator is a ternary operator.
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?

Re:Geeks wanted (neat job application puzzle) by lojic on Wednesday September 19, 2007 @02:38AM (#56753)
Oh yeah, Ruby has a slightly different interpretation of true/false, so I changed while(z) to while (z != 0) - likewise with if. No help though :(
Re:Geeks wanted (neat job application puzzle) by lojic on Wednesday September 19, 2007 @03:05AM (#56759)
Yeah baby! I missed one true/false Ruby idiosyncracy, and that did the trick :)
Re:Geeks wanted (neat job application puzzle) by benhoyt on Thursday September 20, 2007 @07:54PM (#57690)
Think "Forth", "RPN", that sort of thing. It got me for a while too.
Re:Geeks wanted (neat job application puzzle) by staunch on Tuesday September 18, 2007 @04:50AM (#56194)
I did a quick direct translation into Perl and got 'b', 'e', 'o', 'k', 'j', undef, 'b'.

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 ...

Re:Geeks wanted (neat job application puzzle) by brett on Tuesday September 18, 2007 @05:15AM (#56201)
You're really close. Trying to figure out exactly how you managed to get three letters wrong is probably a more interesting problem than the original.
Re:Geeks wanted (neat job application puzzle) by staunch on Tuesday September 18, 2007 @07:28AM (#56223)
As soon as I looked at it again I realized the problem.
Re:Geeks wanted (neat job application puzzle) by dfranke on Tuesday September 18, 2007 @03:02AM (#56164)
What language is that? It looks like the mutant offspring of C and Perl.
Re:Geeks wanted (neat job application puzzle) by benhoyt on Tuesday September 18, 2007 @04:08AM (#56184)
Yeah, I guess it's no real language. The if clause is the weirdest -- it had me stuck for a while.