예제 #1
0
        public static void Main()
        {
            // first task
            Potato potato = new Potato();

            potato.IsPeeled = true;

            if (potato != null)
            {
                if (potato.IsPeeled && !potato.IsRed)
                {
                    Cook(potato);
                }
            }

            // second task
            int  x             = 3;
            int  y             = 5;
            bool isCellVisited = false;
            bool isInRangeX    = MinX <= x && x <= MaxX;
            bool isInRangeY    = MinY <= y && y <= MaxY;

            if (isInRangeX && isInRangeY && !isCellVisited)
            {
                VisitCell();
            }
        }
예제 #2
0
 private static void Cook(Potato potato)
 {
     Console.WriteLine("{0} is cooked.", potato.GetType().Name);
 }