public void setupPartyList() { peanut = new dog("peanut", "bichon"); fifi = new dog("fifi", "poodle"); clarence = new dog("clarence", "german"); gizelle = new dog("gizelle", "buorder 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 = gizelle; gizelle.prev_dog = clarence; gizelle.next_dog = lulu; lulu.prev_dog = gizelle; lulu.next_dog = roy; roy.prev_dog = lulu; roy.next_dog = null; head = peanut; tail = roy; }
public void run() { head = peanut; peanut.dogname = "peanut"; peanut.dogbreed = "bichon"; peanut.nextdog = fifi; fifi.dogname = "fifi"; fifi.dogbreed = "poodle"; fifi.nextdog = jordan; jordan.dogname = "jordan"; jordan.dogbreed = "german sheppard"; jordan.nextdog = fido; fido.dogname = "fido"; fido.dogbreed = "beagle"; fido.nextdog = roy; roy.dogname = "Roy"; roy.dogbreed = "Spaniel"; roy.nextdog = coco; coco.dogname = "Coco"; coco.dogbreed = "beagle"; coco.nextdog = null; }
public void walkoverthelist() { current = head; while (current != null) { Console.WriteLine(current.dogname); current = current.nextdog; } }
public string reverseprintPartyList() { string inviteList = "*--"; temporary = tail; while (temporary.prev_dog != null) { inviteList += temporary.dog_name + " * --- * "; temporary = temporary.prev_dog; } inviteList += temporary.dog_name + " * --- * "; return(inviteList); }
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); }