Pop quiz: how do you ensure that a number is negative? You could do something like:

Big Ben Negative


if (count > 0) {
	count = count * -1
}

Or you could use a ternary:


count = count > 0 ? count * -1 : count;

Or, if you're feeling fancy, use absolute value, like


count = Math.Abs(count) * -1;

If you're Justin's coworker, however, that's not good enough. No, what you REALLY want to do is coerce to a string, prepend a negative sign, then remove any double-negatives to make a positive again:


if (count > 0 || count < 0)
{
 string tCountDelta = "-" + count;
 tCountDelta = tCountDelta.Replace("--", "");

 // Some time later...
 int countDelta = int.Parse(tCountDelta);
}

Now that's fancy.

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!