Exemplo n.º 1
0
        public virtual int LeftInput(int val)
        {
            if (val < 0)
            {
                throw new ArgumentException("Value cannot be lower than zero", nameof(val));
            }
            if (val > 25)
            {
                throw new ArgumentException("Value cannot be higher than 25", nameof(val));
            }

            val = RotorBase.Advance(val, this.Position);

            int result = Array.IndexOf <int>(this.mapping, val);

            result = RotorBase.Recede(result, this.Position);

            return(result);
        }
Exemplo n.º 2
0
        public override int LeftInput(int val)
        {
            if (val < 0)
            {
                throw new ArgumentException("Value cannot be lower than zero", nameof(val));
            }
            if (val > 25)
            {
                throw new ArgumentException("Value cannot be higher than 25", nameof(val));
            }

            val = RotorBase.Recede(val, this.Offset);

            int temp = base.LeftInput(val);

            temp = RotorBase.Advance(temp, this.Offset);

            return(temp);
        }
Exemplo n.º 3
0
        public override int RightInput(int val)
        {
            if (val < 0)
            {
                throw new ArgumentException("Value cannot be lower than zero", nameof(val));
            }
            if (val > 25)
            {
                throw new ArgumentException("Value cannot be higher than 25", nameof(val));
            }

            val = RotorBase.Advance(val, this.Position);

            int result = base.RightInput(val);

            result = RotorBase.Recede(result, this.Position);

            return(result);
        }