-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_continuous.py
43 lines (39 loc) · 1.29 KB
/
run_continuous.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from bombe_2 import Bombe
def run(
ROTORS,
REFLECTORS,
starting_letters,
input_letter,
settings,
connections,
plain_crib,
cipher_crib):
i = 0
rotor_combos = [(x, y, z)
for x in ROTORS for y in ROTORS for z in ROTORS if x != y if y != z if x != z]
for top_rotor, middle_rotor, bottom_rotor in rotor_combos:
for reflector in REFLECTORS:
i += 1
print(f'Settings {i}/180')
print('******************BOMBE******************')
print('Running the Bombe with the following settings:')
print('Rotors:', top_rotor, middle_rotor, bottom_rotor)
print('Reflector:', reflector)
print('Starting Letters:', starting_letters)
print('Input Letter:', input_letter)
print('*****************************************')
print()
b = Bombe(
top_rotor,
middle_rotor,
bottom_rotor,
starting_letters,
reflector,
settings,
connections,
input_letter,
True,
False
)
print('RUNNING...')
b.auto_run(plain_crib, cipher_crib)