public void setupPartyList()
        {
            peanut   = new dog("Peanut", "Bichon");
            fifi     = new dog("Fifi", "Poodle");
            clarence = new dog("Clarence", "German Sheppard");
            giselle  = new dog("giselle", "border collie");
            lulu     = new dog("lulu", "shitzu");
            roy      = new dog("Roy", "Beagle");

            peanut.prev_dog   = null;
            peanut.next_dog   = fifi;
            fifi.prev_dog     = peanut;
            fifi.next_dog     = clarence;
            clarence.prev_dog = fifi;
            clarence.next_dog = giselle;
            giselle.prev_dog  = clarence;
            giselle.next_dog  = lulu;
            lulu.prev_dog     = giselle;
            lulu.next_dog     = roy;

            roy.prev_dog = clarence;
            roy.next_dog = null;
            head         = peanut;
            tail         = roy;
        }
        public string printPartyList()
        {
            string inviteList = "*--";

            temporary = head;
            while (temporary.next_dog != null)
            {
                temporary   = temporary.next_dog;
                inviteList += temporary.dog_name + " * --- * ";
            }
            Console.ReadLine();
            return(inviteList);
        }
Beispiel #3
0
        public string printPartyList_reverse()

        {
            string inviteList = "*--";

            temporary = tail;

            while (temporary.prev_dog != null)

            {
                temporary   = temporary.prev_dog;
                inviteList += temporary.dog_name + " * --- * ";
            }



            return(inviteList);
        }