text:
Visualizing Words
Given a word consisting of lowercase letters only, do the following:

For each letter, get the prime factorization of its position in the alphabet.
For each prime factor, p, draw a diamond of side length p and stick the letter in the middle of the diamond.
The biggest diamond is in the middle, subsequent smaller diamonds (from biggest to smallest) alternate between going to the bottom or top.

Note: For the letter a use a side-length of 1.
Example: cat

c: 3 = 3
a: 1 = 1
t: 20 = 5*2*2

The diagram:
                 .
                . .
               . t .
                . .
                 .
                 .
                . .
   .           .   .
  . .         .     .
 .   .   .   .       .
.  c  . .a. .    t    .
 .   .   .   .       .
  . .         .     .
   .           .   .
                . .
                 .
                 .
                . .
               . t .
                . .
                 .

Example: dog

d: 4 = 2*2
o: 15 = 5*3
g: 7 = 7

Diagram:
                         .
                        . .
           .           .   .
          . .         .     .
         .   .       .       .
  .     .     .     .         .
 . .   .       .   .           .
. d . .    o    . .      g      .
 . .   .       .   .           .
  .     .     .     .         .
  .      .   .       .       .
 . .      . .         .     .
. d .      .           .   .
 . .       .            . .
  .       . .            .
         .   .
        .  o  .
         .   .
          . .
           .

-20% bonus if your program outputs to a text file called "[your-word].txt". Then input a real word (or phrase, made lowercase with no spaces) that is at least 20 letters long and no one else has chosen yet, and paste the output between a <pre> and a </pre> in your answer.

Your examples seem to use diamonds of size p+1 dots...

@Jaykul Good question. The side length is determined by the number of spaces between the dots.

Matlab, 466 393 - 20% = 314.4 bytes
Golfed: (Could save some more bytes, also because of @AndreasDeak's help!)
function q(W);function z=g(l,c);[x,y]=ndgrid(abs(-l:l));z=0*y;z(~x&~y)=c;z(x+y==l)=46;end;w=W-96;n=numel(w);R=n*26;C=1;A=zeros(2*R);for k=1:n;f=sort(factor(w(k)));C=C+max(f)+1;d=-1;r=R;for F=fliplr(f);v=-F:F;while norm(A(r+v,v+C));r=r+d;end;A(r+v,v+C)=g(F,W(k));d=-d;end;C=C+max(f);end;A=A(find(sum(A,2)),find(sum(A)));f=fopen([W,'.txt'],'w');for k=1:size(A,1);fprintf(f,[A(k,:),'\n']);end;end

It should work in Octave (opensource) too, but only with a lot of warnings. Use this version if you want to try it in octave (output to console, instead of file):
function q(W);function z=g(l,c);[x,y]=ndgrid(abs(-l:l));z=0*y;z(~x&~y)=c;z(x+y==l)=46;end;w=W-96;n=numel(w);R=n*26;C=1;A=zeros(2*R);for k=1:n;f=sort(factor(w(k)));C=C+max(f)+1;d=-1;r=R;for F=fliplr(f);v=-F:F;while norm(A(r+v,v+C));r=r+d;end;A(r+v,v+C)=g(F,W(k));d=-d;end;C=C+max(f);end;A=A(find(sum(A,2)),find(sum(A)));disp([A,'']);end

Ungolfed and explained:
function q(W)
function z=g(l,c) %get a square matrix for one prime factor
[x,y]=ndgrid(abs(-l:l));
z=0*y;
z(~x&~y)=c;    %character in the middle
z(x+y==l)=46;  %dots
end;
w=W-96;                %convert word to the corresponding indices
n=numel(w);
R=n*26;                %keeps track of the main row
C=1;                   %keeps track of the current column
A=zeros(2*R);          %make a 'canvas' matrix that is way to big
for k=1:n;
    f=sort(factor(w(k)));          %get all the factors of current character
    C=C+max(f)+1;                  %update current column
    d=-1;                          %search direction
    r=R;
    for F=fliplr(f);
        v=-F:F;
        while norm(A(r+v,v+C));    %go up or down until there is enough space to write the prime factor
            r=r+d;
        end;
        A(r+v,v+C)=g(F,W(k));     %insert all the prime factors
        d=-d;
    end;
    C=C+max(f);
end;
A=A(find(sum(A,2)),find(sum(A))); %truncate all the unneccessary padding
f=fopen([W,'.txt'],'w');     %write to file
for k=1:size(A,1);
    fprintf(f,[A(k,:),'\n']);
end;

end

The requested word: (And here as a file: (zoom out a lot): supercalifragilisticexpialidocious.txt)

                       .                                                                                .                                                                                .
                      . .                                                                                . .                                                                                . .
                     .   .                                                                                .   .                                                                                .   .
                    .     .                                                                                .     .                                                                                .     .
                   .       .                                                                                .       .                                                                                .       .
                  .         .                                                                                .         .                                                                                .         .
                 .           .                                                                                .           .                                                                                .           .
                .             .                                                                                .             .                                                                                .             .
               .               .                                                                                .               .                                                                                .               .
              .                 .                                                                                .                 .               .                                                                                .                 .
             .                   .                                                                                .                   .             . .                                                                                .                   .
            .                     .                                          .                .                    .                               .                  .                     .           . t .                               .                     .                                                                          .                     .
           .                       .              .         .               . .              . .                  . .            .                . .                .                       .           . .                               . .    .              . .                                                         .              .                       .
          .                         .            . .       . .             . r .            . l .                . r .          . .              . l .              .                         .           .                               . x .  . .            . l .                                                       . .            .                         .
         .                           .          .   .     . p .     .       . .              . .                  . .          .   .              . .              .                           .          .                        .       . .  . p .            . .                   .                        .          .   .          .                           .
        .                             .        .     .     . .     . .       .                .                    .          .     .              .              .                             .        . .                      . .       .    . .              .                   . .                      . .        .     .        .                             .
       .                               .      .       .     .     .   .      .      .         .      .      .      .         .       .      .      .      .      .                               .      .   .      .      .      .   .      .     .     .         .      .           .   .      .      .      .   .      .       .      .                               .
      .                                 .    .         .    .    .     .    . .    . .       . .    . .    . .    . .       .         .    . .    . .    . .    .                                 .    .     .    . .    . .    .     .    . .    .    . .       . .    . .    .    .     .    . .    . .    .     .    .         .    .                                 .
     .                                   .  .           .  . .  .       .  .   .  .   .  .  .   .  .   .  .   .  .   .  .  .           .  .   .  .   .  .   .  .                                   .  .       .  .   .  .   .  .       .  .   .  . .  .   .  .  .   .  .   .  . .  .       .  .   .  .   .  .       .  .           .  .                                   .
    .                  s                  ..      u      .. p ..    e    ..  r  ..  c  ..a..  l  ..  i  ..  f  ..  r  ..a..      g      ..  i  ..  l  ..  i  ..                  s                  ..    t    ..  i  ..  c  ..    e    ..  x  .. p ..  i  ..a..  l  ..  i  .. d ..    o    ..  c  ..  i  ..    o    ..      u      ..                  s                  .
     .                                   .  .           .  . .  .       .  .   .  .   .  .  .   .  .   .  .   .  .   .  .  .           .  .   .  .   .  .   .  .                                   .  .       .  .   .  .   .  .       .  .   .  . .  .   .  .  .   .  .   .  . .  .       .  .   .  .   .  .       .  .           .  .                                   .
      .                                 .    .         .    .    .     .    . .    . .       . .    . .    . .    . .       .         .    . .    . .    . .    .                                 .    .     .    . .    . .    .     .    . .    .    . .       . .    . .    .    .     .    . .    . .    .     .    .         .    .                                 .
       .                               .      .       .     .     .   .      .      .         .      .      .      .         .       .      .      .      .      .                               .      .   .      .      .      .   .      .     .     .         .      .     .     .   .      .      .      .   .      .       .      .                               .
        .                             .        .     .     . .     . .       .                .      .      .      .          .     .       .      .      .       .                             .        . .       .              . .       .    . .    .         .      .    . .     . .              .       . .        .     .        .                             .
         .                           .          .   .     . p .     .       . .              . .    . .    . .    . .          .   .       . .    . .    . .       .                           .          .       . .              .       . .  . p .  . .       . .    . .  . d .     .              . .       .          .   .          .                           .
          .                         .            . .       . .             .   .            . l .  .   .  . f .  .   .          . .       .   .  . l .  .   .       .                         .           .      .   .                    . x .  . .  .   .     . l .  .   .  . .      .             .   .      .           . .            .                         .
           .                       .              .         .             .  r  .            . .  .  i  .  . .  .  r  .          .       .  i  .  . .  .  i  .       .                       .           . .    .  i  .                    . .    .  .  i  .     . .  .  i  .  .      . .           .  i  .    . .           .              .                       .
            .                     .               .         .              .   .              .    .   .    .    .   .                    .   .    .    .   .         .                     .           . t .    .   .                      .     .   .   .       .    .   .         .   .           .   .    .   .          .               .                     .
             .                   .               . .       . .              . .                     . .           . .                      . .           . .           .                   .             . .      . .                       .    . .   . .              . .         .  o  .           . .    .  o  .        . .               .                   .
              .                 .               .   .     . p .              .                       .             .                        .             .             .                 .               .        .                       . .  . p .   .                .           .   .             .      .   .        .   .               .                 .
               .               .               .  u  .     . .                                                                                .               .                                                . x .  . .                                  . .                      . .        .  u  .               .               .
                .             .                 .   .       .                                                                                .             .                                                  . .    .                                    .                        .          .   .                 .             .
                 .           .                   . .                                                                                .           .                                                    .                                                                               . .                   .           .
                  .         .                     .                                                                                .         .                                                                                .                     .         .
                   .       .                                                                                .       .                                                                                .       .
                    .     .                                                                                .     .                                                                                .     .
                     .   .                                                                                .   .                                                                                .   .
                      . .                                                                                . .                                                                                . .
                       .                                                                                .                                                                                .

Wouldn't A=A(find(sum(A,2)),find(sum(A))); suffice for removing the padding in one step?

I actually got perfect results when I pasted the output text between two <pre> tags. Why don't you try that!

Are you sure you need sort(factor())? MATLAB's factor seems to be sorted already. And you might define a variable for max(f), since you seem to be using that same quantity twice.

Also, since 2013b there's flip in matlab, which seems to do fliplr for row vectors.

Ooh, I found a little glitch. For letters like r, you put the 2nd biggest diamond on top and the third biggest on the bottom. Should be opposite.

You did not specify what comes first, but the newest version fixed it anyway.

@geokavel Thanks for the bounty=)

@flawr You're welcome :) But now I know I should have waited longer, so my question would still have the blue label.

Got the Octave version working online successfully here. If you get the change could you make the Octave version also follow the order rule?

I updated it, and it does run nicely in Octave (I do not know how to write to files in Octave, but now it does just print to the console), but the online interpreters are sometimes a bit a pain, as you usually need separate files for each function, and this particular interpreter does not seem to be able to cope with nested functions. I recommend getting the real thing: http://www.gnu.org/software/octave/download.html

For some reason the new version doesn't work properly on the online interpreter. Also, how is it that MATLAB can sell something that is so similar to something that is open source?

@geokavel I believe you're looking at it the other way around:) From the bible: MATLAB -> "Initial release - 1984", GNU Octave -> Initial release - 1988". How is it that Mathworks allow their commercial product to be copied up to such minor details? Or if you just meant why it's still profitable: I'm sure the available MATLAB toolboxes and features well overwhelm Octave (although the syntax of Octave is sometimes richer!). Not to mention speed (I think).

@geokavel It is as AndrasDeak said: Octave is a clone of Matlab, but unfortunately not a perfect one, as the developers also tried to improve the language. Here a slightly modified version that also works in the online interpreter: http://goo.gl/Jk7mpV

@flawr Much appreciated.

Funciton, non-competitive, 29199 bytes
I enjoyed this challenge because it highlighted the sore lack of some very useful library functions. I will include all of those functions here (and in the byte count) because I wrote them after this challenge was posted.
Full source in a single file
Explanation
As always, get a better rendering by executing javascript:(function(){$('pre,code').css({lineHeight:5/4});})() in your browser console.
① ɹ ⇄ Reverse
As you may or may not know, Funciton comes with a library full of functions for lists, which are values encoded in a single humongous integer, as well as a separate library for lazy-evaluated sequences, which use lambda expressions (anonymous functions) in order to be lazy. Of course there’s also a library for string handling functions.
For this challenge, I needed a function to reverse a string, and a function to reverse a lazy-evaluated sequence. Surprisingly, I only had one for lists — exactly the one I didn’t need. So here are the reverse functions for lazy sequences (ɹ) and for strings (⇄):
              ╓───╖             ╔════╗ ┌────╖        ╓───╖
              ║ ɹ ║             ║ 21 ╟─┤ >> ╟──┐     ║ ⇄ ║
              ╙─┬─╜             ╚════╝ ╘═╤══╝  │     ╙─┬─╜      ┌──┐
          ┌─────┴─────┐                ┌─┴─╖   ├───────┴────────┤  │
        ┌─┴─╖ ┌───╖   │                │ ⇄ ║   │   ╔════╗ ┌───╖ │  │
      ┌─┤   ╟─┤ ɹ ╟─┐ │                ╘═╤═╝   │   ║ −1 ╟─┤ ≠ ╟─┴┐ │
      │ └─┬─╜ ╘═══╝ │ │                ┌─┴─╖ ┌─┴─╖ ╚════╝ ╘═╤═╝  │ │
      │   │   ┌───╖ │ │                │ ‼ ╟─┤ ? ╟──────────┤    │ │
      │   └───┤ ʬ ╟─┘ │                ╘═╤═╝ ╘═╤═╝  ╔═══╗ ┌─┴─╖  │ │
      │       ╘═╤═╝   │                ┌─┴─╖ ╔═══╗  ║ 0 ╟─┤ ≠ ╟──┘ │
      │ ╔═══╗ ┌─┴─╖   │              ┌─┤ ʃ ╟─╢ 1 ║  ╚═╤═╝ ╘═══╝    │
      └─╢ 0 ╟─┤ ? ╟───┘              │ ╘═╤═╝ ╚═══╝    │            │
        ╚═══╝ ╘═╤═╝                  │   └────────────┘            │
                │                    └─────────────────────────────┘

The lazy-sequences one uses ʬ, which is “append an element to the end of a lazy sequence”. The string one uses ʃ (substring) and ‼ (string concatenate).
② Ṗ Primes
Although I could have done prime factorization by just trying to divide n by all factors in order, I decided I wanted a library function that generates prime numbers. The following function takes an integer n and implements the Sieve of Eratosthenes to generate all prime numbers up to n. It does this as a lazy sequence, so it’ll generate only as many primes as you actually evaluate.
                                       ╓───╖
                                       ║ Ṗ ║
                                 ╔═══╗ ╙─┬─╜
                                 ║ 0 ║ ┌─┴─╖
                                 ╚═╤═╝ │ ♭ ║
                          ╔═══╗ ┌──┴─╖ ╘═╤═╝
                          ║ 2 ╟─┤ Ṗp ╟───┘
                          ╚═══╝ ╘══╤═╝
    ┌──────────────┐               │
    │              ├─────────────────────────────────────────┐
    │            ┌─┴─╖                                       │
    │          ┌─┤ · ╟────────────────────────────┐   ╓┬───╖ │
    │          │ ╘═╤═╝                            ├───╫┘Ṗp ╟─┤
    │          │   │           ╔═══╗ ┌────╖     ┌─┴─╖ ╙─┬──╜ │
    │          │   │           ║ 1 ╟─┤ >> ╟─────┤ · ╟───┴─┐  │
    │          │   │  ┌───╖    ╚═══╝ ╘══╤═╝     ╘═╤═╝     │  │
    │          │ ┌─┴──┤ ♯ ╟─────┐    ┌──┴─╖ ┌───╖ │       │  │
    │          │ │    ╘═══╝ ┌─┐ │ ┌──┤ Ṗp ╟─┤ ♭ ╟─┴─┐     │  │
    │          │ │          ├─┘ └─┤  ╘══╤═╝ ╘═══╝ ┌─┘     │  │
    │          │ │        ╔═╧═╕ ┌─┴─╖ ┌─┴─╖     ┌─┴─╖     │  │
    │          │ └────────╢   ├─┤ · ╟─┤ ? ╟─────┤ · ╟─┐   │  │
    │          │ ┌───╖    ╚═╤═╛ ╘═╤═╝ ╘═╤═╝     ╘═╤═╝ │   │  │
    │        ┌─┴─┤ ♭ ╟─┐ ┌──┴─╖   │   ┌─┴─╖       │   │   │  │
    │        │   ╘═══╝ └─┤ Ṗp ╟───┘ ┌─┤ ? ╟───────┘   │   │  │
    │ ┌───╖  │  ╔════╗   ╘══╤═╝     │ ╘═╤═╝           │   │  │
  ┌─┴─┤ ÷ ╟──┘  ║ −1 ║   ┌──┴─╖   ╔═╧═╗ │            ┌┴┐  │  │
  │   ╘═╤═╝     ╚══╤═╝ ┌─┤ >> ╟─┐ ║ 0 ║              └┬┘  │  │
  │   ┌─┴─╖ ┌────╖ │   │ ╘════╝ │ ╚═══╝               │   │  │
  │   │ × ╟─┤ << ╟─┘ ┌─┴─┐    ╔═╧═╗                   │   │  │
  │   ╘═╤═╝ ╘══╤═╝  ┌┴┐ ┌┴┐   ║ 1 ╟───────────────────┴─┐ │  │
  └─────┘     ┌┴┐   └┬┘ └┬┘   ╚═══╝                     ├─┘  │
              └┬┘    │   └──────────────────────────────┘    │
             ┌─┴─╖ ┌─┴──╖                                    │
             │ ÷ ╟─┤ << ╟─┐                                  │
             ╘═╤═╝ ╘════╝ ├──────────────────────────────────┘
              ┌┴┐         │
              └┬┘         │
      ╔════╗ ┌─┴──╖       │
      ║ −1 ╟─┤ << ╟───────┘
      ╚════╝ ╘════╝

The helper function, Ṗp, takes:

A running counter which just keeps decrementing until it reaches 0.

The sieve, which has a bit set for each number that is already known to be not-prime. Initially, the least significant bit represents the number 2, but we shift this right with each iteration.

A number n which indicates what number is represented by the sieve’s lowest bit; this is incremented with every iteration.

At each iteration, if the sieve’s lowest bit is 0, we’ve found a prime n. We then use the formula I already described in Fill the rows, columns, and diagonals of an NxN grid to set every n-th bit in the sieve before moving to the next iteration.
③ Ḟ Prime factorization
                             ╓───╖
                             ║ Ḟ ║
                             ╙─┬─╜
                       ┌───────┴──────┐
                       │ ┌───╖ ┌────╖ │
                       └─┤ Ṗ ╟─┤ Ḟp ╟─┘
                         ╘═══╝ ╘═╤══╝
                                 │
               ┌────────────────────────────────────────────┐
               │                                     ╓┬───╖ │
       ┌───────┴─┐     ┌───────────────────────┐   ┌─╫┘Ḟp ╟─┘
       │ ╔═══╗ ┌─┴─╖ ┌─┴─╖ ┌───┐ ┌────╖      ┌─┴─╖ │ ╙────╜
       │ ║ 0 ╟─┤   ╟─┤ · ╟─┘┌┐ └─┤ Ḟp ╟──┐ ┌─┤ · ╟─┴──┐
       │ ╚═══╝ └─┬─╜ ╘═╤═╝  └┤   ╘═╤══╝  ├─┘ ╘═╤═╝    │
       │       ┌─┴─┐ ┌─┴─╖ ╔═╧═╕ ┌─┴─╖ ┌─┴─╖ ┌─┴──╖ ┌─┴─╖
       │       │   └─┤ · ╟─╢   ├─┤ ? ╟─┤ · ╟─┤ ÷% ╟─┤ · ╟─┐
       │       │     ╘═╤═╝ ╚═╤═╛ ╘═╤═╝ ╘═╤═╝ ╘═╤══╝ ╘═╤═╝ │
       │       │    ┌──┴─╖   │   ┌─┴─╖ ┌─┴─╖   └──────┘   │
       │       │    │ Ḟp ╟───┘ ┌─┤ ? ╟─┤ ≤ ║              │
       │     ┌─┴─╖  ╘══╤═╝     │ ╘═╤═╝ ╘═╤═╝              │
       └─────┤ · ╟─────┘     ╔═╧═╗ │   ╔═╧═╗              │
             ╘═╤═╝           ║ 0 ║     ║ 2 ║              │
               │             ╚═══╝     ╚═══╝              │
               └──────────────────────────────────────────┘

This is fairly straight-forward. Just iterate through the primes up to n and see which ones divide n. If one does divide n, remember to carry on with the same prime so that we return it multiple times if it divides n multiple times. This returns the empty sequence for any number less than 2.
④ ◇ ◆ Generate a diamond
This function generates a single diamond given a character and a radius. It only uses the character to place it in the center of the diamond.
                                   ┌───╖
             ┌─────────────────────┤ ♯ ╟───────────┬─────────┐
             │ ┌───╖ ╔═══╗   ┌───┐ ╘═══╝           │         │
             └─┤ ♫ ╟─╢ 0 ║   │ ┌─┴─╖               │         │
               ╘═╤═╝ ╚═══╝   │ │ ʭ ╟───┐           │         │
               ┌─┴─╖   ┌─────┘ ╘═╤═╝   │           │         │
               │ ɱ ╟───┤ ┌───╖ ┌─┴─╖ ╔═══╗   ╓───╖ │         │
               ╘═╤═╝   └─┤ ɹ ╟─┤ ʓ ╟─╢ 1 ║ ┌─╢ ◇ ╟─┤         │
                 │ ╔═══╗ ╘═══╝ ╘═══╝ ╚═══╝ │ ╙───╜ │         │
                 │ ║ 0 ║                   │     ┌─┴─╖       │
                 │ ╚═╤═╝                   │     │ ♭ ║       │
               ╔═╧═╕ │   ╔════╗            │     ╘═╤═╝       │
           ┌───╢   ├─┘ ┌─╢ 21 ║          ┌─┴─╖   ┌─┴─╖     ┌─┴─┐
           │   ╚═╤═╛   │ ╚════╝ ┌────────┤ · ╟───┤ · ╟─┐ ┌─┴─╖ │
           │   ┌─┴─╖ ┌─┴──╖ ┌───┘        ╘═╤═╝   ╘═╤═╝ ├─┤ = ║ │
           │ ┌─┤ ‼ ╟─┤ >> ║ │              │     ┌─┴─╖ │ ╘═╤═╝ │
           │ │ ╘═══╝ ╘═╤══╝ │              │   ┌─┤ ? ╟─┘   │   │
           │ │   ┌───╖ │ ┌──┘              │   │ ╘═╤═╝     │   │
           │ └─┬─┤ ⇄ ╟─┘ │     ┌─────┐     │   │ ┌─┴─╖     │   │
           │   │ ╘═══╝ ┌─┴─╖ ┌─┴─╖ ┌─┴─╖ ┌─┴─╖ └─┤ · ╟──┬──┘   │
           │   └───────┤ · ╟─┤ ? ╟─┤ · ╟─┤ ‼ ║   ╘═╤═╝  │      │
           │           ╘═╤═╝ ╘═╤═╝ ╘═╤═╝ ╘═╤═╝   ┌─┴─╖  │      │
           │             └─────┘     └─┬───┘ ┌───┤ … ║  │      │
           │               ┌─────┐     │     │   ╘═╤═╝  │      │
           │            ╔══╧═╗ ┌─┴─╖ ┌─┴─╖ ┌─┴─╖ ╔═╧══╗ │      │
           │            ║ 32 ║ │ … ╟─┤ ‼ ╟─┤ ‼ ║ ║ 32 ║ │      │
           │            ╚════╝ ╘═╤═╝ ╘═══╝ ╘═╤═╝ ╚════╝ │      │
           │                   ┌─┴─╖       ╔═╧══╗       │      │
           │               ┌───┤ − ╟───┬─┐ ║ 46 ║       │      │
           │             ┌─┴─╖ ╘═══╝   │ │ ╚════╝       │      │
           └─────────────┤ · ╟─────────┘ └──────────────┘      │
                         ╘═╤═╝                                 │
                           └───────────────────────────────────┘

This makes heavy use of lazy sequences. Here’s how it works:

Generate the sequence of integers from 0 to r (inclusive).

For each such integer α, generate a string consisting of (r − α) spaces (…), followed by a dot, followed by α spaces — unless α = r, in which case generate one fewer space and append the letter. We now have the top-left quarter of the diamond.

To each of these strings, append another copy of the same string, but with the characters reversed (⇄) and then the first character removed (>> 21). We now have the top half of the diamond.

Take this sequence and append to it the same sequence, but reversed (ɹ) and with the first element removed (ʓ). We now have the whole diamond.

Now we have the strings that make up the diamond, but we need a little more information. We need to know where the vertical middle of the diamond is. Initially this is of course r, but once we’ve appended other diamonds to the top and bottom of this, we will need to keep track of the position of the “middle” diamond so that we can vertically align the other stacks of diamonds correctly. The same goes for the horizontal extent of the diamond (need that when appending diamonds to the top and bottom). I also decided to keep track of the letter; I need that because otherwise the function ⬗ (which we get to in the next section) would have to have four parameters, but Funciton allows only three.
                             ┌─────────────────┐
                             │  ╓───╖          │
                             ├──╢ ◆ ╟──┐       │
                             │  ╙───╜  │       │
                             │   ┌─────┴───┐   │
                           ┌─┴─╖ │ ┌───╖ ┌─┴─╖ │
                         ┌─┤ · ╟─┴─┤ › ╟─┤ › ║ │
                         │ ╘═╤═╝   ╘═╤═╝ ╘═╤═╝ │
                         │ ┌─┴─╖     │   ┌─┴─╖ │
                         │ │ ◇ ╟─────────┤ › ╟─┘
                         │ ╘═╤═╝         ╘═══╝
                         └───┘

We use the list API (› adds elements to the front of a list) to create a structure containing [x, y, c, q], where x is the x-coordinate of the horizontal center of the diamond, y is the y-coordinate of the baseline, c is the letter and q is the lazy sequence of strings. This structure will be used to contain all of the intermediate stages from now on.
⑤ ⬗ Append diamonds vertically
This function takes an existing diamond stack, a radius, and a boolean indicating whether to add the new diamond to the top (true) or bottom (false).
                 ┌─────────────────────────────────────────────────┐
               ┌─┴─╖         ┌───────────────────────────┐ ┌───╖ ┌─┴─╖
           ┌───┤ · ╟─────────┘ ╔═══╗ ┌───────────────┐   ├─┤ ‹ ╟─┤ ‹ ║
           │   ╘═╤═╝           ║ 1 ║ │ ╓───╖         │   │ ╘═╤═╝ ╘═╤═╝
           │     │             ╚═╤═╝ └─╢ ⬗ ╟─┐       │ ┌─┴─╖ │   ┌─┴─╖
           │     │ ┌───╖ ┌───╖ ┌─┴──╖  ╙─┬─╜ │       └─┤ · ╟─┘ ┌─┤ ‹ ╟─┐
           │   ┌─┴─┤ + ╟─┤ ♯ ╟─┤ << ║    │   │         ╘═╤═╝   │ ╘═══╝ │
           │   │   ╘═╤═╝ ╘═══╝ ╘═╤══╝    │ ┌─┴─╖         │     │       │
           │   │   ┌─┴─╖         └───────┴─┤ · ╟───┐   ┌─┴─╖   │       │
           │   └───┤ ? ╟─┐                 ╘═╤═╝ ┌─┴───┤ · ╟─┐ │       │
           │       ╘═╤═╝ ├───────────────────┘   │     ╘═╤═╝ │ │       │
           │ ┌───╖ ┌─┴─╖ │               ┌─────┐ │ ┌───╖ │   │ │       │
           └─┤ › ╟─┤ › ║ │       ┌───╖ ┌─┴─╖   │ └─┤ − ╟─┘   │ │       │
             ╘═╤═╝ ╘═╤═╝ │     ┌─┤ ‼ ╟─┤ ‼ ║   │   ╘═╤═╝     │ │       │
               │   ┌─┴─╖ │     │ ╘═╤═╝ ╘═╤═╝ ┌─┴─╖ ┌─┴─╖     │ │       │
               ┌───┤ · ╟─┘     │ ┌─┴─╖   ├───┤ · ╟─┤ … ║     │ │       │
     ┌───┐     │   ╘═╤═╝       └─┤ · ╟───┘   ╘═╤═╝ ╘═╤═╝     │ │       │
     │ ┌─┴─╖ ┌─┴─╖ ┌─┴─╖         ╘═╤═╝         │  ╔══╧═╗     │ │       │
     │ │ ʭ ╟─┤ ? ╟─┤ › ╟─┐ ╔═══╗ ╔═╧═╕         │  ║ 32 ║     │ │       │
     │ ╘═╤═╝ ╘═╤═╝ ╘═══╝ │ ║ 0 ╟─╢   ├─────────┘  ╚════╝     │ │       │
     │ ┌─┘   ┌─┴─╖       │ ╚═══╝ ╚═╤═╛                       │ │       │
     │ └─┬───┤ ʭ ╟─┐   ┌─┴─╖     ┌─┴─╖                       │ │       │
     │ ┌─┴─╖ ╘═══╝ ├───┤ · ╟─────┤ ɱ ║                       │ │       │
     └─┤ · ╟───────┘   ╘═╤═╝     ╘═╤═╝                       │ │       │
       ╘═╤═╝             │       ┌─┴─╖                       │ │       │
         │               └─────┬─┤ ◇ ╟───────────────────────┘ │       │
         │                     │ ╘═══╝                       ┌─┴─╖     │
         │                     └─────────────────────────────┤ · ╟─────┘
         │                                                   ╘═╤═╝
         └─────────────────────────────────────────────────────┘

This is fairly straight-forward too; use ‹ to unpack the structure; use ◇ to generate the new diamond; use ɱ (map) to add spaces to the beginning and end of each string in the new diamond so that it all has the same width; append (ʭ) the new strings onto the old (if bottom) or the old onto the new (if top); and finally use › to construct the structure containing all the new values. In particular, if we are appending to the bottom, y doesn’t change, but if we are appending to the top, y must increase by ♯(r << 1) (r is the radius of the new diamond).
⑥ ❖ Concatenate stacks horizontally
This is the biggest function of them all. I won’t deny that it was fairly fiddly to get this right. It takes two stacks and concatenates them horizontally while respecting the correct vertical alignment.
                           ┌──────────────────────────────────┬───────────────────────┐
                           │     ┌──────────────────┐       ┌─┴─╖                   ┌─┴─╖
                           │     │    ┌───────────┐ └───────┤ · ╟───┬───────────────┤ · ╟─────────────┐
                           │     │  ┌─┴─╖         │         ╘═╤═╝   │               ╘═╤═╝             │
                           │     │  │ ‹ ╟───┐     │         ┌─┴─╖ ┌─┴─╖               │               │
                           │     │  ╘═╤═╝ ┌─┴─╖   └─────────┤ · ╟─┤ · ╟─────────┐     │               │
                           │     │    ├─┐ │ ‹ ╟───┐         ╘═╤═╝ ╘═╤═╝         │     │               │
                           │     │    └─┘ ╘═╤═╝ ┌─┴─╖ ╓───╖ ┌─┴─╖   │           │     │               │
                           │     │          │   │ ‹ ╟─╢ ❖ ╟─┤ ‹ ║   │           │     │               │
                           │     │          │   ╘═╤═╝ ╙───╜ ╘═╤═╝ ┌─┴─╖ ┌─┐     │     │               │
                           │     │          │     │           └───┤ ‹ ║ └─┤     │     │               │
                           │     │          │     │               ╘═╤═╝ ┌─┴─╖   │     │               │
                           │     │          │     │                 └───┤ ‹ ║   │     │               │
                           │     │          │     └─────────────────┐   ╘═╤═╝   │     │               │
                           │     │          │                     ┌─┴─╖ ┌─┴─╖ ┌─┴─╖ ┌─┴─╖             │
                           │     │          │      ┌──────────────┤ · ╟─┤ · ╟─┤ · ╟─┤ · ╟──────┐      │
                           │     │          └──────┤              ╘═╤═╝ ╘═╤═╝ ╘═╤═╝ ╘═╤═╝      │      │
                           │   ┌─┴─╖             ┌─┴─╖            ┌─┴─╖   │     │     │        │      │
                           │ ┌─┤ · ╟─────────────┤ · ╟────────────┤ · ╟───┘     │     │        │      │
                           │ │ ╘═╤═╝             ╘═╤═╝            ╘═╤═╝         │     │        │      │
                           │ │   │                 │         ┌────╖ │         ┌─┴─╖   │        │      │
       ╔═══╗ ┌────╖        │ │   │                 │       ┌─┤ << ╟─┴─────────┤ · ╟─┐ │        │      │
       ║ 1 ╟─┤ << ╟────────┘ │   │                 │       │ ╘═╤══╝           ╘═╤═╝ │ │        │      │
       ╚═══╝ ╘═╤══╝ ╔════╗   │   │               ┌─┴─╖     │ ┌─┴─╖              │   │ │     ┌──┴──┐   │
             ┌─┴─╖  ║ 32 ╟─┐ │   │ ┌─────────────┤ · ╟───┐ │ │ ♯ ║              │   │ │   ┌─┴─╖ ┌─┴─╖ │
             │ ♯ ║  ╚════╝ │ │   └─┤ ┌───╖       ╘═╤═╝   │ │ ╘═╤═╝ ┌───╖ ╔════╗ │   │ │ ┌─┤ ? ╟─┤ < ║ │
             ╘═╤═╝   ┌───╖ │ │     └─┤ − ╟─────────┴─┐   │ │   └───┤ … ╟─╢ 32 ║ │   │ │ │ ╘═╤═╝ ╘═╤═╝ │
               └─────┤ … ╟─┘ │       ╘═╤═╝         ┌─┴─╖ │ └───┐   ╘═╤═╝ ╚════╝ │   │ │ │ ┌─┴─╖   ├───┘
                     ╘═╤═╝   │ ┌───╖ ┌─┴─╖ ┌───────┤ · ╟─┴─┐ ╔═╧═╗ ┌─┴─╖ ┌──────┘   │ │ └─┤ · ╟───┘
                       │   ┌─┴─┤ ʭ ╟─┤ ȶ ║ │ ┌───╖ ╘═╤═╝   │ ║ 1 ║ │ ⁞ ║ │ ┌────────┘ │   ╘═╤═╝
                     ┌─┴─╖ │   ╘═╤═╝ ╘═╤═╝ └─┤ > ╟───┴─┐   │ ╚═══╝ ╘═╤═╝ │ │   ┌──────┘     └────┐
                     │ ⁞ ║ │   ┌─┴─╖ ┌─┴─╖   ╘═╤═╝     │ ┌─┴─╖ ┌───╖ │   │ │ ┌─┴─╖ ┌───╖ ┌───╖ ┌─┴─╖
                     ╘═╤═╝ └───┤ ? ╟─┤ · ╟─────┴─┐     │ │ − ╟─┤ ȶ ╟─┴─┐ │ │ │ + ╟─┤ ♯ ╟─┤ › ╟─┤ › ║
                     ┌─┴─╖     ╘═╤═╝ ╘═╤═╝       │     │ ╘═╤═╝ ╘═╤═╝   │ │ │ ╘═╤═╝ ╘═══╝ ╘═╤═╝ ╘═╤═╝
┌────────────────────┤ · ╟───────┴───┐ └─┐     ┌─┴─╖   └───┘   ┌─┴─╖   │ │ └───┘           │     │
│                    ╘═╤═╝         ┌─┴─╖ │   ┌─┤ · ╟───────────┤ · ╟───┘ │                       │
│ ┌────────────────┐   │   ┌───────┤ · ╟─┘   │ ╘═╤═╝           ╘═╤═╝     │                       │
│ │ ╔════╗ ┌───╖ ┌─┴─╖ └───┤ ┌───╖ ╘═╤═╝     │   │               │     ┌─┴───┐                   │
│ │ ║ 32 ╟─┤ ‼ ╟─┤ · ╟───┐ └─┤ ʭ ╟───┘       │   │             ┌─┴─╖ ┌─┴─╖ ┌─┴─╖                 │
│ │ ╚════╝ ╘═╤═╝ ╘═╤═╝   │   ╘═╤═╝     ┌─────┘   │             │ ʭ ╟─┤ · ╟─┤ ? ╟─┐               │
│ │        ┌─┴─╖ ╔═╧═╕ ╔═╧═╕ ┌─┴─╖   ┌─┴─╖       │             ╘═╤═╝ ╘═╤═╝ ╘═╤═╝ │               │
│ │        │ ‼ ╟─╢   ├─╢   ├─┤ ʑ ╟───┤ ʭ ║     ┌─┴─╖             └─────┘     │   │               │
│ │        ╘═╤═╝ ╚═╤═╛ ╚═╤═╛ ╘═╤═╝   ╘═╤═╝ ┌───┤ · ╟─────────────────────────┘   │               │
│ └──────────┘     │   ╔═╧═╗   │       ├───┘   ╘═╤═╝                             │               │
│                  └───╢ 0 ║ ┌─┴─╖   ┌─┴─╖       └───────────────────────────────┘             ┌─┴─╖ ╔═══╗
│                      ╚═══╝ │ ȶ ╟───┤ · ╟─────────────────────────────────────────────────────┤ › ╟─╢ 0 ║
│                            ╘═╤═╝   ╘═╤═╝                                                     ╘═══╝ ╚═══╝
│                            ┌─┴─╖   ┌─┴─╖
│                      ┌─────┤ ? ╟─┐ │ ɕ ║
│                    ┌─┴─╖   ╘═╤═╝ │ ╘═╤═╝
│            ┌───╖ ┌─┤ < ╟───┬─┘   │   │
└────────────┤ ɕ ╟─┤ ╘═══╝ ┌─┴─╖   │   │
             ╘═══╝ └───────┤ · ╟───┘   │
                           ╘═╤═╝       │
                             └─────────┘

Here’s how it works.

First, for each stack, generate an infinite sequence (⁞) of strings, each of which contains spaces (…) according to that stack’s width.

The y values of the stacks tell us which one needs to “move down” and by how much. Prepend the appropriate space sequence, truncated (ȶ) to the right length (y1 − y2 or y2 − y1 as appropriate).

Now determine the length of each of the string sequences (ɕ), which tells us their height. Find out which one is taller.

Append the infinite space sequences to both stacks.

Use zip (ʑ) to put them together. For each pair of strings, concatenate them (‼) along with an extra space in between.

Then use ȶ to truncate the result of that to the tallest height. By doing this late, we don’t have to care which one of them needs the padding.

Finally, generate the structure again. At this point, we no longer need the character in the diamonds, so we set that to 0. The x value is just summed and incremented (so that the width of the stack can still be calculated as ♯(x << 1)). The y value is set to the higher one of the two.
⑦ ↯ Iterate over characters in a string
This is another useful function which I will add to the library. Given a string, it gives you a lazy sequence containing each character code.
                                        ╓───╖
                                        ║ ↯ ║
                                        ╙─┬─╜
                           ┌──────────────┴────────────────┐
                           │      ┌─┐          ╔═══╗ ┌───╖ │
                           │      └─┤     ┌────╢ 0 ╟─┤ ≠ ╟─┴─┐
                    ┌──────┴─┐ ┌┐ ╔═╧═╕ ┌─┴─╖  ╚═══╝ ╘═╤═╝   │
                    │        ├─┤├─╢   ├─┤ ? ╟──────────┤     │
                    │        │ └┘ ╚═╤═╛ ╘═╤═╝ ╔════╗ ┌─┴─╖   │
                    │ ╔══════╧══╗ ┌─┴─╖   │   ║ −1 ╟─┤ ≠ ╟───┘
                    │ ║ 2097151 ║ │ ↯ ║       ╚════╝ ╘═══╝
                    │ ╚═════════╝ ╘═╤═╝
                    │             ┌─┴──╖ ╔════╗
                    └─────────────┤ >> ╟─╢ 21 ║
                                  ╘════╝ ╚════╝

anding a string with 2097151 returns the first character. >>ing it by 21 removes it. We check for both 0 and −1 for a reason explained in the esolangs page; this is not relevant to this challenge, but I want the library function to be correct.
⑧ ⬖ Convert character to diamond stack
This function takes a single character and returns the structure for the vertical stack representing that one character.
                                   ╔════╗
                                   ║ 96 ║  ╓───╖
                                   ╚══╤═╝  ║ ⬖ ║
                        ┌───╖ ┌───╖ ┌─┴─╖  ╙─┬─╜
                    ┌───┤ ɗ ╟─┤ Ḟ ╟─┤ − ║    │
                    │   ╘═╤═╝ ╘═══╝ ╘═╤═╝    │
                    │   ┌─┴─╖         ├──────┘  ┌──┐
                    │   │ ɹ ║         │     ┌───┤  │
                    │   ╘═╤═╝   ┌─────┘     │   │  │
                  ╔═╧═╗ ┌─┴─╖ ┌─┴─╖         │  ┌┴┐ │
                  ║ 1 ╟─┤   ╟─┤ · ╟─────┐ ╔═╧═╕└┬┘ │
                  ╚═══╝ └─┬─╜ ╘═╤═╝   ┌─┴─╢   ├─┘ ┌┴┐
            ┌───────────┐ │     └─┐   │   ╚═╤═╛   └┬┘
          ┌─┴─╖         │ │ ┌───╖ │   └─┐ ╔═╧═╕ ┌──┴─╖ ╔═══╗
    ┌─────┤ · ╟───┐     │ └─┤ ◆ ╟─┘   ┌─┴─╢   ├─┤ << ╟─╢ 1 ║
 ┌──┴─┐   ╘═╤═╝   │     │   ╘═╤═╝     │   ╚═╤═╛ ╘════╝ ╚═╤═╝
 │ ┌──┴─╖ ┌─┴─╖ ╔═╧═╕ ╔═╧═╕ ┌─┴─╖   ┌─┴─╖ ┌─┴─╖        ┌─┴─╖
 │ │ >> ╟─┤ ⬗ ╟─╢   ├─╢   ├─┤ ʩ ╟───┤ · ╟─┤ ʑ ╟────────┤ ⸗ ║
 │ ╘══╤═╝ ╘═╤═╝ ╚═╤═╛ ╚═╤═╛ ╘═╤═╝   ╘═╤═╝ ╘═╤═╝        ╘═╤═╝
 │  ╔═╧═╗  ┌┴┐    │   ╔═╧═╗   │       └─────┘          ╔═╧═╗
 │  ║ 1 ╟─┐└┬┘    └───╢ 0 ║                            ║ 0 ║
 │  ╚═══╝ ├─┘         ╚═══╝                            ╚═══╝
 └────────┘

This function is interesting because we needed the diamonds to be appended alternatingly to the bottom and top. Here’s how I did it:

First, subtract 96 (so 'a' becomes 1), get prime factors (Ḟ above), use ɗ to add the element 1 if the sequence is empty, and then reverse (ɹ) the order.

Take the first element off and call ◆ to jumpstart the stack.

Now, use ⸗ to generate a lazy sequence that just alternates the numbers 0 and 1 indefinitely.

Use ʑ (zip) on that and the remaining prime factors. For each prime factor, shift it left by 1 and or the 0/1 onto it. We now have a sequence that encodes the prime numbers and the top/bottom information.

Finally, use ʩ (fold left/aggregate). The initial value is the stack we generated from the first element above. For each value ν, call ⬗ (append a new diamond) with the previous stack, the prime (ν >> 1) and whether top or bottom (ν & 1).

⑨ Main program
Here we do the main work.
                       ┌─────┐
                       │   ┌─┴─╖
                       │   │ ⬖ ║
               ╔═══╗ ╔═╧═╕ ╘═╤═╝
               ║ 0 ╟─╢   ├───┘
               ╚═╤═╝ ╚═╤═╛ ┌───╖ ┌───╖ ╔═══╗
                 └─┐   └───┤ ɱ ╟─┤ ↯ ╟─╢   ║
       ┌─────────┐ └─────┐ ╘═╤═╝ ╘═══╝ ╚═══╝
       │       ┌─┴─╖     │ ┌─┴─╖
       │   ┌───┤ · ╟───┐ └─┤   ╟─┐
       │   │   ╘═╤═╝   │   └─┬─╜ │
       │ ┌─┴─╖ ╔═╧═╕ ╔═╧═╕ ┌─┴─╖ │
       │ │ ❖ ╟─╢   ├─╢   ├─┤ ʩ ╟─┘
       │ ╘═╤═╝ ╚═╤═╛ ╚═╤═╛ ╘═╤═╝
       └───┘   ╔═╧═╗   │   ┌─┴─╖ ┌─┐
               ║ 0 ╟───┘ ┌─┤ ‹ ╟─┴─┘
               ╚═══╝     │ ╘═══╝
                       ┌─┴─╖ ┌─┐
                     ┌─┤ ‹ ╟─┴─┘
                     │ ╘═══╝
      ╔════╗ ┌───╖ ┌─┴─╖ ┌─┐
      ║ 10 ╟─┤ ʝ ╟─┤ ‹ ╟─┴─┘
      ╚════╝ ╘═╤═╝ ╘═══╝
               │

First, map (ɱ) over the characters in the input string (↯) and turn each into a diamond stack using ⬖. Take the first element off that, and fold (ʩ) over the rest to concatenate them all (❖). Finally, unpack the structure using ‹ to get to the sequence of strings and join them all (ʝ) using 10 (the newline) as the separator.
Example output
Input:
crusaders

Output (took 9 seconds to compute; cannot post here because size limit).

05AB1E, 84 bytes
εUAyk>ÐV≠iÒDg;Y18Q-._}εXs<ú'.ìηy>j.º».∊}».c.B€SøJ•ΓXÇôнÒ¤Å¨ Â<’|Ë•24вYèú»}».B€SøJćÛ»

Try it online.
No 20% bonus, although I might try that later on. 05AB1E isn't able to write files to disk itself, but it can evaluate Python code, so I might be able to write a file to disk using Python code. It definitely won't save enough bytes to be worth the 20% bonus, though.
Explanation:
ε                     # Map over each letter of the (implicit) input-string
 U                    #  Pop and store the letter in variable `X`
   k                  #  Get the 0-based index
  y                   #  of the letter
 A                    #  in the lowercase alphabet
    >                 #  And increase it by 1 to make it a 1-based index
     Ð                #  Triplicate it
      V               #  Pop and store one in variable `Y`
       ≠i           } #  If it's NOT equal to 1 (so not 'a'):
         Ò            #   Get all prime factors including duplicates
          Dg          #   Get the amount of prime factors (without popping by duplicating first)
            ;         #   Halve that amount
             Y18Q     #   Check if `Y` is 18 (1 if truthy; 0 if falsey)
                 -    #   Subtract that from halve the amount of prime factors
                  ._  #   And rotate the list of prime factors that many times towards the left
                      #   (which only uses the integer portion and ignores the decimal values)
                      #   (the `Dg;Y18Q-._` is to put the prime factors in the correct order,
                      #    according to the third rule of the challenge description)
 ε                    #  Then map over each prime factor `y`:
  X                   #   Push the letter `X`
   s                  #   Swap so the prime factor is at the top again
    <                 #   Decrease it by 1
     ú                #   Pad the letter with that many leading spaces
      '.ì            '#   And prepend a "."
         η            #   Then take the prefixes of this string
          y>          #   Push the prime factor, and increase it by 1
            j         #   Make all prefixes of equal length by padding with spaces,
                      #   up to a length of the prime factor + 1
                      #   (we now have the top-left portion of a diamond)
  .º                  #   Mirror each line horizontally with overlap
    »                 #   Join them by newlines
     .∊               #   And also mirror everything vertically with overlap
                      #   (we now have the entire diamond)
 }                    #  After the inner map:
  »                   #  join all diamonds of the current letter with newline delimiter
   .c                 #  Centralize all lines (which pads leading spaces)
     .B               #  Split each line on newlines as box (also adds trailing spaces)
       €S             #  Convert each line to a list of characters
         ø            #  Zip/transpose; swapping rows/columns
          J           #  Join all transposed inner character-lists to a string again
  •ΓXÇôнÒ¤Å¨ Â<’|Ë•   #  Push compressed integer 384055587443514148837383584634491347
   24в                #  Convert it to base-24 as list:
                      #   [11,23,22,21,22,19,21,17,17,21,19,13,16,11,17,19,17,7,16,5,14,17,13,1,16,19]
      Yè              #  Index value `Y` into this list
        ú             #  Pad each line with that many leading spaces
         »            #  And join them with a newline delimiter again
}                     # After the outer map:
 »                    # join all diamond-towers together with newline delimiter
  .B                  # Split each line on newlines as box (also adds trailing spaces)
    €S                # Convert each line to a list of characters
      ø               # Zip/transpose; swapping rows/columns
       J              # Join all transposed inner character-lists to a string again
        ć             # Extract head; pop and push remainder-list of lines and the first line
                      # (this first line is always a line consisting of only spaces,
                      #  since the padding list was incremented by 1 for each letter)
         Û            # Trim all leading lines consisting of only spaces
          »           # And join all remaining lines with newline delimiter
                      # (after which it is output implicitly as result)

See this 05AB1E tip of mine (section How to compress large integers? and How to compress integer lists?) to understand why •ΓXÇôнÒ¤Å¨ Â<’|Ë• is 384055587443514148837383584634491347 and •ΓXÇôнÒ¤Å¨ Â<’|Ë•24в is [11,23,22,21,22,19,21,17,17,21,19,13,16,11,17,19,17,7,16,5,14,17,13,1,16,19].


text:
Boxed character regions
Given an input string, determine the number of regions that a page will be split into.
Consider the letter P. It has one enclosed region within the letter. Assume that each letter splits the page by one or more regions (i.e. a box is drawn around the character).
Input
A string of 0 or more characters. You may assume that the string contains only characters from the following sets:

+0 regions: Spaces , tabs \t, and new lines \n
+1 region: CEFGHIJKLMNSTUVWXYZcfhijklmnrstuvwxyz12357~!^*()-_=+[]{}\'|:;",.?/<>
+2 regions:ADOPQRabdeopq469@#
+3 regions: Bg08$%&

You may take the input as a function argument, standard input, command-line argument, whatever works best for your language.
Output
An integer representing the number of regions split by the given input. Output can be a return value or standard output (but not stderr).
This is code-golf, so shortest solution in bytes win.
Test cases

(empty string or only whitespace) === 1
-1 === 3
100% === 11
Hello world! === 16
May the force be with you === 28
do {$busTickets-=2;} while ($transit != false) === 54
return @$_GET['foo'] ?? $$var % $var || $g8 << ; //# Syntax error === 80

Feel free to use the demo in my JavaScript answer (with a compatible browser of course) to run test cases.
Visual representation
Note: The visual representation for the characters g and 0 (zero) may not be entirely correct depending on the monospaced font that your computer has installed.
For the purposes of this challenge, assume that the bottom of the g has a closed loop and the 0 has a slash through it.

(function() {
  'use strict';
  [
    'CEFGHIJKLMNSTUVWXYZcfhijklmnrstuvwxyz12357~!^*()-_=+[]{}\\\'|:;"<,>.?/`',
    'ADOPQRabdeopq469@#',
    'Bg08$%&'
  ].forEach(function(set, i) {
    set.split('').sort().forEach(function(letter) {
      var p = document.querySelectorAll('section[data-letter-regions="' + (i + 1) + '"]')[0];
      console.log(p)
      var el = document.createElement('span');
      el.setAttribute('class', 'letter');
      el.textContent = letter;
      p.appendChild(el);
    });
  });

}());
h1 {
  font-family: sans-serif;
}
section + section {
  border-top: medium solid purple;
}
.letter {
  font-family: Consolas, 'Droid Sans Mono', monospace;
  font-size: 3em;
  line-height: 1;
  padding: 3px;
  margin: 3px;
  display: inline-block;
  border: thin solid darkgray;
}

1 region

2 regions

3 regions

Related. I would even say duplicate.

@randomra Darn it... didn't come up when I searched for "letters" or "characters". Oh well, back to the drawing board

JavaScript (ES6), 94 bytes
f=x=>[...x].reduce((p,z)=>p+!!z.trim()+2*/[Bg08$%&]/.test(z)+/[ADOPQRabdeopq469@#]/.test(z),1)

Demo
As the code is in ES6, the demo only works in ES6-compatible browsers. At time of writing, this includes Firefox, Edge, and Chrome/Opera with experimental JavaScript features enabled.

f = x => [...x].reduce((p, z) => p + !!z.trim() + 2 * /[Bg08$%&]/.test(z) + /[ADOPQRabdeopq469@#]/.test(z), 1)

// Snippet stuff
var v = function() {document.getElementById('Z').textContent = f(this.value)};
document.getElementById('I').addEventListener('keyup', v, false);
document.getElementById('I').addEventListener('change', v, false);
textarea {width: 100%}

Input: <textarea id=I></textarea>

Output: <output id=Z>1</output>

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Computing the entropy
Input
A matrix M represented as two space separated lines of integers. Each line will have the same number of integers and each integer will be either -1 or 1.  The number of integers per line will be at most 20.  M will therefore be 2 by n where n is the number of integers on each of the two lines.
Your code should be a complete program. and accept the input either on standard in or from a file (that is your choice). You can accept input from standard in, from a file or simply as a parameter. However, if you do the latter please give an explicit example of how your code should work and remember that it must be a complete program and how the matrix M will be represented in the input. In other words, you are likely to have to do some parsing.
Output
The binary Shannon entropy of the distribution of M*x where the elements of x are uniformly and independently chosen from {-1,1}.   x is an n-dimensional column vector.
The entropy of a discrete probability distribution is
- sum p_i log_2(p_i)

In this case, p_i is the probability of the ith unique possible M*x.
Example and helpful hints
As a worked example, let the matrix M be
-1 1
-1 -1

Now look at all 2^2 different possible vectors x. For each one we compute M*x and put all the results in an array (a 4-element array of 2-component vectors). Although for each of the 4 vectors the probability of it occurring is 1/2^2 = 1/4, we are only interested in the number of times each unique resultant vector M*x occurs, and so we sum up the individual probabilities of the configurations leading to the same unique vectors. In other words, the possible unique M*x vectors describe the outcomes of the distribution we're investigating, and we have to determine the probability of each of these outcomes (which will, by construction, always be an integer multiple of 1/2^2, or 1/2^n in general) to compute the entropy.
In the general n case, depending on M the possible outcomes of M*x can range from "all different" (in this case we have n values of i in p_i, and each p_i is equal to 1/2^n), to "all the same" (in this case there is a single possible outcome, and p_1 = 1).
Specifically, for the above 2x2 matrix M we can find by multiplying it with the four possible configurations ([+-1; +-1]), that each resulting vector is different. So in this case there are four outcomes, and consequently p_1 = p_2 = p_3 = p_4 = 1/2^2 = 1/4.  Recalling that log_2(1/4) = -2 we have:
- sum p_i log_2(p_i) = -(4*(-2)/4) = 2

So the final output for this matrix is 2.
Test cases
Input:
-1 -1
-1 -1

Output:
1.5

Input:
-1 -1 -1 -1
-1 -1 -1 -1

Output:
2.03063906223

Input:
-1  -1  -1  1
1  -1  -1  -1

Output:
3

What are the dimensions of x? 2. In the interests of making the question self-contained, how is the binary Shannon entropy of Mx defined?

Can a function be written?

Also, check your test cases against the definition of entropy.

@LegionMammal978 It has to be a complete program. I am not sure what you mean by "check your test cases against the definition of entropy".  Can you explain more?

Why the downvotes??

@Peter's comment exactly explains the downvotes. I skimmed the article on entropy, and I can't immediately find out what to implement. You should specify exactly what the formula/algorithm is to compute Shannon entropy.

I didn't downvote, but: maybe explain how the output is obtained? Not just a link

Questions should be self-contained, anyway; it's unlikely that Wikipedia will suddenly go offline, but it would be ideal to not have to click through to another page to be able to understand the full specification of the challenge.

@dorothy, which definition are you using? All I can find is the definition for lists, not matrices.

I will add the entropy definition in a few hours. I was trying to find a nice way to paste in math.  In short it is just -sum p_i log_2(p_i)  where log_2(0) is taken to be 0 for convenience. p_i is the probability of outcome i.  If you can work out the probability of each possible outcome you can work out the entropy.  It doesn't matter what sort of object each outcome happens to be. In this case they are just 2 dimensional vectors.

Definition and worked example added.

By default, functions are a valid alternatives to programs. You are allowed to overrule that, but it will make some languages very sad because it takes lots of boilerplate to take file or stdin input. More broadly, I recommend against having such a restrictive input format on a mathematical challenge. Allowing the language's natural list type would make people happier to participate.

Also, since there haven't been any answers yet, I'd allow M to have integers that aren't just -1 and 1. I was just asking a question when I mentioned it to you in chat and I think the question would be better without this restriction, as well.

@dorothy note that it's not that "log_2(0) is 0 for convenience", but rather "lim_{p->0} p*log(p)==0". So "log_2(0)" is still -inf.

@dorothy I believe your problem is well-defined, but ill-described:) So I submitted an edit suggestion to make it clearer to others. Feel free to reject or improve it, it just seemed a simpler choice than trying to explain in comments what might be missing. The main point which most people missed was probably that only the number of unique resulting vectors are important, and the actual values are irrelevant. I think that if you sort this out, the question could be reopened.

@AndrasDeak I made a small tweak to your edit but other than that accepted it. Can it be reopened now?

dorothy, that is up to the high-rep users such as @xnor (I would vote to reopen, but then again I wouldn't have voted to close in the first place). Also: I've realized that even my solution does not comply with the rules: I need additional [ ] around the matrices to make it work. This is the same problem that xnor has mentioned. I could buff up my submission to make it work with the current rules, but I'd gladly avoid that if you would indeed consider lightening the input rules (much to the delight of a lot of users, I would think). If that helps, I could delete my answer for the time being.

@AndrasDeak I updated the rules.

@dorothy thanks, although I have to confess that the change is the exact opposite of what I had in mind:) Anyway, I've finally changed my submission to accommodate the input parsing criterion, at the cost of 28 extra bytes.

Perl, 160 159 141 bytes
includes +1 for -p since 141 byte update
@y=(@z=/\S+/g)x 2**@z;@{$.}=map{evals/.1/"+".$&*pop@y/egr}glob"{-1,+1}"x@z}{$H{$_.$2[$i++]}++for@1;$\-=$_*log($_/=1<<@z)/log 2 for values%H;

The input is expected on STDIN as 2 lines consisting of space-separated 1 or -1.
Run as perl -p 140.pl < inputfile.
It won't win any prizes, but I thought I'd share my effort.
Explained:
    @y=                             # @y is (@z) x (1<<$n)
       (@z = /\S+/g)                # construct a matrix row from non-WS
       x 2**@z;                     # repeat @z 2^$n times
    @{$.} = map {                   # $.=$INPUT_LINE_NUMBER: set @1 or @2
      eval s/.1/"+".$&*pop@y/egr    # multiply matrix row with vector
    } glob "{-1,+1}" x @z           # produce all possible vectors

}{                                  # `-p` trick: end `while(<>)`, reset `$_`

$H{ $_ . $2[$i++] }++               # count unique M*x columns
    for @1;

$\ -= $_ * log($_/=1<<@z) / log 2   # sum entropy distribution
        for values %H;

DATA

update 159: save 1 by eliminating () by using ** instead of <<.
update 141: save 18 by using $. and -p.

Thank you!  We don't have enough perl answers on ppcg imho

@dorothy It's because code-golfers loathe Perl, for the most part.

@FlagAsSpam But, but.. perl is incomprehensible, succinct and borderline insane. How could it be more suitable for code-golf?

@dorothy ¯\(ツ)/¯ We avoid it like the plague. Dunno why, really.

Pyth, 37 bytes
K^_B1lhJrR7.z_s*LldcRlKhMrSmms*VdkJK8

Test suite
This is somewhat trickier when you have to manually implement matrix multiplication.
Explanation:
K^_B1lhJrR7.z_s*LldcRlKhMrSmms*VdkJK8
       JrR7.z                            Parse input into matrix, assign to J.
  _B1                                    [1, -1]
K^   lhJ                                 All +-1 vectors of length n, assign to K.
                           m       K     Map over K
                            m     J      Map over the rows of J
                             s*Vdk       Sum of vector product of vector and row.
                          S              Sort
                         r          8    Run length encode.
                       hM                Take just occurrence counts.
                   cRlK                  Divide by len(K) to get probabilities.
               *Lld                      Multiply each probabiliity by its log.
              s                          Sum.
             _                           Negate. Print implicitly.

Wow! :)  This looks like a lot of work. Now where are the cjam people..... ?

Mathematica, 48 68 bytes
Edit: Preprocess is added for accepting string as the parameter.
With the help of Tuples and Entropy, the implementation is both concise and readable.
Entropy[2,{-1,1}~Tuples~Length@#.#]&@Thread@ImportString[#,"Table"]&

where Tuples[{-1,1},n] gives all possible n-tuples from {-1,1}, and Entropy[2,list] gives the base-2 information entropy.
One of the cool things is that Mathematica will actually return an accurate expression:
%["-1 -1 \n -1 -1"]
(* 3/2 *)

Approximate result can be achieved with an extra . added (Entropy[2., ...).

Mathematica is ridiculous :)  However your answer doesn't quite fit the spec. The input is space separated so some parsing will be needed.  See the latest update.

MATLAB, 196 194 187 184 126 154 bytes
(The extra 28 bytes from 126 to 154 are due to input parsing: now the code accepts the input as two lines of whitespace-separated numbers.)
f=@()str2num(input('','s'));M=[f();f()];n=size(M,2);x=(dec2bin(0:n^2-1,n)-48.5)*2*M';[~,~,c]=unique(x,'rows');p=accumarray(c,1)/2^n;disp(-sum(p.*log2(p)))

Ungolfed version:
f=@()str2num(input('','s'));        % shorthand for "read a line as vector"
M=[f();f()];                        % read matrix
n=size(M,2);                        % get lenght of vectors

x=(dec2bin(0:n^2-1,n)-48.5)*2*M';   % generate every configuration
                                    %    using binary encoding
[~,~,c]=unique(x,'rows');           % get unique rows of (Mx)^T
p=accumarray(c,1)/2^n;              % count multiplicities and normalize
disp(-sum(p.*log2(p)))              % use definition of entropy

I could do away with 6 bytes if an "ans = ..." type of output was allowed, I'm never sure about this.
I'm sorry to say that my original and surely witty solution was way too ungolfed compared to my current solution. This is also the first time I'm using accumarray. A six-input-parameter application still has to wait, though:)
Outputs (following format long):
[-1 1
-1 -1]
     2

[-1 -1
-1 -1]
   1.500000000000000

[-1 -1 -1 -1
-1 -1 -1 -1]
   2.030639062229566

[-1  -1  -1  1
1  -1  -1  -1]
     3

Outputs with the default format short g:
[-1 1
-1 -1]
     2

[-1 -1
-1 -1]
          1.5

[-1 -1 -1 -1
-1 -1 -1 -1]
       2.0306

[-1  -1  -1  1
1  -1  -1  -1]
     3

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Cracking the Enigma?
Introduction
The Enigma was one of the first electro-mechanical rotor cipher machines used in World War II. That means that after a single letter is coded, it would change the key for the next letter. This was considered unbreakable by the Germans, due to the enormous key space. Even brute-forcing was almost impossible. However, there was a design error in the Enigma. Encrypting a letter would never result into itself. That means that the letter A can encrypt to every letter except the letter A.
Let's take an example of a coded message:
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ

A typical German word was WETTERBERICHT, or weather report in English. With the principe above, we can determine at which locations the word could possibly be:
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ
WETTERBERICHT
         ^

This is not possible, because the I can't be encrypted to itself, so we move on 1 place:
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ
 WETTERBERICHT
             ^

This is also not possible, so we move another place again:
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ
  WETTERBERICHT
   ^

This again is not possible. In fact, the first possible occurence of WETTERBERICHT is:
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ
             WETTERBERICHT
0123456789012345678901234567890123456789012345678901234567890123
             ^
             13

So, we return the 0-indexed position of the first possible occurence, which is 13.
The Task

Given a coded message and a word, find the index of the first possible occurence.
Assume that only basic uppercase alphabetic characters will be used (ABCDEFGHIJKLMNOPQRSTUVWXYZ).
If no occurence is found, you can output any negative integer, character, or nothing (e.g. -1, X).
Input may be accepted as argument, on seperate newlines, lists or anything else.
This is code-golf, so the submission with the least amount of bytes wins!

Test cases
Input: BHGEFXWFTIUPITHHLPETTTCLOEWOELM, WETTERBERICHT
Output: 13

Input: ABCDEFGHIJKL, HELLO
Output: 0

Input: EEEEEEEEEEEE, HELLO
Output: -1

Input: XEEFSLBSELDJMADNADKDPSSPRNEBWIENPF, DEUTSCHLAND
Output: 11

Input: HKKH, JJJJJ
Output: -1

Umm, why does the encoded string change in the middle of the example?

@Doorknob冰  ¯\(ツ)/¯

There are issues with the introduction:

it wasn't considered unbreakable because of the key space, but because of the system that a letter changes what it is translated to
"Encrypting a letter would never result into itself." - yes it would, after the number of available characters it would have to repeat one.

@Zelphir with encrypting to itself, I meant that the E would never result into an E. That is what this whole challenge is about.

Can we use 1-indexing if that's our language's default?

Pyth, 14 bytes
f!s.eqb@>zTkQ0

I'm not sure if this is Ok but if the input is impossible, nothing is written to stdout and a zero division error is written to stderr. Takes the input on 2 lines, the second one is surrounded by quotes.
Explanation:
               - autoassign z to first input
               - autoassign Q to second input
f            0 - The first value starting from 0 where the output is truthy
   .e       Q  - Enumerate over the second value
        >zT    - z[T:]
       @   k   - The kth item (number in enumeration)
      b        - The character in the enumeration
     q         - Are the two characters equal?
  s            - Sum the values
 !             - Invert them (want first where there isn't a collision)

Try it here!

JavaScript, 40
(c,p)=>c.search(p.replace(/./g,"[^$&]"))

Using replace, this maps the plaintext input into a regular expression of form /[^H][^E][^L][^L][^O]/ (e.g., for plaintext input HELLO) and then uses search to test for the first index of the ciphertext substring that matches that regex. This regex means "a pattern where the first character is not H, the second character is not E, etc."
$& is a special sequence for replace output that substitutes in the value matched by the first replace argument (in this case, each single character matched by /./).

Oh, wow, that's a really clever solution!

I didn't know about $&! Thanks for teaching my something today.

@ETHproductions Me neither, until today! I also learned about $` and `$'` in the process of researching this answer, which provide "the portion of the string that precedes/follows the matched substring"

Wow, that's awesome! I should read the docs more often ;)

Turing Machine Simulator - 15660 bytes (Non-Competing)
Can't have an Enigma challenge without turing machine code.
0 * * l 0
0 _ _ l ,
, _ , l 1
1 _ 0 r 2
2 * * r 2
2 , * r 3
3 * * r 3
3 , * r 4
4 * * r 4
4 _ * r 13
4 A a l a'
4 B b l b'
4 C c l c'
4 D d l d'
4 E e l e'
4 F f l f'
4 G g l g'
4 H h l h'
4 I i l i'
4 J j l j'
4 K k l k'
4 L l l l'
4 M m l m'
4 N n l n'
4 O o l o'
4 P p l p'
4 Q q l q'
4 R r l r'
4 S s l s'
4 T t l t'
4 U u l u'
4 V v l v'
4 W w l w'
4 X x l x'
4 Y y l y'
4 Z z l z'
a' * * l a'
a' , * l a
b' * * l b'
b' , * l b
c' * * l c'
c' , * l c
d' * * l d'
d' , * l d
e' * * l e'
e' , * l e
f' * * l f'
f' , * l f
g' * * l g'
g' , * l g
h' * * l h'
h' , * l h
i' * * l i'
i' , * l i
j' * * l j'
j' , * l j
k' * * l k'
k' , * l k
l' * * l l'
l' , * l l
m' * * l m'
m' , * l m
n' * * l n'
n' , * l n
o' * * l o'
o' , * l o
p' * * l p'
p' , * l p
q' * * l q'
q' , * l q
r' * * l r'
r' , * l r
s' * * l s'
s' , * l s
t' * * l t'
t' , * l t
u' * * l u'
u' , * l u
v' * * l v'
v' , * l v
w' * * l w'
w' , * l w
x' * * l x'
x' , * l x
y' * * l y'
y' , * l y
z' * * l z'
z' , * l z

a * * l a
a _ * r A
a a * r A
a b * r A
a c * r A
a d * r A
a e * r A
a f * r A
a g * r A
a h * r A
a i * r A
a j * r A
a k * r A
a l * r A
a m * r A
a n * r A
a o * r A
a p * r A
a q * r A
a r * r A
a s * r A
a t * r A
a u * r A
a v * r A
a w * r A
a x * r A
a y * r A
a z * r A
b * * l b
b _ * r B
b a * r B
b b * r B
b c * r B
b d * r B
b e * r B
b f * r B
b g * r B
b h * r B
b i * r B
b j * r B
b k * r B
b l * r B
b m * r B
b n * r B
b o * r B
b p * r B
b q * r B
b r * r B
b s * r B
b t * r B
b u * r B
b v * r B
b w * r B
b x * r B
b y * r B
b z * r B
c * * l c
c _ * r C
c a * r C
c b * r C
c c * r C
c d * r C
c e * r C
c f * r C
c g * r C
c h * r C
c i * r C
c j * r C
c k * r C
c l * r C
c m * r C
c n * r C
c o * r C
c p * r C
c q * r C
c r * r C
c s * r C
c t * r C
c u * r C
c v * r C
c w * r C
c x * r C
c y * r C
c z * r C
d * * l d
d _ * r D
d a * r D
d b * r D
d c * r D
d d * r D
d e * r D
d f * r D
d g * r D
d h * r D
d i * r D
d j * r D
d k * r D
d l * r D
d m * r D
d n * r D
d o * r D
d p * r D
d q * r D
d r * r D
d s * r D
d t * r D
d u * r D
d v * r D
d w * r D
d x * r D
d y * r D
d z * r D
e * * l e
e _ * r E
e a * r E
e b * r E
e c * r E
e d * r E
e e * r E
e f * r E
e g * r E
e h * r E
e i * r E
e j * r E
e k * r E
e l * r E
e m * r E
e n * r E
e o * r E
e p * r E
e q * r E
e r * r E
e s * r E
e t * r E
e u * r E
e v * r E
e w * r E
e x * r E
e y * r E
e z * r E
f * * l f
f _ * r F
f a * r F
f b * r F
f c * r F
f d * r F
f e * r F
f f * r F
f g * r F
f h * r F
f i * r F
f j * r F
f k * r F
f l * r F
f m * r F
f n * r F
f o * r F
f p * r F
f q * r F
f r * r F
f s * r F
f t * r F
f u * r F
f v * r F
f w * r F
f x * r F
f y * r F
f z * r F
g * * l g
g _ * r G
g a * r G
g b * r G
g c * r G
g d * r G
g e * r G
g f * r G
g g * r G
g h * r G
g i * r G
g j * r G
g k * r G
g l * r G
g m * r G
g n * r G
g o * r G
g p * r G
g q * r G
g r * r G
g s * r G
g t * r G
g u * r G
g v * r G
g w * r G
g x * r G
g y * r G
g z * r G
h * * l h
h _ * r H
h a * r H
h b * r H
h c * r H
h d * r H
h e * r H
h f * r H
h g * r H
h h * r H
h i * r H
h j * r H
h k * r H
h l * r H
h m * r H
h n * r H
h o * r H
h p * r H
h q * r H
h r * r H
h s * r H
h t * r H
h u * r H
h v * r H
h w * r H
h x * r H
h y * r H
h z * r H
i * * l i
i _ * r I
i a * r I
i b * r I
i c * r I
i d * r I
i e * r I
i f * r I
i g * r I
i h * r I
i i * r I
i j * r I
i k * r I
i l * r I
i m * r I
i n * r I
i o * r I
i p * r I
i q * r I
i r * r I
i s * r I
i t * r I
i u * r I
i v * r I
i w * r I
i x * r I
i y * r I
i z * r I
j * * l j
j _ * r J
j a * r J
j b * r J
j c * r J
j d * r J
j e * r J
j f * r J
j g * r J
j h * r J
j i * r J
j j * r J
j k * r J
j l * r J
j m * r J
j n * r J
j o * r J
j p * r J
j q * r J
j r * r J
j s * r J
j t * r J
j u * r J
j v * r J
j w * r J
j x * r J
j y * r J
j z * r J
k * * l k
k _ * r K
k a * r K
k b * r K
k c * r K
k d * r K
k e * r K
k f * r K
k g * r K
k h * r K
k i * r K
k j * r K
k k * r K
k l * r K
k m * r K
k n * r K
k o * r K
k p * r K
k q * r K
k r * r K
k s * r K
k t * r K
k u * r K
k v * r K
k w * r K
k x * r K
k y * r K
k z * r K
l * * l l
l _ * r L
l a * r L
l b * r L
l c * r L
l d * r L
l e * r L
l f * r L
l g * r L
l h * r L
l i * r L
l j * r L
l k * r L
l l * r L
l m * r L
l n * r L
l o * r L
l p * r L
l q * r L
l r * r L
l s * r L
l t * r L
l u * r L
l v * r L
l w * r L
l x * r L
l y * r L
l z * r L
m * * l m
m _ * r M
m a * r M
m b * r M
m c * r M
m d * r M
m e * r M
m f * r M
m g * r M
m h * r M
m i * r M
m j * r M
m k * r M
m l * r M
m m * r M
m n * r M
m o * r M
m p * r M
m q * r M
m r * r M
m s * r M
m t * r M
m u * r M
m v * r M
m w * r M
m x * r M
m y * r M
m z * r M
n * * l n
n _ * r N
n a * r N
n b * r N
n c * r N
n d * r N
n e * r N
n f * r N
n g * r N
n h * r N
n i * r N
n j * r N
n k * r N
n l * r N
n m * r N
n n * r N
n o * r N
n p * r N
n q * r N
n r * r N
n s * r N
n t * r N
n u * r N
n v * r N
n w * r N
n x * r N
n y * r N
n z * r N
o * * l o
o _ * r O
o a * r O
o b * r O
o c * r O
o d * r O
o e * r O
o f * r O
o g * r O
o h * r O
o i * r O
o j * r O
o k * r O
o l * r O
o m * r O
o n * r O
o o * r O
o p * r O
o q * r O
o r * r O
o s * r O
o t * r O
o u * r O
o v * r O
o w * r O
o x * r O
o y * r O
o z * r O
p * * l p
p _ * r P
p a * r P
p b * r P
p c * r P
p d * r P
p e * r P
p f * r P
p g * r P
p h * r P
p i * r P
p j * r P
p k * r P
p l * r P
p m * r P
p n * r P
p o * r P
p p * r P
p q * r P
p r * r P
p s * r P
p t * r P
p u * r P
p v * r P
p w * r P
p x * r P
p y * r P
p z * r P
q * * l q
q _ * r Q
q a * r Q
q b * r Q
q c * r Q
q d * r Q
q e * r Q
q f * r Q
q g * r Q
q h * r Q
q i * r Q
q j * r Q
q k * r Q
q l * r Q
q m * r Q
q n * r Q
q o * r Q
q p * r Q
q q * r Q
q r * r Q
q s * r Q
q t * r Q
q u * r Q
q v * r Q
q w * r Q
q x * r Q
q y * r Q
q z * r Q
r * * l r
r _ * r R
r a * r R
r b * r R
r c * r R
r d * r R
r e * r R
r f * r R
r g * r R
r h * r R
r i * r R
r j * r R
r k * r R
r l * r R
r m * r R
r n * r R
r o * r R
r p * r R
r q * r R
r r * r R
r s * r R
r t * r R
r u * r R
r v * r R
r w * r R
r x * r R
r y * r R
r z * r R
s * * l s
s _ * r S
s a * r S
s b * r S
s c * r S
s d * r S
s e * r S
s f * r S
s g * r S
s h * r S
s i * r S
s j * r S
s k * r S
s l * r S
s m * r S
s n * r S
s o * r S
s p * r S
s q * r S
s r * r S
s s * r S
s t * r S
s u * r S
s v * r S
s w * r S
s x * r S
s y * r S
s z * r S
t * * l t
t _ * r T
t a * r T
t b * r T
t c * r T
t d * r T
t e * r T
t f * r T
t g * r T
t h * r T
t i * r T
t j * r T
t k * r T
t l * r T
t m * r T
t n * r T
t o * r T
t p * r T
t q * r T
t r * r T
t s * r T
t t * r T
t u * r T
t v * r T
t w * r T
t x * r T
t y * r T
t z * r T
u * * l u
u _ * r U
u a * r U
u b * r U
u c * r U
u d * r U
u e * r U
u f * r U
u g * r U
u h * r U
u i * r U
u j * r U
u k * r U
u l * r U
u m * r U
u n * r U
u o * r U
u p * r U
u q * r U
u r * r U
u s * r U
u t * r U
u u * r U
u v * r U
u w * r U
u x * r U
u y * r U
u z * r U
v * * l v
v _ * r V
v a * r V
v b * r V
v c * r V
v d * r V
v e * r V
v f * r V
v g * r V
v h * r V
v i * r V
v j * r V
v k * r V
v l * r V
v m * r V
v n * r V
v o * r V
v p * r V
v q * r V
v r * r V
v s * r V
v t * r V
v u * r V
v v * r V
v w * r V
v x * r V
v y * r V
v z * r V
w * * l w
w _ * r W
w a * r W
w b * r W
w c * r W
w d * r W
w e * r W
w f * r W
w g * r W
w h * r W
w i * r W
w j * r W
w k * r W
w l * r W
w m * r W
w n * r W
w o * r W
w p * r W
w q * r W
w r * r W
w s * r W
w t * r W
w u * r W
w v * r W
w w * r W
w x * r W
w y * r W
w z * r W
x * * l x
x _ * r X
x a * r X
x b * r X
x c * r X
x d * r X
x e * r X
x f * r X
x g * r X
x h * r X
x i * r X
x j * r X
x k * r X
x l * r X
x m * r X
x n * r X
x o * r X
x p * r X
x q * r X
x r * r X
x s * r X
x t * r X
x u * r X
x v * r X
x w * r X
x x * r X
x y * r X
x z * r X
y * * l y
y _ * r Y
y a * r Y
y b * r Y
y c * r Y
y d * r Y
y e * r Y
y f * r Y
y g * r Y
y h * r Y
y i * r Y
y j * r Y
y k * r Y
y l * r Y
y m * r Y
y n * r Y
y o * r Y
y p * r Y
y q * r Y
y r * r Y
y s * r Y
y t * r Y
y u * r Y
y v * r Y
y w * r Y
y x * r Y
y y * r Y
y z * r Y
z * * l z
z , * r Z
z a * r Z
z b * r Z
z c * r Z
z d * r Z
z e * r Z
z f * r Z
z g * r Z
z h * r Z
z i * r Z
z j * r Z
z k * r Z
z l * r Z
z m * r Z
z n * r Z
z o * r Z
z p * r Z
z q * r Z
z r * r Z
z s * r Z
z t * r Z
z u * r Z
z v * r Z
z w * r Z
z x * r Z
z y * r Z
z z * r Z
A * * * 5
A A * l 6
B * * * 5
B B * l 6
C * * * 5
C C * l 6
D * * * 5
D D * l 6
E * * * 5
E E * l 6
F * * * 5
F F * l 6
G * * * 5
G G * l 6
H * * * 5
H H * l 6
I * * * 5
I I * l 6
J * * * 5
J J * l 6
K * * * 5
K K * l 6
L * * * 5
L L * l 6
M * * * 5
M M * l 6
N * * * 5
N N * l 6
O * * * 5
O O * l 6
P * * * 5
P P * l 6
Q * * * 5
Q Q * l 6
R * * * 5
R R * l 6
S * * * 5
S S * l 6
T * * * 5
T T * l 6
U * * * 5
U U * l 6
V * * * 5
V V * l 6
W * * * 5
W W * l 6
X * * * 5
X X * l 6
Y * * * 5
Y Y * l 6
Z * * * 5
Z Z * l 6
5 , * r 15
5 A a r 7
5 B b r 7
5 C c r 7
5 D d r 7
5 E e r 7
5 F f r 7
5 G g r 7
5 H h r 7
5 I i r 7
5 J j r 7
5 K k r 7
5 L l r 7
5 M m r 7
5 N n r 7
5 O o r 7
5 P p r 7
5 Q q r 7
5 R r r 7
5 S s r 7
5 T t r 7
5 U u r 7
5 V v r 7
5 W w r 7
5 X x r 7
5 Y y r 7
5 Z z r 7
7 * * r 7
7 , * r 4
6 * * l 6
6 _ * r 8
8 * _ r 9
9 * * r 9
9 _ * l 10
9 a A r 9
9 b B r 9
9 c C r 9
9 d D r 9
9 e E r 9
9 f F r 9
9 g G r 9
9 h H r 9
9 i I r 9
9 j J r 9
9 k K r 9
9 l L r 9
9 m M r 9
9 n N r 9
9 o O r 9
9 p P r 9
9 q Q r 9
9 r R r 9
9 s S r 9
9 t T r 9
9 u U r 9
9 v V r 9
9 w W r 9
9 x X r 9
9 y Y r 9
9 z Z r 9
10 * * l 10
10 , * l 11
11 * * l 11
11 , * l 12
12 _ 1 r 2
12 0 1 r 2
12 1 2 r 2
12 2 3 r 2
12 3 4 r 2
12 4 5 r 2
12 5 6 r 2
12 6 7 r 2
12 7 8 r 2
12 8 9 r 2
12 9 0 l 12
13 * _ l 13
13 , _ l 14
14 * _ l 14
14 , _ l halt
15 * * r 15
15 _ * l 16
16 * _ l 16
16 , _ l 17
17 * _ l 17
17 , _ l 18
18 * _ l 18
18 _ x * halt

Test it out here
Brief overview:

Set up a counter on the left
Find first uppercase letter in target and make it lowercase. If all letters are lowercase move to step 5.
Find first uppercase letter in code. If most recent letter matches, move on to step 4. Else make letter lowercase and go back to step 2.
Increment counter, make all letters capital, delete first letter in code. Go back to step 2. If no letters are left in code, return clear tape and print x.
Clear all the tape but the counter.

Also, when testing, the format of the input should be: code,target (no space)

How long did it take to make this?

Started my homework at 2:00. Got distracted at 2:15. Started this at 2.20. Posted this at 4:20. So about 2 hours.

+1, in PPCGSE, it doesn't have to be competing to be appreciated!

9575 bytes (and the current bytecount in the header is false, there are extraneous spaces and some unnecessarily long state names).

@EriktheOutgolfer, Your code seems to have a syntax error on line 21.

@ouflak Try clicking "Reset" and then "Run", there's no syntax error. Looks like a false alarm there.

@EriktheOutgolfer, No that code will definitely error. It will run through until it hits that line. Then it will die. Also, lines 57 and 58 will never run (they are commented out with the semicolon).

SWI-Prolog, 115 bytes
a(S,W,R):-length(S,L),length(W,M),N is L-M,between(0,N,I),\+ (between(0,M,J),K is I+J,nth0(J,W,A),nth0(K,S,A)),R=I.

Usage example: a(`ABCDEFGHIJKL`,`HELLO`,R).. This uses the character codes strings declared with backticks. The answer is unified with R. If no match is found, this outputs false..
Explanation:
a(S,W,R):-
    length(S,L),length(W,M),
    N is L-M,
    between(0,N,I),             % I is successively unified with an integer between 0
                                % and the last possible index of the coded message

    \+ (                        % This will only be true if what's inside the parentheses
                                % cannot be proven to be true

        between(0,M,J),         % J is successively unified with an integer between 0
                                % and the length of the desired word
        K is I+J,
        nth0(J,W,A),nth0(K,S,A) % Check if one letter is the same in both string at
                                % the same index
    ),                          % If it the case, then it will be 'true' and thus
                                % the predicate \+ will be false, meaning we need to
                                % backtrack to try a different value of I

    R=I.                        % If we get here it means it didn't find any matching
                                % letter for this value of I, which is then the answer.

Try it  here

CJam, 17 16 bytes
ll:A,ew{A.=:+!}#

Try it here.
Thanks to @PeterTaylor for saving a byte.
Explanation:
ll:A,ew    e# Finds every slice in the coded message with the length of the word
{A.=:+     e# Compare the characters in each slice to the characters in the word, and add up the result. If the sum is zero, then the slice and the word have no characters in common.
!}#        e# Invert truthiness (0 -> 1, non-0 -> 0) Return index of first truthy value.

array block # can save you a char: ll:A,ew{A.=:+!}#

Amazing how far CJam can be golfed in almost every task... :-o

@agtoever I wouldn't say it's really golfing, because 17 bytes was my very first try. The key feature is ew (make slices), everything else just follows.

Ruby, 91 79 bytes
->a,b{[*a.chars.each_cons(b.size)].index{|x|x.zip(b.chars).all?{|y|y.uniq==y}}}

Curse you, Enumerator! Why do I have to convert from string to array to Enumerator to array and waste precious bytes? >:(
->a,b{                  # define lambda
[*                      # convert to array...
  a.chars               # get enumerator from string
  .each_cons(b.size)    # each consecutive group of (b.size) letters
]
.index{|x|              # find index of...
  x.zip(b.chars)        # zip group with second input string
  .all?{|y|             # is the block true for every element?
    y.uniq==y           # uniqueify results in same array (no dups)
}}}

Using [*...] as a golfy alternative to #to_a is a nice touch.

MATL, 27 bytes
jYbZ)tnb!wlhYCw!=a~ftn?1)1-

Examples
>> matl jYbZ)tnb!wlhYCw!=a~ftn?1)1-
> EEEEEEEEEEEE, HELLO

>> matl jYbZ)tnb!wlhYCw!=a~ftn?1)1-
> XEEFSLBSELDJMADNADKDPSSPRNEBWIENPF, DEUTSCHLAND
11

Explanation
j           % input string
YbZ)        % split into two strings based on space. Trailing comma is not a problem
tnb!wlhYC   % arrange first string into sliding columns of the size of the second
w!=         % compare with transposed second string, element-wise with broadcast
a~          % detect columns where all values are 0 (meaning unequal characters)
f           % find indices of such columns
tn?         % if there's at least one such column
1)1-        % pick index of the first and subtract 1 for 0-based indexing

Haskell, 72 bytes
l=length
h i w s|l s<l w= -1|and$zipWith(/=)w s=i|1<2=h(i+1)w$tail s
h 0

Usage: h 0 "DEUTSCHLAND"  "XEEFSLBSELDJMADNADKDPSSPRNEBWIENPF" -> 11.
Simple recursive approach: if the word wcan be placed at the beginning of the string s, return the index counter i, else repeat with i incremented and the tail of s. Stop and return -1 if the length of s is less than the length of w.

Python 2.7, 111 characters
Tries all starting positions (a) and checks of any of the letters match (using the list comprehension). It returns "None" (Python's "NULL") if nothing is found (the for loop end and nothing is returned, which defaults to "None".
def d(c,s):
 for a in range(len(c)):
  if a not in [((c+s)[a+i:]).index(l)+a for i,l in enumerate(s)]:
   return a

Testsuite:
cases = {
         ("BHGEFXWFTIUPITHHLPETTTCLOEWOELM","WETTERBERICHT"):13,
         ("ABCDEFGHIJKL","HELLO"):0,
         ("EEEEEEEEEEEE","HELLO"):-1,
         ("XEEFSLBSELDJMADNADKDPSSPRNEBWIENPF","DEUTSCHLAND"):11
        }

for idx,(code,string) in enumerate(cases):
    output=d(code,string)
    print "Case: {}: d({:<35},{:<16}) gives: {}. Correct answer is: {}.".format(idx+1,code,string,output,cases[(code,string)])

You actually have 114 bytes, not 111. Here is a 106-byte version: def d(c,s):  for a in range(len(c)):   if a not in[a+(c+s)[a+i:].index(l)for i,l in enumerate(s)]:return a

Brachylog, 48 bytes
[S:W]hlL,WlM,L-M=:0reI,'(0:MeJ+I=:SrmA,W:JmA),I.

This is a direct translation of my Prolog answer. The brachylog_main/2 generated predicate expects a list of two character codes strings with the coded string first as input, and returns the index as output, e.g. brachylog_main([`ABCDEFGHIJKL`,`HELLO`],R)..
Explanation
[S:W]                                            § Unify the input with the list [S,W]

     hlL,WlM,                                    § L and M are the length of S and W

             L-M=:0reI,                          § Enumerate integers between 0 and the
                                                 § last possible index

                       '(                   ),I. § Unify the output with the current
                                                 § enumerated integer if what's inside the
                                                 § parenthesis cannot be proven to be true

                         0:MeJ                   § Enumerate integers between 0 and the
                                                 § length of the word desired

                              +I=:SrmA,W:JmA     § Check if both strings contain at matching
                                                 § indexes the same letter (unified with A)

JavaScript, 129 121 118 119* 118 bytes
(w,t){for(j=0;(x=t.length)<(y=w.length);t=' '+t,j++){for(a=i=0;++i<y;)w[i]==t[i]?a=1:a;if(!a)break}return x==y?-1:j}

w is the coded message, t is the test string. This doesn't use regexes, but just compares letter by letter, shifting the test string (i.e. "WETTERBERICHT") by appending space before it. Easy and boring.

* test case with no match didn't work, now it does

Japt, 12 bytes (non-competitive)
UàVr'."[^$&]

I'm gonna need some help with this one.

Uhhh... Japt doesn't have .search? facepalm

This can now be done with UàVr'."[^$&] for 12.

Cool, we're winning now!

Since the latest revision of this answer uses functionality that postdates the question, I'm marking it as non-competitive.

Oh forgot about that :P Thanks!

05AB1E, 14 13 11 bytes
ŒIgùÅΔø€Ëà≠

-1 byte thanks to @ovs.
Try it online or verify all test cases.
Explanation:
Œ            # Get all substrings of the first (implicit) input
 Ig          # Get the length of the second input
   ù         # Only leave the substrings of that length
    ÅΔ       # Find the first (0-based) index which is truthy for:
             # (which results in -1 if none are truthy)
      ø      #  Zip/transpose; create pairs of the characters in the current substring
             #  and the second (implicit) input
       €Ë    #  Check for each if both characters are equal (1 if truthy; 0 if falsey)
         à   #  Get the maximum (basically equal to an `any` builtin)
          ≠  #  And invert the boolean (!= 1)
             # (after which the result is output implicitly)

Dude, this was totally supposed to be @Emigna's answer ;). I wanted to come here and make a joke about him answering an adnan-question with almost-his-name in it. +1  (Noticed you answered 4 years after-the-fact after I posted this after-the-fact comment).

@MagicOctopusUrn When I saw the challenge I thought the same thing, but @Emigna usually answers new answers and doesn't look that often at existing answers. So since this one didn't had any 05AB1E answers I figured I'd add one. You're indeed right that @Emigna would have been best suited to answer this challenge. ;p

13 bytes by using ε instead of ʒ to get rid of D.

@ovs Thanks, that actually opens up 2 more bytes to save with ÅΔ! :)

PHP – 155 bytes
<?php for($p=$argv[1],$q=$argv[2],$l=strlen($q),$i=0,$r=-1;$i<strlen($p)-$l;$i++)if(levenshtein($q,substr($p,$i,$l),2,1,2)==$l){$r=$i;break;}echo$r."\n";

Save as crack.php and run with the arguments in the command line. E.g.:
$ php crack.php BHGEFXWFTIUPITHHLPETTTCLOEWOELM WETTERBERICHT
13

You can save 25 bytes and golf it down to 130 bytes: for($r=-1;$i<strlen($p=$argv[1])-$l=strlen($q=$argv[2]);$i++)if(levenshtein($q,substr($p,$i,$l),2,1,2)==$l&&$r=$i)break;echo"$r↵";

@insertusernamehere - Wow, that's impressive! So much so that I wouldn't feel right using it! I thought I was being clever using levenshtein, but probably a straightforward iteration within an iteration could do it in fewer bytes.

TeaScript, 14 bytes 20
xc(yl#`[^${l}]

Similar to @aspillers clever JavaScript solution.
Explanation
             // Implicit: x = 1st input, y = 2nd input
x            // First input
 c           // returns index of regex match
 yl#         // Loop through every char in `y`
    `[^${l}] // Replace template, ${l} because current char in `y`

Does $& not work in place of ${l}?

@ETHproductions not in this case because I'm using a loop rather than a replace

Ruby, 43 36 bytes
edit: String interpolation inside string interpolation inside a regex, yikes.
The lazy approach: translates the word to a "negative" regex -- The =~ operator does the rest.
->m,w{m=~/#{"[^#{w.chars*'][^'}]"}/}

Test:
f=->m,w{m=~/#{"[^#{w.chars*'][^'}]"}/}

require "minitest/autorun"

describe :f do
  it "works for the given test cases" do
    assert_equal 13, f["BHGEFXWFTIUPITHHLPETTTCLOEWOELM", "WETTERBERICHT"]
    assert_equal 0, f["ABCDEFGHIJKL", "HELLO"]
    assert_equal nil, f["EEEEEEEEEEEE", "HELLO"]
    assert_equal 11, f["XEEFSLBSELDJMADNADKDPSSPRNEBWIENPF", "DEUTSCHLAND"]
    assert_equal nil, f["HKKH", "JJJJJ"]
  end
end

, 14 chars / 25 bytes
îĊⱮ(í,↪`⁅⦃$}]`

Try it here (Firefox only).
Kudos to @apsillers for the idea.
Explanation
               // implicit: î = input1, í = input2
îĊ             // search for first occurrence of:
  Ɱ(í,↪`⁅⦃$}]` // regex created by wrapping each word in [^ and ] (negation matches)

Whoever downvoted this, is there a reason why?

Python 3, 79 bytes
lambda x,y:[sum(map(str.__eq__,x[i:],y))for i in range(len(x)-len(y))].index(0)

Try it online!

K (ngn/k), 19 bytes
{**&(#y)(~|/y=)':x}

Try it online!
Takes the encoded message as x and the word as y. Returns 0N (the integer null) if no possible occurrence was found.

(#y)(~|/y=)':x use i f':x stencil to apply (~|/y=) to each (#y)-length window of the input x

(#y) get the length of the input word
(~|/y=) check if any letters are in the same position in the word and the slice of the encoded message; then negate the resulting bitmask

**& return the index of the first possible occurrence of the word in the encoded message

Husk, 14 13 bytes
Or 12 bytes using 1-based indexing and returning 0 for no-occurrence.
←VoΠz≠⁰↓_L⁰ṫ²

Try it online!
←                   # subtract 1 to get 0-based indexing
 V                  # index of first element of
            ṫ²      # all suffixes of arg 2,
        ↓_          # with n elements removed from the end,
          L⁰        # where n is the length of arg 1,
                    # that satisfies
  ȯ¬                # NOT
    Σ               # any
     z=⁰            # elements are equal when zipped with arg 1

Jelly, 9 7 bytes
t"ƑÐƤi1

Try it online!
   ÐƤ      For each suffix,
  Ƒ        is it the same after
t          trimming off
 "         the corresponding letter of the word from each of its letters?
     i1    Find the first index of 1.

Wait, what?
This beats the original, W€ḟ"ƑÐƤi1, by completely dropping the step of wrapping each letter into a singleton list. As for how:
A Jelly string is a list of characters, which is to say it's a Python list of length-1 Python strings. For example, “this” is really ["t","h","i","s"].
Most list builtins are built to handle lists whether that's what they got or not, by passing all arguments through iterable, and in the case of a single character this wraps it in a singleton list to obtain a length-1 Jelly string. ḟ does this, and as a result its output is also always a list--so ḟ", mapped over corresponding pairs, gives a list of lists, and for it to ever not change a suffix of the ciphertext each of its characters has to be pre-wrapped to match.
However, t does not call iterable on its left argument, so here t" operates on the Python string characters themselves of the ciphertext suffix, and either leaves them alone or trims them to ''.
Finally, Ƒ performs a strict, non-vectorizing equality check, and " only maps its given link over pairs of corresponding elements up to the length of the shorter argument, placing the remainder of the longer argument into the result verbatim. If the ciphertext suffix is longer, the remainder automatically matches itself leaving only the prefix of length equal to the word to be considered, but if the word is longer, the result cannot be equal to the suffix because it is itself longer than the suffix.

Vyxal, 20 bytes
:ǎ'⁰l;ƛ⁰Zƛ≈;aßn;~ḃhḟ

Try it Online!
I wrote this so long ago, waiting for ḟ to work on strings, that I forgot how this even works

Jolf, 14 bytes
Try it here!
 siρI".'[^$&]
_s            search
  i            input 1 for
    I          input 2
   ρ            replacing (2 byte rho character)
     ".'         all characters
        [^$&]    with that

Perl, 38 + 1 = 39 bytes
perl -E "$r=<>=~s!.![^$&]!gr;say@-if<>=~/$r/x" < input

where input looks like:
WETTERBERICHT
BHGEFXWFTIUPITHHLPETTTCLOEWOELMRXXPAKAXMAMTXXUDLTWTNHKELEPPLHPRQ

This is the same idea as the javascript one.

The 'x' is unnecessary

Java, 136 Characters
Regex-based solution inspired by apsillers JavaScript version.
class L{public static void main(String[]a){a=a[0].split(a[1].replaceAll("(.)","[^$1]"));System.out.print(a.length>1?a[0].length():-1);}}

Brachylog (v2), 16 13 bytes
{sʰz₂}ᶠ∋↙.≠ᵐ∧

Try it online!
Takes input as a list [message, word]. The header prints it all very prettily but the output of the actual predicate is just a 0-index if it succeeds and declarative failure if it doesn't.
{    }ᶠ          Find every possible
   z             zip of the word with
    ₂            an equal-length
 sʰ              contiguous substring of the ciphertext.
       ∋         One of those
          ≠ᵐ     contains no pair the elements of which are equal,
        ↙.  ∧    and its index is the output.

Perl 5, 46 bytes
Uses @apsillers' regex idea.
$a=<>=~s/./[^$&]/gr;/$a/g;$_=(length$a)/-4+pos

Try it online!

Jelly, 10 9 bytes
ṡ⁹L¤=S€i0

Try it online!
Uses 1-indexing, which is Jelly's default. 10 bytes to use 0-indexing. This returns \$0\$ if no occurrence is found (\$-1\$ for the 0-indexed version)
How it works
ṡ⁹L¤=S€i0 - Main link. Takes M on the left and W on the right
   ¤      - Create a nilad:
 ⁹        -   W
  L       -   Length
ṡ         - Overlapping slices of length W of M
    =     - Compare for equality with W
     S€   - Count the number of 1s in each
       i0 - First index of 0, else 0 if not found

Took me a solid 5 minutes to figure out why the S€ can't be §... if there aren't any slices, = gives W, and § tries to sum the string, but the S of each character leaves them unchanged since they're treated as scalars the same way as integers would be.

SM83/Z80, 30 bytes
First input (encrypted) in hl, second (unencrypted) in de.
Output in bc.
01 00 00 E5 D5 09 7E A7
28 11 1A A7 28 0A BE 23
13 20 F3 03 D1 E1 18 EB
02 FF FF D1 E1 C9

ecr:
 ld bc,0                // 01 00 00 setup bc
oloop:
 push hl                // E5       store originals
 push de                // D5
 add hl,bc              // 09       handle offset
iloop:
 ld a,(hl)              // 7E
 and a                  // A7       test if at end of arg 2
 jr z,succ              // 28 11    if so succeed
 ld a,(de)              // 1A       load encrypted char
 and a                  // A7       if at end
 jr z,fail              // 28 0A    fail
 cp (hl)                // BE       compare to other side
 inc hl                 // 23
 inc de                 // 13       next char
 jr nz,iloop            // 20 F3    if unequal, loop
 inc bc                 // 03       else inc offset
 pop de                 // D1
 pop hl                 // E1       reload originals
 jr oloop               // 18 EB    and jump back
fail:
 ld bc,-1               // 02 FF FF insert failure
succ:
 pop de                 // D1
 pop hl                 // E1       reload original args
 ret                    // C9       return

R, 56 bytes
\(x,y)match(T,Map(\(i)all(x[i+seq(y)]!=y),seq(x)-1),0)-1
Attempt This Online!
Counterintuitively (at least to me), match(TRUE,NA,nomatch=0) returns 0, rather than NA, but this is actually helpful here.
We could save 2 bytes (delete -1) by using R's native 1-based indexing; and a further 1 or 2 bytes by returning nothing (using which()[1]) or NA (delete ,0) to indicate no occurrence.

C++ (gcc), 160 153 150 bytes
#include<map>
int f(std::string c,std::string w){int i=-1,k,e=1;while(e&&w.size()+i++<c.size())for(e=k=0;k<w.size();)e+=c[i+k]==w[k++];return e?-1:i;}

Try it online!

@ceilingcat: you can do
157 bytes
The code fails for two testcases though (as does my original one). I fixed it for a few extra bytes.

Plus, your initialization of k in the outer loop introduced another bug, where with each iteration, one less character was compared.

Turns out, it's even shorter without goto and without all the bugs...

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/