static void Main(string[] args) { Console.WriteLine("Hello World!"); Buffet newBuffet = new Buffet(); newBuffet.Serve(); Ninja ninja1 = new Ninja(); while (!ninja1.isFull) { ninja1.Eat(newBuffet.Serve()); } ninja1.Eat(newBuffet.Serve()); }
static void Main(string[] args) { var firstNinja = new Ninja(); var firstBuffet = new Buffet(); // only eat while not true while (firstNinja.IsFull != true) { var food = firstBuffet.Serve(); // returns a random food item firstNinja.Eat(food); } firstNinja.Eat(firstBuffet.Serve()); // testing our console warning }
static void Main(string[] args) { //name of class var firstNinja = new Ninja(); var firstBuffet = new Buffet(); // var firstFoodHistory = new Ninja(); while(!firstNinja.isFull) { var food = firstBuffet.Serve(); firstNinja.Eat(food); } //the ninja is full firstNinja.Eat(firstBuffet.Serve()); }
static void Main(string[] args) { Buffet BuffetMari = new Buffet(); Ninja Sombat = new Ninja("Sombat"); while (!Sombat.isFull) { Sombat.Eat(BuffetMari.Serve()); } foreach (var Item in Sombat.Stomach) { Console.WriteLine($"{Item.Name} {Item.Calories}"); } Sombat.Eat(BuffetMari.Serve()); }
static void Main(string[] args) { //Console.WriteLine("Hello World!"); Buffet Yum = new Buffet(); Ninja Joe = new Ninja(); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); Joe.Eat(Yum.Serve()); }
static void Main(string[] args) { Food newFood = new Food("Pizza", 195, false, true); Console.WriteLine($"{newFood.Name} (Food). Calories: {newFood.Calories}. Spicy?: {newFood.IsSpicy}, Sweet?: {newFood.IsSweet}"); Buffet newBuffet = new Buffet(); Console.WriteLine(newBuffet.Serve().Name); Ninja newNinja = new Ninja(); while (!newNinja.IsFull()) { newNinja.Eat(newBuffet.Serve()); } }
static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.Red; Console.WriteLine("༼ ༽ RICE BUFFET ༼ ༽"); Console.WriteLine("you ate all my food ninja !!!"); Console.ResetColor(); Ninja client = new Ninja(); Buffet buffet = new Buffet(); while (!client.IsFull) { client.Eat(buffet.Serve()); } client.Eat(buffet.Serve()); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); List <Food> pantry = new List <Food>(); pantry.Add(new Food("Fried Rice", 70, false, false)); pantry.Add(new Food("Kun Pao Chicken", 35, true, true)); pantry.Add(new Food("Sesame balls", 120, false, true)); pantry.Add(new Food("Bobba smothy", 300, false, true)); Buffet brazilianBuffet = new Buffet(pantry); Ninja black = new Ninja(); do { black.Eat(brazilianBuffet.Serve()); } while (!black.IsFull); }
static void Main(string[] args) { Ninja bob = new Ninja(); Buffet buffet = new Buffet(); while (!bob.IsFull) { Food food = buffet.Serve(); bob.Eat(food); } Console.Write("The Ninja ate: "); foreach (Food foo in bob.FoodHistory) { Console.Write(foo.Name + ", "); } Console.WriteLine(); }
static void Main(string[] args) { Buffet country = new Buffet(); Ninja Richard = new Ninja(); Food meal1 = country.Serve(); Richard.Eat(meal1); Food meal2 = country.Serve(); Richard.Eat(meal2); Food meal3 = country.Serve(); Richard.Eat(meal3); Food meal4 = country.Serve(); Richard.Eat(meal4); }
static void Main(string[] args) { Buffet buffet = new Buffet(); buffet.Menu.Add(new Food("Pizza", 500, false, false)); buffet.Menu.Add(new Food("Ice Cream", 400, false, true)); buffet.Menu.Add(new Food("Cheeseburger", 550, false, false)); buffet.Menu.Add(new Food("Tacos", 400, true, false)); Ninja tom = new Ninja(); while (tom.IsFull != true) { tom.Eat(buffet.Serve()); } tom.Eat(buffet.Serve()); }
static void Main(string[] args) { // [x] In your Program's Main method, instantiate a Buffet and Ninja object, and have the Ninja eat until they are full! Buffet buffet = new Buffet(); // buffet.Serve(); Ninja ninja = new Ninja(); // only eat while ninja is not full while (!ninja.IsFull) { // ninja.Eat(buffet.Serve()); var food = buffet.Serve(); //returns a random food item ninja.Eat(food); } ninja.Eat(buffet.Serve()); // Console.WriteLine("ninja is full and cannot eat anymore!"); }
static void Main(string[] args) { Ninja Tyler = new Ninja("Tyler"); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); Tyler.Eat(); System.Console.WriteLine(Tyler.CalorieIntake); }
static void Main(string[] args) { // create a Ninja object below // this is now an object Ninja myNinja = new Ninja(); // buffet object must be createed in order to run Buffet myBuffet = new Buffet(); // calls a method within Buffet // Serve() returns a food object myBuffet.Serve(); // Ninja will eat and it will eat a random item that myBuffet.Serve returns (which is one random item) then when the Ninja exceeds 1200 calories, a string appears that says the Ninja is too full to eat. myNinja.Eat(myBuffet.Serve()); myNinja.Eat(myBuffet.Serve()); myNinja.Eat(myBuffet.Serve()); myNinja.Eat(myBuffet.Serve()); myNinja.Eat(myBuffet.Serve()); myNinja.Eat(myBuffet.Serve()); }
static void Main(string[] args) { Buffet MyBuffet = new Buffet(); Ninja MyNinjaOne = new Ninja(); Ninja MyNinjaTwo = new Ninja(); Console.WriteLine("Ninja One"); Console.WriteLine(MyNinjaOne.IsFull); MyNinjaOne.Eat(MyBuffet.Menu[4]); Console.WriteLine(MyNinjaOne.IsFull); Console.WriteLine("Ninja Two"); Console.WriteLine(MyNinjaTwo.IsFull); MyNinjaTwo.Eat(MyBuffet.Menu[5]); Console.WriteLine(MyNinjaTwo.IsFull); MyNinjaTwo.Eat(MyBuffet.Menu[6]); Console.WriteLine(MyNinjaTwo.IsFull); MyNinjaTwo.Eat(MyBuffet.Menu[2]); Console.WriteLine(MyNinjaTwo.IsFull); MyNinjaTwo.Eat(MyBuffet.Menu[2]); Console.WriteLine(MyNinjaTwo.IsFull); }