"""
CSCI 145 Homework 2 - Secret Messages

Author: YOUR NAME

Resources:
    What resources helped you with this assignment? (office hours,
    drop-in sessions, peers, internet search, AI tools, etc.)
"""

ALPHABET = "abcdefghijklmnopqrstuvwxyz "
REPEAT = 3


def fools_encrypt(message):
    """
    Encrypt a message by repeating each character REPEAT times.

    Parameters:
        message (str): the message to encrypt

    Returns:
        str: the encrypted message

    Example:
        >>> fools_encrypt("hi there")
        'hhhiii   ttthhheeerrreee'
    """
    # YOUR CODE HERE



def fools_decrypt(secret):
    """
    Decrypt a message encrypted with fools_encrypt by keeping every
    REPEAT-th character, starting with the first.

    Parameters:
        secret (str): a message encrypted with fools_encrypt

    Returns:
        str: the original message

    Example:
        >>> fools_decrypt("hhhiii   ttthhheeerrreee")
        'hi there'
    """
    # YOUR CODE HERE



def shift_letter(letter, num):
    """
    Shift a letter num places in ALPHABET, wrapping around at the end.

    Parameters:
        letter (str): a single character in ALPHABET
        num (int): number of places to shift (negative shifts backward)

    Returns:
        str: the character num places after letter in ALPHABET

    Example:
        >>> shift_letter("a", 2)
        'c'
        >>> shift_letter("z", 2)
        'a'
    """
    index = ALPHABET.find(letter)
    return ALPHABET[(index + num) % len(ALPHABET)]


def caesar_encrypt(message, shift):
    """
    Encrypt a message with a Caesar cipher. If a character is in
    ALPHABET, it is shifted by shift places. Otherwise, it is left
    unchanged.

    Parameters:
        message (str): the message to encrypt
        shift (int): number of places to shift each character

    Returns:
        str: the encrypted message

    Example:
        >>> caesar_encrypt("hello world", 3)
        'khoorczruog'
        >>> caesar_encrypt("Hi, there!", 1)
        'Hj,auifsf!'
    """
    # YOUR CODE HERE



def is_secret_safe(message):
    """
    Check whether caesar_encrypt will hide every character of a message.
    If every character is in ALPHABET (a lowercase letter or a space),
    returns True. Otherwise, returns False.

    Parameters:
        message (str): the message to check

    Returns:
        bool: True if every character of message is in ALPHABET,
            False otherwise

    Example:
        >>> is_secret_safe("meet me at noon")
        True
        >>> is_secret_safe("Meet me at noon!")
        False
    """
    # YOUR CODE HERE
