Quote:
Originally Posted by Schnabel
I found an error in your code, let's debug:
In this setting, 33 is your variable (assuming you defined it earlier). Let's assume 33 is currently set to null. In your example above, you are saying "If set 33 to Team then call Win" However Team is not a valid variable, instead it should be 'Team'. So that would kill you first. THEN you are setting 33 to Team, I think you would rather do a Binary test now wouldn't you? You would rather it be "If 33 is Team then call Win" which would require double =. So for this statement to function properly, you should have wrote:
If (33 == 'Team') WIN();
.
.
.
.
.
.
.
.
.
.
.
.
.
.

|
I disagree. == is not =.
= sets one variable to another. == checks for a comparison. so I am checking that team is equal to 33, if it is, then win. The order does not matter.
Actually, in C (or C++), it is better to put the constant before the variable, in case you forget the second =, so the compiler will give you an error for setting a constant instead of getting some crazy error at runtime.
EDIT: I see that BJC forgot the second =. The actual one says "if (33==team) win();"