コード例 #1
0
        public Rotor(FixedMechanicRotor rot)
        {
            this.permutation = rot.Permutation.ToUpper().ToCharArray();
            this.knocker     = rot.Knocker;

            this.reverse = new char[26];
            for (int i = 0; i < permutation.Length; i++)
            {
                int revIndex = permutation[i] - 'A';
                reverse[revIndex] = (char)('A' + i);
            }
        }
コード例 #2
0
ファイル: Rotor.cs プロジェクト: hardyw/csharp-enigma
        public Rotor(FixedMechanicRotor rot)
        {
            this.permutation = rot.Permutation.ToUpper().ToCharArray();
            this.knocker = rot.Knocker;

            this.reverse = new char[26];
            for (int i = 0; i < permutation.Length; i++)
            {
                int revIndex = permutation[i] - 'A';
                reverse[revIndex] = (char)('A' + i);
            }
        }