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 = lulu; roy.next_dog = null; head = peanut; tail = roy; }
public string printPartyList() { string inviteList = "*---"; temporary = head; while (temporary.next_dog != null) { inviteList += temporary.dog_name + " *---* "; temporary = temporary.next_dog; } inviteList += temporary.dog_name + " *---* "; return(inviteList); }
public string printPartyList_reverse() { string inviteList = "*---"; temporary = tail; while (temporary.prev_dog != null) { inviteList += temporary.dog_name + " *---* "; temporary = temporary.prev_dog; } inviteList += temporary.dog_name + " *---* "; return(inviteList); }