示例#1
0
文件: lion.cs 项目: m17guy/homework
 public void eat(cow a)
 {
     if (isAlive)
     {
         Console.WriteLine(name + " the lion is eating " + a.name + " the cow");
         a.die();
     }
     else
     {
         Console.WriteLine(name + " the lion is not alive");
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            mouse a     = new mouse();
            cat   mit   = new cat();
            cow   acow  = new cow();
            lion  alion = new lion();

            mit.name = "mitzy";
            //Console.WriteLine(a.name);
            mit.drinkmilk("Piss");
            mit.drinkmilk(acow.givemilk());
            alion.eat(acow);
            alion.makenoise();
            mit.drinkmilk(acow.givemilk());
            Console.ReadKey();
        }