sorting an array

From: Brian Williams - Nashak (bmw@EFN.ORG)
Date: 10/05/97


I'm stuck on this one too, I'm trying to make it print the array like
this:

   5 - magic missile
   3 - chill touch

but just plain sprintf'ing them to a buf:
sprintf(buf, "%s  %s - %s", buf, num_spells_memmed(ch, array[x]);
send_to_char(buf, ch);

would send this:
   5 - magic missile
   5 - magic missile
   5 - magic missile
   3 - chill touch
   3 - chill touch
   3 - chill touch
   5 - magic missile
   5 - magic missile

<or in any other order they are in>.. I can get it to not show the
   5 - magic missile    more than once, but then it won't show the rest of the
numbers for some reason.. I don't want to qsort the array because then it
would be in numerical order and i want it to be in the order the spells
were memorized in...Thanks for any help..

       /-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=X=-=-=-=-=-=-=-=-=-=-=-\
       |  Brian M. Williams          | 02/02/83 | bmw@efn.org          |
       X=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=X
       | Boccob the Uncaring, Lord of All Magic | Nashak Stonehand     |
       | accolademud.hermesnet.net 5000         | coyote.toon.org 6000 |
       \=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X-=-=-=-=-=-=-=-=-=-=-=/


     +------------------------------------------------------------+
     | 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/08/00 PST