• A good question. Maybe even a very good question.

    Maybe the title of the question could be phrased so that it makes it clear that what is being tested is knowledge of how implicit conversion from int to bit works. But that wouldn't be quite as much fun, now would it? and it would have rather given the game away.

    Personally I quite like trick questions, since they are like real life - most of the time all those frustrating hours spent wondering how that code could possibly do this are because we've missed some important bit of information that was right under our noses.

    I dislike questions where the wrong anser is given as right - but this question was not one of those.

    The questions I really hate are those where an answer is given which could be right if the question had mentioned all the constraints that the putter of the question has assumed but not stated, but without those constrains is a dangerous wrong answes that could easily lead to grief if applied in real life. This question was actuallyy just the opposite of that, demonstrating to people that if they assume a constraint (in this case "all variables are typed as int") that is not required by the problem (even worse one which is specifically contradicted by the terms of the problem) they will come to grief. It's a lesson everyone needs to learn. It also demonstrates that looking at all the constraints can give you a shortcut to the solution (and that's another useful lesson), several people commenting that this "this is a bit" constraint led them straight to the right answer.

    It seems from the number of unhappy responses that rather a lot of people have learned neither of those lessons.

    Tom