# Help needed with Puzzle solution provided in C

• 11-22-2009
martin70
Help needed with Puzzle solution provided in C
Hello
I'm trying to solve a puzzle which should give me some coordinates - latitude, longitude somewhere in Berlin, Germany.
I'm assuming that the solution is written in C. Unfortunately my programming skills never made it past BASIC and Pascal some 20 years ago.

It would be much appreciated if someone could tell me the results to the following two lines of code:

(88%7?416<<14|252<<8&250<<8|508:399<<9|217<<10&374 >>5|1258)/(4<<15)

(52<13?464<<11&116<<6|347<<8|1449:424<<13&452<<14| 577<<9|1229)/(8<<15)

Martin
• 11-22-2009
Im not familiar with the "?" or ":" operators. Besides that, all the remaining operators can be found on a good scientific/programming calculator. On Linux you can use the default calculator and set it to "Programming" mode. I dont think the Windows calculator has this mode but you can check. If not, try and find an online programming calculator with these bitwise operators (AND, OR, shifting, modulo) or download one.

After you have access to one of these good calculators, just plug in your numbers as its all mechanical. It would be very tedious to do it any other way--or just put those lines of code in a basic C program and printf its result.

EDIT: Come to think of it, the "?" and ":" arent bitwise operators, but is actually a form of conditional operators. Something of the form
Code:

x > y ? 0 : 1
means that if the condition before the "?" is true (or non-zero in your case) then the part directly after the "?" is executed, otherwise the part after the ":" is executed. So if x is greater than y, the result is "0", otherwise it is "1" (whatever this result may actually be).

So using this condition operator in your first line means basically:
Code:

if (88%7 != 0)
then do
416<<14|252<<8&250<<8|508/(4<<15)
otherwise do
399<<9|217<<10&374 >>5|1258/(4<<15)

Similar for your next line. So either check these two conditions on the two lines to determine what the numerator is (manually, or write a program (C, C++, Java, etc), or use a good calculator). Then divide it by the denominator, which isnt part of the condition and is the same for either case.