

Geeks wanted (neat job application puzzle) - benhoyt
http://www.telogis.co.nz/

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

~~~
brett
Their ternary operator is a ternary operator.

------
lojic
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?

~~~
lojic
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 :(

~~~
lojic
Yeah baby! I missed one true/false Ruby idiosyncracy, and that did the trick
:)

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

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

~~~
staunch
As soon as I looked at it again I realized the problem.

------
dfranke
What language is that? It looks like the mutant offspring of C and Perl.

~~~
benhoyt
Yeah, I guess it's no real language. The if clause is the weirdest -- it had
me stuck for a while.

