@@ -21,9 +21,11 @@ def render_enigma_xray(enigma):
2121
2222 rotor_walls_top = " " .join (["+-----+" ] * rotor_count )
2323
24- rotors_positions = " " .join (["{:02}" .format (enigma .rotors [i ].position ) for i in range (rotor_count - 1 , - 1 , - 1 )])
24+ rotors_positions = " " .join (["{} ({ :02}) " .format (enigma . alphabet_list [ enigma . rotors [ i ]. position ]. upper (), enigma .rotors [i ].position ) for i in range (rotor_count - 1 , - 1 , - 1 )])
2525
26- rotors_rings = " " .join (["{:02}" .format (enigma .rotors [i ].ring ) for i in range (rotor_count - 1 , - 1 , - 1 )])
26+ rotors_rings = " " .join (["{} ({:02})" .format (enigma .alphabet_list [enigma .rotors [i ].ring ].upper (),enigma .rotors [i ].ring ) for i in range (rotor_count - 1 , - 1 , - 1 )])
27+
28+ reflector_ring = ""
2729
2830 rotor_walls_position = " " .join (["| {} |" .format (enigma .alphabet_list [enigma .rotors [i ].position ].upper ()) for i in range (rotor_count - 1 , - 1 , - 1 )])
2931
@@ -46,15 +48,15 @@ def render_enigma_xray(enigma):
4648 | | { rotor_walls } | | | |
4749 | +--|--<--{ rotor_wiring_top } |-----|--<--|-----|----< { enigma .journal [- 1 ]['input_char' ] if len (enigma .journal ) >= 1 else ' ' } <-- Key
4850 | | { rotor_walls_forward } | { enigma .etw .journal [- 2 ]['output_char' ] if len (enigma .etw .journal ) >= 2 else ' ' } | | { enigma .plugboard .journal [- 2 ]['output_char' ] if len (enigma .plugboard .journal ) >= 2 else ' ' } | |
49- | | | { rotor_walls_position } | | | |
51+ | | | { rotor_walls } | | | |
5052 | | | { rotor_walls } | | | |
5153 | | | { enigma .reflector .journal [- 1 ]['output_char' ] if len (enigma .reflector .journal ) >= 1 else ' ' } | { rotor_walls_backward } | { enigma .etw .journal [- 1 ]['output_char' ] if len (enigma .etw .journal ) >= 2 else ' ' } | |
5254 | +--|-->--{ rotor_wiring_bottom } |-----|-->--|-----|----> { enigma .journal [- 1 ]['output_char' ] if len (enigma .journal ) >= 1 else ' ' } --> Lamp
5355 | | { rotor_walls } | | | |
5456 +-----+ { rotor_walls_bottom } +-----+ +-----+
5557
56- Pos.: { "{:02}" .format (enigma .reflector .position ) if isinstance (enigma .reflector , RotatingReflector ) else ' ' } { rotors_positions }
57- Ring: { rotors_rings }
58+ Pos.: { "{} ({ :02}) " .format (enigma .alphabet_list [ enigma . reflector .position ]. upper (), enigma . reflector . position ) if isinstance (enigma .reflector , RotatingReflector ) else ' N/A ' } { rotors_positions }
59+ Ring: { "{} ({:02})" . format ( enigma . alphabet_list [ enigma . reflector . ring ]. upper (), enigma . reflector . ring ) } { rotors_rings }
5860 """
5961 console .print (Text (diagram , style = "bold" ))
6062 return Text (diagram , style = "bold" )
0 commit comments