static void Main(string[] args) { VirtualPet elsie = new VirtualPet("Elsie", 1, "Grey"); string selection; Console.WriteLine("Congratulations on your new pet elephant! You've decided to name her Elsie."); ElsieArt(); Console.WriteLine(elsie.Stats()); Console.WriteLine("\n"); Pause(); do { Console.WriteLine("What would you like to do with Elsie?"); Menu(); selection = Console.ReadLine().Trim(); if (selection == "1") { elsie.Eat(); Pause(); } else if (selection == "2") { elsie.Drink(); Pause(); } else if (selection == "3") { elsie.Play(); Pause(); } else if (selection == "4") { elsie.Sleep(); Pause(); } else if (selection == "5") { Console.WriteLine("Elsie looks sad and goes to play by herself."); Pause(); } else { if (selection != "6") { Console.WriteLine("Please choose something to do with Elsie!"); } } }while (selection != "6"); { Console.WriteLine("Thanks for playing!"); Environment.Exit(0); } }
static void Main(string[] args) { string name; int userInput; // calling from class VirtualPet newPet = new VirtualPet(); Console.WriteLine("Welcome to Mouseimon!\n\nYou will be tasked with keeping your precious mouse alive.\n\n"); Console.WriteLine("Please enter your pet mouses name \n"); { name = Console.ReadLine(); } // while loop for mouse to determine if they are getting enough of the fields while (true) { Console.WriteLine(name + " the mouse"); Console.WriteLine(" current hunger level " + newPet.Hunger); Console.WriteLine(" current thirst level " + newPet.Thirst); Console.WriteLine(" current health level " + newPet.Sickness); Console.WriteLine(" current boredom level " + newPet.Boredom); Console.WriteLine("What do you want to do?"); Console.WriteLine("\n 1.Feed \n 2.Water \n 3.Rest\n 4.Play "); userInput = int.Parse(Console.ReadLine()); if (userInput == 1) { newPet.Food(); } else if (userInput == 2) { newPet.Drink(); } else if (userInput == 3) { newPet.Cold(); } else if (userInput == 4) { newPet.Crazy(); } else { Console.WriteLine(" Please choose one of the above"); userInput = int.Parse(Console.ReadLine()); } if (newPet.Hunger < 0) { Console.WriteLine(" Your mouse was over fed"); break; } else if (newPet.Hunger > 10) { Console.WriteLine(" Your mouse died of starvation"); break; } else if (newPet.Thirst < 0) { Console.WriteLine(" How could you give him so much water!!!"); break; } else if (newPet.Thirst > 10) { Console.WriteLine("Your mouse ran out of liquids "); break; } else if (newPet.Sickness < 0) { Console.WriteLine("Couldn't keep your mouse alive! That's a real shame "); break; } else if (newPet.Sickness > 10) { Console.WriteLine("You have died of sickness "); break; } else if (newPet.Boredom < 0) { Console.WriteLine(" Too much socialization is never good"); break; } else if (newPet.Boredom > 10) { Console.WriteLine("Dang! Poor little guy had no friends "); break; } } Console.ReadLine(); }
static void Main(string[] args) { VirtualPet vPet = new VirtualPet(); string input = ""; Console.WriteLine("Pet Rock Simulator 2018"); Console.WriteLine(); Console.WriteLine("Your Pet Rock is named Jeffrey. You love him very much."); Console.ReadLine(); Console.WriteLine(); vPet.Hunger = 0; vPet.Thirst = 0; vPet.Waste = 0; vPet.Boredom = 0; vPet.Tired = 0; vPet.Anger = 0; while (input != "exit") { Console.WriteLine("JEFFREY"); Console.WriteLine("Hunger: " + vPet.Hunger); Console.WriteLine("Thirst: " + vPet.Thirst); Console.WriteLine("Waste: " + vPet.Waste); Console.WriteLine("Boredom: " + vPet.Boredom); Console.WriteLine("Exhaustion: " + vPet.Tired); Console.WriteLine(); Console.WriteLine("Enter the number of what you would like to do."); Console.WriteLine("1. Play With Your Pet Rock"); Console.WriteLine("2. Walk Your Pet Rock"); Console.WriteLine("3. Feed Your Pet Rock"); Console.WriteLine("4. Give Your Pet Rock Water"); Console.WriteLine("5. Have Your Pet Rock Take a Nap"); Console.WriteLine("Or type exit to close program."); input = Console.ReadLine().ToLower(); Console.WriteLine(); if (input == "exit") { return; } else if (input == "1") { Console.WriteLine("You challenge your Pet Rock to a rousing game of Backgammon."); Console.ReadLine(); vPet.Play(); } else if (input == "2") { Console.WriteLine("You put a leash on your Pet Rock and take to the streets, where it can do its disgusting business."); Console.ReadLine(); vPet.Walk(); } else if (input == "3") { Console.WriteLine("You give your Pet Rock a bowl a gravel to eat and mull the ethical ramifications."); Console.ReadLine(); vPet.Feed(); } else if (input == "4") { Console.WriteLine("You drop your Pet Rock into some water and soon the water is gone. You ask no questions."); Console.ReadLine(); vPet.Drink(); } else if (input == "5") { Console.WriteLine("You assume your Pet Rock is sleeping, but it's impossible to tell for sure."); Console.ReadLine(); vPet.Sleep(); } else { Console.WriteLine("You stare at your Pet Rock and think about your life choices."); Console.ReadLine(); } vPet.Tick(); } }
static void Main(string[] args) { bool caredFor = true; Console.WriteLine("What is your pet's name?"); VirtualPet dog = new VirtualPet(Console.ReadLine()); Console.WriteLine(); while (caredFor == true) { //display pet's current status Console.WriteLine("{0} the dog", dog.Name); Console.WriteLine("Hunger: {0}", dog.Hunger); Console.WriteLine("Thirst: {0}", dog.Thirst); Console.WriteLine("Exercise: {0}", dog.Exercise); Console.WriteLine("Affection: {0}", dog.Affection); Console.WriteLine(); //displays options to interact with pet Console.WriteLine("What would you like to do?"); Console.WriteLine("1. Feed {0}", dog.Name); Console.WriteLine("2. Water {0}", dog.Name); Console.WriteLine("3. Walk {0}", dog.Name); Console.WriteLine("4. Cuddle with {0}", dog.Name); Console.WriteLine("5. Abandon {0}", dog.Name); Console.WriteLine(); //takes in user's selection int input = int.Parse(Console.ReadLine()); dog.Tick(); //user's selection triggers an action switch (input) { case (1): dog.Feed(); break; case (2): dog.Drink(); break; case (3): dog.Walk(); break; case (4): dog.Cuddle(); break; case (5): caredFor = false; Console.WriteLine("{0} is better without you anyway.", dog.Name); break; default: break; } if (dog.Hunger <= 0 || dog.Thirst <= 0 || dog.Affection <= 0 || dog.Exercise <= 0) { caredFor = false; Console.WriteLine("{0} felt neglected and ran away to find a better home.", dog.Name); } } }
static void Main(string[] args) { VirtualPet porkchop = new VirtualPet("Porkchop the Dog", 5, 30, 25, 15, 10, 0); Console.WriteLine(@" _ _"); Console.WriteLine(@"/(. .)\ )"); Console.WriteLine(@" (*)____/|"); Console.WriteLine(@" / |"); Console.WriteLine(@" / |--\ |"); Console.WriteLine(@"(_)(_) (_)"); Console.WriteLine(porkchop.Name); Console.WriteLine(); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); Console.WriteLine("\nWhat do you want Porkchop to do?\n"); Console.WriteLine("1. Eat"); Console.WriteLine("2. Drink"); Console.WriteLine("3. Take Nap"); Console.WriteLine("4. Go Potty"); Console.WriteLine("5. Play"); Console.WriteLine("6. See Doctor"); Console.WriteLine("7. Do Nothing\n"); Console.Write("> "); int response = int.Parse(Console.ReadLine()); while (response != 7) { if (response <= 0 || response >= 8) { Console.WriteLine("\nPlease choose a valid menu option 1 through 7."); } switch (response) { case 1: porkchop.Eat(); porkchop.Tick(); Console.WriteLine("\nPorkchop ate food.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; case 2: porkchop.Drink(); porkchop.Tick(); Console.WriteLine("\nPorkchop drank water.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; case 3: porkchop.TakeNap(); porkchop.Tick(); Console.WriteLine("\nPorkchop took a nap.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; case 4: porkchop.GoPotty(); porkchop.Tick(); Console.WriteLine("\nPorkchop went potty.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; case 5: porkchop.Play(); porkchop.Tick(); Console.WriteLine("\nPorkchop played fetch.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; case 6: porkchop.SeeDoctor(); porkchop.Tick(); Console.WriteLine("\nPorkchop went to the doctor.\n"); Console.WriteLine("Hunger: {0}", porkchop.Hunger); Console.WriteLine("Thirst: {0}", porkchop.Thirst); Console.WriteLine("Sleep: {0}", porkchop.Sleep); Console.WriteLine("Potty: {0}", porkchop.Potty); Console.WriteLine("Boredom: {0}", porkchop.Boredom); Console.WriteLine("Sickness: {0}", porkchop.Sickness); break; } // end switch case Console.WriteLine("\nWhat do you want Porkchop to do?\n"); Console.WriteLine("1. Eat"); Console.WriteLine("2. Drink"); Console.WriteLine("3. Take Nap"); Console.WriteLine("4. Go Potty"); Console.WriteLine("5. Play"); Console.WriteLine("6. See Doctor"); Console.WriteLine("7. Do Nothing\n"); Console.Write("> "); response = int.Parse(Console.ReadLine()); } // end while loop if (response == 7) { Console.WriteLine("Please come back and check on Porkchop again soon!"); } } // end Main method
static void Main(string[] args) { string food = string.Empty; string water = string.Empty; string play = string.Empty; VirtualPet Godzooky = new VirtualPet(); Console.WriteLine("Welcome to Michael's VirtualPet Project"); Console.WriteLine(" Hi, I'm Godzilla's kid, {0} ", Godzooky.name, "lets have fun"); //public static int TickCount { int result = Environment.TickCount & Int32.MaxValue; Console.WriteLine("TickCount: {0}", result); } Console.WriteLine(" choose 0 Pet Option, it will pause the Virtual Pet "); Console.WriteLine(" choose 1 Pet Option, it will feed {0} ", Godzooky.Name); Console.WriteLine(" choose 2 Pet Option, it will give {0} some water", Godzooky.Name); Console.WriteLine(" choose 3 Pet Option,{0} will talk to you", Godzooky.Name); Console.WriteLine(" choose 4 Pet Option, you can play with {0} ", Godzooky.Name); Console.WriteLine(" choose 5 Pet Option, you can quit the program "); Console.WriteLine(" TYPE your Pet Option as a number 0, 1, 2, 3, 4 or, 5 "); int petOptions = int.Parse(Console.ReadLine()); switch (petOptions) { case 0: Console.WriteLine("OK, I'm gonna take a nap "); Thread.Sleep(0); break; case 1: Console.WriteLine("You fed {0} ", Godzooky.Name); Godzooky.Eat(food); break; case 2: Console.WriteLine(Godzooky.Name, "{0} drank some water "); Godzooky.Drink(water); break; case 3: Console.WriteLine(Godzooky.Name, " {0}spoke "); Godzooky.Speak(); break; case 4: Console.WriteLine(" You played with {0} ", Godzooky.Name); Godzooky.Boredom(play); break; case 5: Console.WriteLine(" You're gonna miss out on a lot of fun, goodbye "); Environment.Exit(0); break; default: Console.WriteLine(" Invalid selection "); Console.WriteLine(" Please choose Pet Option 0, 1, 2, 3, 4, or, 5 "); break; } }