Example #1
0
 public ClosedIntervalView(string title, ClosedInterval closedInterval)
 {
     Debug.Assert(title != null);
     Debug.Assert(closedInterval != null);
     this.title          = title;
     this.closedInterval = closedInterval;
 }
Example #2
0
        public int Read(string title, int min, int max)
        {
            Debug.Assert(title != null);
            ClosedInterval     limits     = new ClosedInterval(min, max);
            ClosedIntervalView limitsView = new ClosedIntervalView(
                "El valor debe estar entre ", limits);
            int  value;
            bool ok;

            do
            {
                value = IO.Instance().ReadInt(title + " " + limitsView + ": ");
                ok    = limits.Includes(value);
                if (!ok)
                {
                    limitsView.Writeln();
                }
            } while (!ok);
            return(value);
        }