Enigma/primer
From Teknologisk videncenter
The Wheels
The Wheels can be installed in the Enigma in any sequence. If there are five different Wheels in total and the Enigma uses three Wheels. The total number of Wheel combinatins would be <math>5*4*3=60</math>
The software enigma
In the software Enigma you would need some random Wheels and a Random Rotor Reftlector. For examle this three bit Enigma.
/* Input/output 0, 1, 2, 3, 4, 5, 6, 7 */
byte wheel[2][8] = {
/* Wheel 1 */ { 2, 7, 1, 5, 6, 3, 0, 4},
/* Wheel 2 */ { 5, 0, 7, 2, 1, 6, 4, 3} };
/* Notch array for wheels*/
byte wheel_notch[2] = { 3, 6 };
byte rwheel[2][8] = {
/* Reverse wheel 1 */ { 6, 2, 0, 5, 7, 3, 4, 1},
/* Reverse wheel 2 */ { 1, 4, 3, 7, 6, 0, 5, 2} };
/* Rotor reflector*/
byte rr[8] = { 7, 4, 6, 5, 1, 3, 2, 0};