def shift_encode(plaintext, n, alphabet):
    """Encode text with a shift cipher that moves each letter up by n letters."""
    code = ''
    for char in plaintext:
        try:
            code += alphabet[(alphabet.index(char) + n) % len(alphabet)]
        except ValueError:
            pass
    return code