[Newbie] Breaking down bitvectors

From: Matt Lowe (modem-burn@geocities.com)
Date: 11/28/98

        Well, I was planing on making an area tool for windows to day
that is customized to my mud but before I started I had this fear of
writing it then figuring out that I did all the bitvectors wrong so I
wanted to check something out.

To breake down a bitvector you subtract and goto the next lowest
correct? Let me explaine.

a = 1
b = 2
c = 4
e = 8
f = 16
g = 32
h = 64
j = 128

Now if we add a, f and j together we get 145.

Well the lowest to 145 is j. So lets subtract 128(j's value) and we
get 17. Then lets goto the next lowest ... 16. So lets subtract 16.
(So far we have got j(128) and f(16)) Now we are left with one which
is the same as a. Is this the correct method?
        - Matt

     | 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