MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / rotator

Function rotator

hashes/enigma_machine.py:10–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def rotator():
11 global gear_one_pos
12 global gear_two_pos
13 global gear_three_pos
14 i = gear_one[0]
15 gear_one.append(i)
16 del gear_one[0]
17 gear_one_pos += 1
18 if gear_one_pos % len(alphabets) == 0:
19 i = gear_two[0]
20 gear_two.append(i)
21 del gear_two[0]
22 gear_two_pos += 1
23 if gear_two_pos % len(alphabets) == 0:
24 i = gear_three[0]
25 gear_three.append(i)
26 del gear_three[0]
27 gear_three_pos += 1
28
29
30def engine(input_character):

Callers 2

engineFunction · 0.85
enigma_machine.pyFile · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected