bmwinstead / enigma-project

Other
1 stars 1 forks source link

Enigma Machone Code: #22

Closed ikleyjl closed 11 years ago

ikleyjl commented 11 years ago

Test cases on the three-rotor Enigma designed to trigger all three rotors rotating at once fail. In the TestCasesWithExpectedResults document, the sample for this is the "aaaaamatthew" case, which starts with the rings in the position "AEA". "AEA" will always trigger a triple-rotor turn on the first keystroke. In RotorsTest.java, there is another test case included with the same starting position.The expected results for both of these test cases have been verified against three other Enigma simulators available online.

wadolph commented 11 years ago

The error seems to be related to the initial rotor setup (and maybe the stepping action). The expected output differs from actual even on the first character, when the only stepping should be the right rotor.

wadolph commented 11 years ago

EDIT: The middle and left rotor should step on the first character.

wadolph commented 11 years ago

Okay I got it fixed. There were logic errors in Rotor.java and Rotors.java. Also, reflectorChoices[] in RotorsTest.java was missing a 0. Recommend retest and close.

wadolph commented 11 years ago

I marked my changes with //Walter Adolph -

ikleyjl commented 11 years ago

Retested. Confirm fix.