Re: [Circle] Bits and EXP losses

From: Hades (
Date: 07/31/96

> I'm not understanding the bits thing. Lemme show you an example. This is 
> the code for losing exp when you die:
>      gain_exp(ch, -(GET_EXP(ch) >> 1));
> Ok, lets say the player has 393901 experience points when he dies. Now... 
> Does this mean that it moves the pointer or whatever 1 step to the right? 
> So, he would lose 93901 exp??? If so, would GET_EXP(ch) >> 2 cause him to 
> lose only 3901???
> If not, could someone explain that to me. Please no 'get a C book' 
> responses and/or flames. It just spams the list and it's very immature.

Uh... GET A C BOOK, what you just asked involves some in depth topics, which
can be explained here kinda crappily, or you can actually buy a book and
learn it. If you know how bits and binary numbers wortk it's a bit easier,
but if you have no idea how binary numbers work then you are asking for a 30
minute lecture to teach you some basic C. Immature or not, get a book.

In short, without learning squat, >> 1 halves a number, << 1 doubles it, >>
2 quarters, >> 3 eights it, etc. See now you know but you have no idea why
it does that and if you ever do need to know yer SOL.

Hades - C is NOT learned by relying on everyone else for all your answers.

Systems Administrator of Send an Email to     M   T for info on how you can run     U   E
your mud or chat client on MudTech.                          D   C
Visit Ebon Mists MUD at 8888           H
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

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