doug65536 18 Light Poster

I think what you are asking is how to reverse engineer the protocol.

Yes, reverse engineering is usually difficult.

One approach is to make the program do known things and watch the data. Repeat the operation and see what changes and what doesn't. Then do something slightly different and see what changes. You will gradually figure out the structure of the data by comparing the data packets to your input. You can gradually narrow down the layout of the packets.

doug65536 18 Light Poster

There is a lot more to it than blindly copying a block of code and expecting it to work. It depends very much on the processor and the instructions being used. For example, a switch statement might have a lookup table somewhere else. It might be using jump vectors for dynamic link library imports that won't necessarily be there. It might have string literals that it is expecting to be at a certain address in the const section. It might be referring to global variables that may not be there or may not be at the expected address.

The worst problem is there might be instructions that use absolute addresses - which will be wrong if you put it at a different address. It might call other functions, how will they work? How will it know what address those are at (assuming they exist at all).

Ancient Dragon commented: good :) +17
doug65536 18 Light Poster

At the start of the fight, C would open up with a flurry of super high speed punches. After a while though, the C program would start to bog down, because the developer used simplistic algorithms - lots of linear searches and the like.

C++ would maintain higher damage later in the fight, due to having lots of O(log(n)) performance containers. Therefore, C++ would win ;)

doug65536 18 Light Poster

I didn't see anything saying that the OP was asking to prove that 0.999<repeating> was equal to 1.0. The OP says, prove that 0.999 (which I interpreted as exactly 0.999 as in 0.999000).

Is this a sinister puzzle given by a computer science teacher or something? If so, I believe I see the trick to it.

The puzzle probably wants you to realize that floating point numbers are typically stored with a mantissa and an exponent. What I believe the puzzle is looking for is you to come up with a floating point representation format where the mantissa doesn't have enough bits to store 0.999 - the closest representation would be 1.0.

Eagletalon commented: Good logic and well writeen answer with a start to solving it +1