Example #1
0
        public Turing(SettingsTuringDefault settings) : this(settings.countState, settings.Alphabet)
        {
            if (settings is null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            int maxValueTape = settings.maxValueTape;
            int minValueTape = settings.minValueTape;

            if (maxValueTape < minValueTape)
            {
                var T = maxValueTape;
                maxValueTape = minValueTape;
                minValueTape = T;
            }
            if (maxValueTape < 0)
            {
                maxValueTape = Math.Abs(minValueTape);
            }
            Tape = new Tape(minValueTape, maxValueTape);

            CurrentTapePoint = settings.startPosition;
            StartPosition    = CurrentTapePoint;

            this.Milliseconds = settings.milliseconds;
            if (!(settings.wordDefault is null))
            {
                SetWordDefault(settings.wordDefault);
            }
        }
Example #2
0
 public Turing(SettingsTuringDefault settings, TableCommand table) : this(settings)
 {
     TableCommand = table ?? throw new ArgumentNullException(nameof(table));
 }