Re: [Circle] <Rookie> Displaying Race

From: Dez (
Date: 10/16/95

On Tue, 15 Oct 1996, Admin of The Keep wrote:

> On Tue, 15 Oct 1996, Jonathan Blackhawke wrote:
> > Small problem with this, GET_RACE(ch) is a number (%d).  You'll need to set
> > up a switch command to specifacally set up a buffer to keep the text of
> > what the race is.  I can show you an example if you need.  :)
>   A switch statement for this is a waste of time and efficiency, IMHO.
>   In whatever way you implement races, you probably gave them names in
>   the code; if you followed the manner in which I gave you then the
>   table includes the name of the race (Races[GET_RACE(ch)].name), or
>   you may  have an array (pc_race_types[GET_RACE(ch)].name).  No switch
>   required.

Actually both the switch and the Races[GET_RACE(ch)].name are both O(1) 
(big O of 1). Which means that it takes exactly the same amount of time 
to process both instructions... so they are just as efficient.  But as 
for stile preferences and smaller code base, the second option would be 
the best choice.


-+= Nudd the Usurper =+-

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

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