Re: [LONG] Avatar and decapitate code with graveyard

From: George (greerga@CIRCLEMUD.ORG)
Date: 09/05/98


On Fri, 4 Sep 1998, Andrew Helm wrote:

>>>      mmc += atoi(temp);
>>
>>How about:  mmc += arg[0] - '0';
>[snip snip]
>>>      if (!mmc)
>>>        mmc++;
>>
>> mmc += (mmc == 0);
>>        Although that's a bit much sometimes. :)
>
>Don't you dare.
>
>At least what he had written was *portable* :)

The mmc++ is portable.  So is the - '0', assuming you don't use EBCDIC or
anything that redefines the lower 127 characters. Unicode leaves the lower
ASCII the same I believe, but that's just from hearing things. Could be
(probably) wrong.  The original method was fairly ugly.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/ (not done) | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST