예제 #1
0
        public static void Main(string[] args)
        {
            Potato potato = new Potato();
            potato.IsPilled = true;
            CookPotato(potato);

            if (CheckCellVisitable(60, 100, true))
            {
                VisitCell();
            }
            else
            {
                Console.WriteLine("Cell can't be  visited!");
            }
        }
예제 #2
0
 public static void CookPotato(Potato potato)
 {
     if (potato != null)
     {
         if (potato.IsPilled && !potato.IsRotten)
         {
             Cook(potato);
         }
         else
         {
             Console.WriteLine("Potato can't be  cooked!");
         }
     }
     else
     {
         Console.WriteLine("Potato is null!");
     }
 }
예제 #3
0
 public static void Cook(Potato potato)
 {
     Console.WriteLine("Potato has been cooked!");
 }