# YOUR NAME HERE
# HW 5

import string
# recall
# string.ascii_uppercase
# string.ascii_lowercase

# convert letter (a-z or A-Z) to morse code
# return empty string if not a single letter
# Note: morseCode[0] represents A or a, etc
#       ord("A") is 65
#       ord("a") is 97
# do not use Python's replace function
def morseLetter(letter):
    morseCode = [".-",  "-...", "-.-.", "-..", ".",             # A-E
                 "..-.", "--.", "....", "..",  ".---",          # F-J
                 "-.-", ".-..", "--", "-.", "---",              # K-O
                 ".--.", "--.-", ".-.", "...", "-",             # P-T
                 "..-", "...-", ".--", "-..-", "-.--", "--.."]  # U-Z
    return None


# convert a word to morse code
# ignore any non-letters
# separate each morse coded letter with a space
# use your morseLetter() function
# no leading or trailing spaces
def morseWord(word):
    return None


# convert text to morse code
# ignore any non-letters
# separate each morse coded word with a space
# use your morseWord() function
# no leading or trailing spaces
def morseText(text):
    return None


def main():
    print("string constants:")
    print(string.ascii_uppercase)
    print(string.ascii_lowercase)
    print()
    
    print("morseLetter")
    print(morseLetter("a"), " should be .-")
    print(morseLetter("M"), " should be --")
    print(morseLetter("Z"), " should be --..")
    print(morseLetter("."), "should return the empty string", sep="")
    print(morseLetter("albion"), "should return the empty string", sep="")
    # Add aditional test cases as needed here
    print()
    
    print("morseWord")
    print(morseWord("SOS"), " should be ... --- ...")
    # Listen to YYZ by Rush https://www.youtube.com/watch?v=XCCN5umy9lU
    print(morseWord("YYZ"), " should be -.-- -.-- --..")
    print(morseWord("computer"), " should be -.-. --- -- .--. ..- - . .-.")
    # Add aditional test cases as needed here
    print()
    
    print("morseText")
    text = "Computer Science"
    print(text)
    print("-.-. --- -- .--. ..- - . .-./... -.-. .. . -. -.-. .")
    print(morseText(text)) # Your output
    
    text = "Samuel F. B. Morse"
    print(text)
    print("... .- -- ..- . .-../..-./-.../-- --- .-. ... .")
    print(morseText(text)) # Your output

    text = "Madam, I'm Adam."
    print(text)
    print("-.-. --- -- .--. ..- - . .-./... -.-. .. . -. -.-. .")
    print(morseText(text)) # Your output
    
    text = "Pack my box with five dozen liquor jugs."
    print(text)
    print(".--. .- -.-. -.-/-- -.--/-... --- -..-/.-- .. - ..../..-. .. ...- ./"
          +"-.. --- --.. . -./.-.. .. --.- ..- --- .-./.--- ..- --. ...")
    print(morseText(text)) # Your output
    
    text = "YOUR NAME HERE" # Replace with your name
    print(text)
    print(morseText(text)) # Your output
    print()
    
    # Add aditional morseText() test cases as needed here

    
main()
        
    
