


'''simple docstring'''







from __future__ import annotations

from string import ascii_letters





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_					,  lowerCAmelCase_ = None	):
    UpperCamelCase__      =			alphabet or ascii_letters

    # The final result string
    UpperCamelCase__      =			''''''

    for character in input_string:
        if character not in alpha:
            # Append without encryption if character is not in the alphabet
            result += character
        else:
            # Get the index of the new key and make sure it isn't too large
            UpperCamelCase__      =			(alpha.index(lowerCAmelCase_	) + key) % len(lowerCAmelCase_	)

            # Append the encoded character to the alphabet
            result += alpha[new_key]

    return result





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_					,  lowerCAmelCase_ = None	):
    key *= -1

    return encrypt(lowerCAmelCase_					,  lowerCAmelCase_					,  lowerCAmelCase_	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_ = None	):
    UpperCamelCase__      =			alphabet or ascii_letters

    # To store data on all the combinations
    UpperCamelCase__      =			{}

    # Cycle through each combination
    for key in range(1					,  len(lowerCAmelCase_	) + 1	):
        # Decrypt the message and store the result in the data
        UpperCamelCase__      =			decrypt(lowerCAmelCase_					,  lowerCAmelCase_					,  lowerCAmelCase_	)

    return brute_force_data


if __name__ == "__main__":
      while True:
            print(F'''\n{"-" * 10}\n Menu\n{"-" * 10}''')
            print(*['1.Encrypt', '2.Decrypt', '3.BruteForce', '4.Quit'], sep='\n')

            # get user input
            lowercase__     :  Optional[int]    					=			input('\nWhat would you like to do?: ').strip() or """4"""

            # run functions based on what the user chose
            if choice not in ("1", "2", "3", "4"):
                  print('Invalid choice, please enter a valid choice')
            elif choice == "1":
                  lowercase__     :  int    					=			input('Please enter the string to be encrypted: ')
                  lowercase__     :  List[str]    					=			int(input('Please enter off-set: ').strip())

                  print(encrypt(input_string, key))
            elif choice == "2":
                  lowercase__     :  Union[str, Any]    					=			input('Please enter the string to be decrypted: ')
                  lowercase__     :  str    					=			int(input('Please enter off-set: ').strip())

                  print(decrypt(input_string, key))
            elif choice == "3":
                  lowercase__     :  Optional[Any]    					=			input('Please enter the string to be decrypted: ')
                  lowercase__     :  str    					=			brute_force(input_string)

                  for key, value in brute_force_data.items():
                        print(F'''Key: {key} | Message: {value}''')

            elif choice == "4":
                  print('Goodbye.')
                  break









'''simple docstring'''







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
lowercase__     :  str    					=			9.8_0_6_6_5





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):

    # Ensure valid instance
    if not isinstance(lowerCAmelCase_					,  (int, float)	):
        raise TypeError("Invalid velocity. Should be a positive number."	)

    if not isinstance(lowerCAmelCase_					,  (int, float)	):
        raise TypeError("Invalid angle. Range is 1-90 degrees."	)

    # Ensure valid angle
    if angle > 90 or angle < 1:
        raise ValueError("Invalid angle. Range is 1-90 degrees."	)

    # Ensure valid velocity
    if init_velocity < 0:
        raise ValueError("Invalid velocity. Should be a positive number."	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(2 * angle	)
    return round(init_velocity**2 * sin(lowerCAmelCase_	) / g					,  2	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(lowerCAmelCase_	)
    return round(init_velocity**2 * sin(lowerCAmelCase_	) ** 2 / (2 * g)					,  2	)





def 						snake_case__ (lowerCAmelCase_					,  lowerCAmelCase_	):
    check_args(lowerCAmelCase_					,  lowerCAmelCase_	)
    UpperCamelCase__      =			angle_to_radians(lowerCAmelCase_	)
    return round(2 * init_velocity * sin(lowerCAmelCase_	) / g					,  2	)





def 						snake_case__ ():
    UpperCamelCase__    ,  UpperCamelCase__      =			25, 20
    assert horizontal_distance(lowerCAmelCase_					,  lowerCAmelCase_	) == 40.97
    assert max_height(lowerCAmelCase_					,  lowerCAmelCase_	) == 3.73
    assert total_time(lowerCAmelCase_					,  lowerCAmelCase_	) == 1.74


if __name__ == "__main__":
      from doctest import testmod

      testmod()

      # Get input from user
      lowercase__     :  Union[str, Any]    					=			float(input('Initial Velocity: ').strip())

      # Get input from user
      lowercase__     :  Any    					=			float(input('angle: ').strip())

      # Print results
      print()
      print('Results: ')
      print(F'''Horizontal Distance: {horizontal_distance(init_vel, angle)!s} [m]''')
      print(F'''Maximum Height: {max_height(init_vel, angle)!s} [m]''')
      print(F'''Total Time: {total_time(init_vel, angle)!s} [s]''')




