text:
Fill in an increasing sequence with as many numbers as possible
A list of numbers is called monotonically increasing (or nondecreasing) is every element is greater than or equal to the element before it.
For example, 1, 1, 2, 4, 5, 5, 5, 8, 10, 11, 14, 14 is monotonically increasing.
Given a monotonically increasing list of positive integers that has an arbitrary number of empty spots denoted by ?, fill in the empty spots with positive integers such that as many unique integers as possible are present in the list, yet it remains monotonically increasing.
There may be multiple ways to accomplish this. Any is valid.
Output the resulting list.

For example, if the input is
?, 1, ?, 1, 2, ?, 4, 5, 5, 5, ?, ?, ?, ?, 8, 10, 11, ?, 14, 14, ?, ?

it is guaranteed that without the empty spots the list will be
  monotonically increasing
1, 1, 2, 4, 5, 5, 5, 8, 10, 11, 14, 14

and your task is to assign positive integers to each ? to maximize
  the number of distinct integers in the list while keeping it
  nondecreasing.
One assignment that is not valid is
1, 1, 1, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 8, 10, 11, 14, 14, 14, 14, 14

because, while it is nondecreasing, it only has one more unique
  integer than the input, namely 3.
In this example it is possible to insert six unique positive integers and
  keep the list nondecreasing.
  A couple possible ways are:
1, 1, 1, 1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 8, 8, 10, 11, 12, 14, 14, 15, 16

1, 1, 1, 1, 2, 3, 4, 5, 5, 5, 5, 6, 6, 7, 8, 10, 11, 13, 14, 14, 20, 200

Either of these (and many others) would be valid output.

All empty spots must be filled in.
There is no upper limit on integers that can be inserted. It's ok if very large integers are printed in scientific notation.
Zero is not a positive integer and should never be inserted.
In place of ? you may use any consistent value that is not a positive integer, such as 0, -1, null, False, or "".
The shortest code in bytes wins.
More Examples
[input]
[one possible output] (a "*" means it is the only possible output)

2, 4, 10
2, 4, 10 *

1, ?, 3
1, 2, 3 *

1, ?, 4
1, 2, 4

{empty list}
{empty list} *

8
8 *

?
42

?, ?, ?
271, 828, 1729

?, 1
1, 1 *

?, 2
1, 2 *

?, 3
1, 3

45, ?
45, 314159265359

1, ?, ?, ?, 1
1, 1, 1, 1, 1 *

3, ?, ?, ?, ?, 30
3, 7, 10, 23, 29, 30

1, ?, 2, ?, 3, ?, 4
1, 1, 2, 3, 3, 3, 4

1, ?, 3, ?, 5, ?, 7
1, 2, 3, 4, 5, 6, 7 *

1, ?, 3, ?, 5, ?, ?, 7
1, 2, 3, 4, 5, 6, 7, 7

1, ?, ?, ?, ?, 2, ?, ?, ?, ?, 4, ?, 4, ?, ?, 6
1, 1, 1, 1, 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6, 6

98, ?, ?, ?, 102, ?, 104
98, 99, 100, 101, 102, 103, 104 *

Probably a better way to phrase the problem that has a strict input,output pair for verification, would be "What is the highest possible number of distinct numbers in the sequence". That way all answers will output the same number and makes evaluating test cases much easier

@StewieGriffin You can assume the list values and length are below int maximums as usual. I only meant that it's ok to insert very large integers at the end if that's the way your algorithm works.

Haskell, 41 bytes
f takes a list and returns a list, with 0 representing ?s.
f=scanr1 min.tail.scanl(#)0
m#0=m+1
_#n=n

Basically, first scan list from left, replacing 0s by one more than the previous element (or 0 at the start); then scan from right reducing too large elements to equal the one on their right.
Try it online! (with wrapper to convert ?s.)

Mathematica, 84 bytes
Rest[{0,##}&@@#//.{a___,b_,,c___}:>{a,b,b+1,c}//.{a___,b_,c_,d___}/;b>c:>{a,c,c,d}]&

Pure function taking a list as argument, where the empty spots are denoted by Null (as in {1, Null, Null, 2, Null}) or deleted altogether (as in {1, , , 2, }), and returning a suitable list (in this case, {1, 2, 2, 2, 3}).
Turns out I'm using the same algorithm as in Ørjan Johansen's Haskell answer: first replace every Null by one more than the number on its left (//.{a___,b_,,c___}:>{a,b,b+1,c}), then replace any too-large number by the number on its right (//.{a___,b_,c_,d___}/;b>c:>{a,c,c,d}). To deal with possible Nulls at the beginning of the list, we start by prepending a 0 ({0,##}&@@#), doing the algorithm, then deleting the initial 0 (Rest).
Yes, I chose Null instead of X or something like that to save literally one byte in the code (the one that would otherwise be between the commas of b_,,c___).

Hm, prepending 1 you say? I used a 0, because of things like ?, 2. I suspect you would then produce 2, 2 instead of the correct 1, 2.

Excellent point! Luckily the fix is easy.

C 127
Thanks to @ceilingcat for some very nice pieces of golfing - now even shorter
#define p;printf("%d ",l
l,m,n;main(c,v)char**v;{for(;--c;m++)if(**++v-63){for(n=atoi(*v);m--p<n?++l:n))p=n);}for(;m--p+++1));}

Try it online!

@ceilingcat  Getting rid of the index variable was really well done.

05AB1E, 31 23 13 bytes
Saved 10 bytes thanks to Grimy
ε®X:D>U].sR€ß

Try it online!
Explanation
ε      ]       # apply to each number in input
 ®X:           # replace -1 with X (initially 1)
    D>U        # store current_number+1 in X
        .s     # get a list of suffixes
          R    # reverse
           €ß  # take the minimum of each

Why does this only print part of the output? In your TIO example the first 1 is missing.

I know it's been a while, and it can probably be golfed some more, but -3 bytes with some easy golfs: Both }} can be ] to save 2 bytes; and õ-)R can be )˜R to save an additional byte.

@KevinCruijssen: Indeed it could :)

It still can! 16, 15, 13.

@Grimy: Wow, thanks! That suffix trick was really smart!

Pip, 25 23 21 bytes
Y{Y+a|y+1}MgW PMNyPOy

Takes input as multiple space-separated command-line arguments. Outputs the result list one number per line. Try it online! (I've fudged the multiple command-line args thing because it would be a pain to add 25 arguments on TIO, but it does work as advertised too.)
Explanation
We proceed in two passes. First, we replace every run of ?s in the input with a sequence starting from the previous number in the list and increasing by one each time:
? 1 ? 1 2 ? 4 5 5 5 ? ? ? ? 8 10 11 ?  14 14 ?  ?
1 1 2 1 2 3 4 5 5 5 6 7 8 9 8 10 11 12 14 14 15 16

Then we loop through again; for each number, we print the minimum of it and all numbers to its right. This brings the too-high numbers down to keep monotonicity.
                      y is initially "", which is 0 in numeric contexts
                      Stage 1:
 {       }Mg           Map this function to list of cmdline args g:
   +a                  Convert item to number: 0 (falsey) if ?, else nonzero (truthy)
     |                 Logical OR
      y+1              Previous number +1
  Y                    Yank that value into y (it is also returned for the map operation)
Y                      After the map operation, yank the whole result list into y
                      Stage 2:
            W          While loop, with the condition:
               MNy      min(y)
              P         printed (when y is empty, MN returns nil, which produces no output)
                  POy  Inside the loop, pop the leftmost item from y

Brachylog, 43 27 24 22 bytes
-2 bytes thanks to Unrelated String
Ė|a₀ᶠ⟨{a₁+0}ᶜ+⌉⟩ᵐa₁ᶠ⌋ᵐ

Uses 0 as the blank value. Try it online!
How?
Lots of prefixes and suffixes.
We want to perform a two-step process that goes like this:
[0, 1, 0, 0, 0, 3, 0, 0]
[1, 1, 2, 3, 4, 3, 4, 5]
[1, 1, 2, 3, 3, 3, 4, 5]

For the first step, we look at each prefix of the list:
[0]
[0, 1]
[0, 1, 0]
...
[0, 1, 0, 0, 0, 3, 0, 0]

We're going to map each prefix to what its last number would be if we had already completed step 1:
[1] -> 1
[1, 1] -> 1
[1, 1, 2] -> 2
...
[1, 1, 2, 3, 4, 3, 4, 5] -> 5

Observe that nonzero final numbers stay the same, while final zeros are replaced with the result of counting up from the last previous nonzero number (or from 1, if there is no previous nonzero number). Since the list is nondecreasing, the last previous nonzero number is simply the max of the prefix, so our calculation boils down to (max value) + (number of trailing 0s). We collect all the results in a list, and step 1 is completed.
For step 2, we simply take each suffix of the step 1 result and replace it with its minimum.
Code with explanation
Ė|a₀ᶠ⟨{a₁+0}ᶜ+⌉⟩ᵐa₁ᶠ⌋ᵐ

Ė                       If input is empty list, output is empty list
 |                      Otherwise
  a₀ᶠ                   Find all (nonempty) prefixes of input list
                ᵐ       For each prefix:
                         Find how many 0s it ends with:
      {    }ᶜ             Count the number of ways to satisfy this predicate:
       a₁                  Get a suffix
         +                  whose sum
          0                 is 0
                           The numbers are nonnegative, so this means they are all 0
              ⌉          Get the maximum number in the prefix
     ⟨       + ⟩         Add that to the number of trailing 0s
                 a₁ᶠ    Find all (nonempty) suffixes of the resulting list
                    ⌋ᵐ  Take the minimum of each

-2 (plus test suite)

@UnrelatedString Ah, very nice! I usually forget the Variables and Constants page is there, but of course there would be a 1-byte builtin for empty list.

Python 2 with NumPy, 163 bytes
Saved 8 bytes thanks to @wythagoras
Zeros used to mark empty spots
import numpy
l=[1]+input()
z=numpy.nonzero(l)[0]
def f(a,b):
 while b-a-1:a+=1;l[a]=l[a-1]+1;l[a]=min(l[a],l[b])
i=1
while len(z)-i:f(z[i-1],z[i]);i+=1
print l[1:]

More readable with comments:
import numpy
l=[1]+input()           # add 1 to the begining of list to handle leading zeros
z=numpy.nonzero(l)[0]   # get indices of all non-zero values
def f(a,b):             # function to fill gap, between indices a and b
    while b-a-1:
        a+=1
        l[a]=l[a-1]+1   # set each element value 1 larger than previous element
        l[a]=min(l[a],l[b])   # caps it by value at index b
i=1
while len(z)-i:
    f(z[i-1],z[i])      # call function for every gap
    i+=1
print l[1:]             # print result, excluding first element, added at the begining

A few improvements:  if l[a]>l[b]:l[a]=l[b] can be l[a]=min(l[a],l[b]) and then it can be at the line before that. Also, this means that that whole line can be put after the while. And I think l=input() and
l=[1]+l can be l=[1]+input() (Also, in general: If you use two levels of indentation, you can use a space and a tab instead of a space and two spaces in Python 2 (see http://codegolf.stackexchange.com/a/58/))

Also, next to last line can be while len(z)-i:f(z[i-1],z[i]);i+=1 when starting with i=1.

@wythagoras Thank you, good advices. I've added this to the code

Nice, but it is only 163 bytes.

@wythagoras Oh, I forgot to update byte count

PHP, 95 77 71 69 68 bytes
for($p=1;$n=$argv[++$i];)echo$p=$n>0?$n:++$p-in_array($p,$argv)," ";

takes input from command line arguments, prints space separated list. Run with -nr.
breakdown
for($p=1;$n=$argv[++$i];)   # loop through arguments
    echo$p=                     # print and copy to $p:
    $n>0                            # if positive number
        ?$n                             # then argument
        :++$p                           # else $p+1 ...
            -in_array($p,$argv)         # ... -1 if $p+1 is in input values
    ," ";                       # print space

$n is truthy for any string but the empty string and "0".
$n>0 is truthy for positive numbers - and strings containing them.

JavaScript (ES6), 65 bytes
a=>a.map(e=>a=e||-~a).reduceRight((r,l)=>[r[0]<l?r[0]:l,...r],[])

Because I wanted to use reduceRight. Explanation: The map replaces each falsy value with one more than the previous value, then the reduceRight works back from the end ensuring that no value exceeds the following value.

Java 8, 199 164 bytes
a->{for(int l=a.length,n,j,x,i=0;i<l;)if(a[i++]<1){for(n=j=i;j<l;j++)if(a[j]>0){n=j;j=l;}for(j=i-3;++j<n-1;)if(j<l)a[j+1]=j<0?1:a[j]+(l==n||a[n]>a[j]|a[n]<1?1:0);}}

Modifies the input-array instead of returning a new one to save bytes.
Uses 0 instead of ?.
Try it online.
Explanation:
a->{                      // Method with integer-array parameter and no return-type
  for(int l=a.length,     //  Length of the input-array
      n,j,x,              //  Temp integers
      i=0;i<l;)           //  Loop `i` over the input-array, in the range [0, length):
    if(a[i++]<1){         //   If the `i`'th number of the array is 0:
                          //   (And increase `i` to the next cell with `i++`)
      for(n=j=i;          //    Set both `n` and `j` to (the new) `i`
          j<l;j++)        //    Loop `j` in the range [`i`, length):
        if(a[j]>0){       //     If the `j`'th number of the array is not 0:
          n=j;            //      Set `n` to `j`
          j=l;}           //      And set `j` to the length to stop the loop
                          //    (`n` is now set to the index of the first non-0 number
                          //     after the `i-1`'th number 0)
      for(j=i-3;++j<n-1;) //    Loop `j` in the range (`i`-3, `n-1`):
        if(j<l)           //     If `j` is still within bounds (smaller than the length)
          a[j+1]=         //      Set the `j+1`'th position to:
            j<0?          //       If `j` is a 'position' before the first number
             1            //        Set the first cell of the array to 1
            :             //       Else:
             a[j]+        //        Set it to the `j`'th number, plus:
              (l==n       //        If `n` is out of bounds bounds (length or larger)
               ||a[n]>a[j]//        Or the `n`'th number is larger than the `j`'th number
               |a[n]<1?   //        Or the `n`'th number is a 0
                1         //         Add 1
               :          //        Else:
                0);}}     //         Leave it unchanged by adding 0

Perl 6, 97 bytes
{my $p;~S:g/(\d+' ')?<(('?')+%%' ')>(\d*)/{flat(+($0||$p)^..(+$2||*),(+$2 xx*,($p=$2)))[^+@1]} /}

Input is either a list of values, or a space separated string, where ? is used to stand in for the values to be replaced.
Output is a space separated string with a trailing space.
Try it
Expanded:
{                       # bare block lambda with implicit parameter ｢$_｣

    my $p;              # holds the previous value of ｢$2｣ in cases where
                        # a number is sandwiched between two replacements

    ~                   # stringify (may not be necessary)
    S                   # replace
    :global
    /
        ( \d+ ' ' )?    # a number followed by a space optionally ($0)

        <(              # start of replacement

          ( '?' )+      # a list of question marks
          %%            # separated by (with optional trailing)
          ' '           # a space

        )>              # end of replacement

        (\d*)           # an optional number ($2)

    /{                  # replace with the result of:

        flat(

          +( $0 || $p ) # previous value or 0
          ^..           # a range that excludes the first value
          ( +$2 || * ), # the next value, or a Whatever star

          (
            +$2 xx *,   # the next value repeated endlessly

            ( $p = $2 ) # store the next value in ｢$p｣
          )

        )[ ^ +@1 ]      # get as many values as there are replacement chars
    } /                 # add a space afterwards
}

I don't know Perl 6, but in Perl 5 you can use $" instead of ' ' to shave a byte. Does that work here?

@msh210 Almost all of those variables are either gone, or have longer names. About the only one that still exists and has the same purpose is $!. ($/ exists but is used for $1 → $/[1] and $<a> → $/{ qw< a > })

Q, 63 bytes
{1_(|){if[y>min x;y-:1];x,y}/[(|){if[y=0;y:1+-1#x];x,y}/[0,x]]}
Essentially the same algorithm as Ørjan Johansen's Haskell answer.

Assumes ? = 0.
Inserts a 0 at the start of the array in case of ? at start.
Scans the array replacing 0 with 1+previous element.
Reverses the array and scans again, replacing elements greater than
previous element with previous element.
Reverses and cuts the first element out (the added 0 from the
beginning).

Use of min vs last was used to save one byte, since can assume the last element will be the min element given the descending sort of the array.

Cool answer, welcome to the site! :)

TI-Basic (TI-84 Plus CE), 81 bytes
not(L1(1))+L1(1→L1(1
For(X,2,dim(L1
If not(L1(X
1+L1(X-1→L1(X
End
For(X,dim(L1)-1,1,-1
If L1(X)>L1(X+1
L1(X+1→L1(X
End
L1
A simple port of Ørjan Johansen's Haskell answer to TI-Basic. Uses 0 as null value. Takes input from L1.
Explanation:
not(L1(1))+L1(1→L1(1 # if it starts with 0, change it to a 1
For(X,2,dim(L1     # starting at element 2:
If not(L1(X              # if the element is zero
1+L1(X-1→L1(X            # change the element to one plus the previous element
End
For(X,dim(L1)-1,1,-1 # starting at the second-last element and working backwards
If L1(X)>L1(X+1           # if the element is greater than the next
L1(X+1→L1(X               # set it equal to the next
End
L1                   # implicitly return

Python 2, 144 124 119 bytes
l=input()
for n in range(len(l)):a=max(l[:n]+[0]);b=filter(abs,l[n:]);b=len(b)and b[0]or-~a;l[n]=l[n]or a+(b>a)
print l

Try it online!

Uses 0 instead of ?

Doesn't b=filter(abs,l[n:]) equals to b=l[n:]  ?

@DeadPossum filter(abs... filters out all 0's

Oh, that removes zeros, I get it

JavaScript (ES6), 59
A function with an integer array as input. The empty spots are marked with 0
a=>a.map((v,i)=>v?w=v:(a.slice(i).find(x=>x)<=w?w:++w),w=0)

Test

var F=
a=>a.map((v,i)=>v?w=v:(a.slice(i).find(x=>x)<=w?w:++w),w=0)

;[[2, 4, 10]
,[1, 0, 3]
,[1, 0, 4]
,[]
,[8]
,[0]
,[0, 0, 0]
,[0, 1]
,[0, 2]
,[0, 3]
,[45, 0]
,[1, 0, 0, 0, 1]
,[3, 0, 0, 0, 0, 30]
,[1, 0, 2, 0, 3, 0, 4]
,[1, 0, 3, 0, 5, 0, 7]
,[1, 0, 3, 0, 5, 0, 0, 7]
,[1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 4, 0, 0, 6]
,[98, 0, 0, 0, 102, 0, 104]]
.forEach(a=>{
  console.log(a+'\n'+F(a))
})

C# (.NET Core), 182 bytes
Using the same strategy as Ørjan Johansen.
Uses 0 in the input list to mark the unknown var.
l=>{if(l[0]<1)l[0]=1;int j;for(j=0;j<l.Length;j++)l[j]=l[j]==0?l[j-1]+1:l[j];for(j=l.Length-2;j>=0;j--)l[j]=l[j]>l[j+1]?l[j+1]:l[j];foreach(var m in l) System.Console.Write(m+" ");};

Try it online!

Perl 5 -p, 99 bytes
s,(\d+ )?\K((\? )+)(?=(\d+)),$d=$1;$l=$4;$2=~s/\?/$d<$l?++$d:$l/rge,ge;($d)=/.*( \d+)/;s/\?/++$d/ge

Try it online!


text:
Prison Architect, ASCII version
Here is a diagram of a prison using ASCII characters:
+------------------------------+
|                              |
|   X               X          |
|                              |
|                              D
D                              |
|                              |
|                              |
|        X           X   X     |
|                              |
+------------------------------+

Walls are made out of pipe characters |, dashes -, and pillars + for corners and intersections. There are also two doors marked with D (which will always be on the left and right walls). The prison is filled with scary people marked with X.
The goal is to build walls to satisfy the following:

Each person is in solitary confinement;
There is a corridor running between the two doors;
Each cell contains exactly one door, which is directly connected to the main corridor;
All space in the prison is used by the cells and the corridor;
Each cell contains a person (that is, there are no empty cells).

The corridor is a single path, doesn't branch off, and is always one character wide. Here's a solution for the prison above:
+---------+--------------------+
|         |                    |
|   X     |         X          |
|         |           +--------+
+------D--+-----D-----+        D
D                       +---D--+
+----D--------+---D-----+      |
|             |         |      |
|        X    |      X  |X     |
|             |         |      |
+-------------+---------+------+

You can assume that any input prison will always have a valid output. Here are some more input prisons, along with possible outputs:
+------------------------------+
|X X X X X X X X X X X X X X X |
|                              |
D                              D
|                              |
|              X               |
+------------------------------+

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+
|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X |
+D+D+D+D+D+D+D+D+D+D+D+D+D+D+D-+
D                              D
+----------------------D-------+
|              X               |
+------------------------------+

+-----------+
|X          |
|           |
|           |
|X         X|
|           |
|          X|
|           |
D           D
+-----------+

+-+-------+-+
|X|       D |
| D +---+ | |
+-+ |     | |
|X| | +---+X|
| | | |   +-+
| D | |    X|
+-+ | +-D---+
D   |       D
+---+-------+

+----------------+
|X    X    X    X|
|                |
D                |
|                |
|X    X    X     |
|                |
|                |
|                |
|     X    X     D
|                |
|                |
+----------------+

+---+---+----+---+
|X  | X |  X |  X|
+--D+--D+---D+--D+
D                |
+---+---+------+ |
|X  | X |  X   | |
+--D+--D+---D--+ |
|                |
| +-----+------+-+
| |   X |  X   | D
| +----D+---D--+ |
|                |
+----------------+

Possible solution: pathway first rooms next

Related, might be helpful when constructing the walls.

What is preventing me to put walls and a door directly around each prisoner (like in your second example) and declare the rest of the space as a corridor?

Sorry, found it: "one character wide".

This may help.

Python 2, 2986 2881 2949 2135 2075 2071 1996 bytes

Saved 105 bytes, implemented the program as a function to comply with standard rules. Implemented Wheat Wizard's tab and space suggestion.
Added 68 bytes due to fixing a bug.
Saved 814+51 bytes thanks to Halvard Hummel.
Saved 9+4 bytes.
Saved 4 bytes thanks to Erik the Outgolfer.
Saved 71 bytes thanks to ppperry's suggestion.

exec r"""def Z(P):
 H,n,I,o,O,i,d,D,W=[type,range]+list(" dD#xX*");R=(1,0),(-1,0),(0,1),(0,-1)
 def F(j,k,l):P[j][k]=l
 def E(j,k,v,w):
	if G(j,k,v):F(k,j,w)
 def q(b,c,d):[[E(j+J,k+K,b,c)for J,K in M]&L if G(j,k,d)]
 def A(e,r,l,o,q):
	S,E,P[q][o],Q,X=P[q][o],e,0,[(o,q)],0
	for a,b in Q:
	 &R:
		x,y=a+j,b+k
		if(0<=x<w!=0<=y<h)<1:continue
		if e in((x,y),P[y][x]):X=1;e=x,y;break
		if I!=P[y][x]:continue
		F(y,x,P[b][a]+1);Q+=[(x,y)]
	 if X:break
	p,i=e,0
	while(o,q)!=p:
	 a,b=p;P[b][a],m=[r,l][l and i==1],0
	 &R:
		x,y=a+j,b+k
		if(0<=x<w!=0<=y<h)-1:continue
		if(H(P[y][x])==H(0))*(m==0 or P[y][x]<P[m[1]][m[0]]):m=x,y
	 p=m;i+=1
	P[q][o],P[e[1]][e[0]]=S,E;[F(k,j,I)&L if H(P[k][j])==H(0)]
 def B(N):
	[[E(j,k,"x*",I),0<j<w-1 and E(j,k,O,I)]&L]
	&L:
	 if G(j,k,D):[E(j+J,k+K,I,d)for J,K in M]
	 if G(j,k,O)and j==0:T=0,k
	if N:A(O,o,0,*T)
	U,V=M[-1];[[[F(k+K,j+J,I)for J,K in M if(P[k+K][j+J]!=i)*((0<=j+J+U<w!=0<=k+K+V<h and G(j+J+U,k+K+V,D))<1)],F(k,j,W),A(o,W,O,j,k),q(I,d,W),F(k,j,D)]&L if G(j,k,D)];q("xX*# @+-|",i,o)
 for j in"|+-":P=P.replace(j,i)
 P=list(map(list,P.split("\n")));h=len(P);w=len(P[0]);b,L,M,G="#+-|D",[(k,j)for k in n(w)for j in n(h)],[(k-1,j-1)for k in n(3)for j in n(3)if(j,k)!=(1,1)],lambda j,k,v:P[k][j]in v
 B(1);Y=lambda:0<j<w-1!=0<k<h-1and G(j,k,i);[[[F(k,j,o),F(k+g,j+N,i)]for N,g in((-1,-1),(-1,1),(1,-1),(1,1))if P[k][j+g]+P[k][j-g]==P[k+N][j+g]+P[k-N][j]==P[k+N][j]+i==o+i]&L if(j in(1,w-2)or k in(1,h-2))*Y()for N in n(w*h)];[F(k,j,I)&L if Y()];B(0)
 def c(x,y,b,l,d,f,Q):
	F(y,x,b)
	for J,K in M:Q+=[[],[(x+J,y+K)]][G(x+J,y+K,l)];E(x+J,y+K,d,f)
 &L:
	if G(j,k,D):Q=[(j,k)];[c(x,y,"@",W,d,I,Q)for x,y in Q if G(x,y,"X*")];[G(u,v,"X*")and[E(u+U,v+V,I,d)for U,V in M]or E(u,v,"@",I)for u,v in L];Q=Q[:1];[c(x,y,"$",I,"x*",i,Q)for x,y in Q];F(k,j,D)
 &L:E(j,k,"@$d",I);X=(k>0and G(j,k-1,b))+(k<h-1and G(j,k+1,b))-(j>0and G(j-1,k,b))-(j<w-1and G(j+1,k,b));E(j,k,i,{2:"+",X:"|",-X:"-"}[2])
 print"\n".join("".join(p)for p in P)""".replace("&","for j,k in ")

Try it online!
It was golfed down significantly; yet there may still be room for improvement. This piece of code, however, solves all test cases. Does not run very efficiently; for large prisons the architect may take their time to figure it out.
Uses a simple pathfinding algorithm to connect both doors and the prisoners to the corridor. Then it encapsulates all prisoners and their walls and pushes said walls in empty space until all of it is filled. As a final step, the ASCII art appearance is implemented.
Took me for sure several hours to write. I hope it also works on other prisons than the test cases. (You cannot test them all, can you?)

For multiple levels of indentation you can alternate spaces and tabs.  (space = 1 indent, tab = 2 indents)

Also this is a snippet.  Meaning you take input from a pre-initialized variable (P).  This is not an allowed IO format.  You should use either input() or define a function.

Being that this is such a large piece of code,  there are also about a hundred smaller things I see that can be golfed.  I'm not going to list them all now.  But if you would like me to help you go through them you can ping me in chat.  Since you are a relatively new user I don't know how familiar with python golfing you are.  Perhaps your still working on golfing this by yourself. :)

Here is a way shorter version that implements a few of the tricks I saw.  It's by no means the furthest it can be golfed down, I don't even know your algorithm.  But its about 300 bytes shorter.  It is still a snippet though, so you will need to make it comply.

90 bytes shorter, might've missed some too.

2262 bytes

2135 bytes

Thanks to Wheat Wizard, Erik the Outgolfer and Halvard Hummel for golfing suggestions; I now implemented Halvard Hummel's golfed solution as it currently is the shortest.

2084 bytes
Should be possible to golf this to under 2000 bytes

2075 bytes Golfed the second line.

You can save a few more bytes by wrapping the code in an exec statement and .replaceing a single character with for j,k in. That code sequence has length 10, and is used 11 times, well within the r side of the table (even though extra quote characters will add four more bytes)

3 more bytes saved (also you can replace the last return with print for another one)

@HalvardHummel The goal is reached; we are under 2000 bytes!

@EriktheOutgolfer Since it now seems more likely than ever that our paths will diverge, I wanted to thank you for the over two years we both participated on PPCG. Farewell and happy golfing!

C, 3732 3642 bytes
I could definitely golf this a bit further, but it is a pretty nice start. I did not initially know that my approach had a name so shout out to @TehPers for giving me a name to research. I definitely enjoyed the challenge that this question offered. :)
-63 bytes from @Jonathan's suggestions. I also replaced char with typedef char R and replaced all character literals that are smaller than 100 with their ASCII values for a total of 90 bytes
A quick explanation of my code.

Convert char array to an ideal integer array (0 is space, 1 is wall, etc.)
Generate the Voronoi diagram using the people as the points
Use the intersections (a 5 surrounded by at least three other 5s) as pivot points for the path
Create the corridor using a directionally biased path finding algorithm (if it's going one way, favor paths that do not change direction). It also modifies the grid so that it favors traveling next to an already made corridor.
Regenerate diagram to place final walls. Ensures that all space is used.
Convert map back to a properly formatted ASCII representation and print.

To use this program, pass the map as either a string with newline characters or with each level seperated by a space as in the following example.
program-name.exe "+-----------+ |X          | |           | |           | |X         X| |           | |          X| |           | D           D +-----------+ "

+------+----+
|X     |    |
|    +D+-+  |
+----+   |  |
|X   | + D X|
|    | | +--+
|    | | | X|
+D---+ | +-D+
D      |    D
+------+----+

code
typedef int Q;typedef char R;typedef struct{Q x,y,v;}P;w,h,A,Y,Z,x,y,i,j,e,f,m,n,v;P*t,*u,*s;I(R*a,Q x,Q y,R c){a[x+y*w]=c;}G(Q*a,Q x,Q y){if(x>-1&&x<w&&y>-1&&y<h)return a[x+y*w];return-1;}J(Q*a,Q x,Q y,Q c){a[x+y*w]=c;}P*E(Q n,Q*a,Q*c){P*r=0;for(i=v=0;i<A;i++)if(a[i]==n)r=(P*)realloc(r,sizeof(P)*(v+1)),r[v].x=i%w,r[v].y=i/w,r[v].v=v,*c=++v;return r;}C(Q*a,Q x,Q y,Q b){return(G(a,x-1,y)==b)+(G(a,x+1,y)==b)+(G(a,x,y-1)==b)+(G(a,x,y+1)==b);}H(Q*a,Q b){P q[A],r[A];m=Y,n=0;for(i=0;i<Y;i++)q[i]=t[i];while(m){while(m){x=q[m-1].x,y=q[m-1].y,v=q[m-1].v;i=G(a,x,y);if(i!=b&&i!=1){for(f=-1;f<2;f++){for(e=-1;e<2;e++){i=G(a,x+e,y+f);if(i==0){J(a,x+e,y+f,v+8);r[n].x=x+e;r[n].y=y+f;r[n].v=v;n++;}else if(i>=8&&i!=v+8)J(a,x+e,y+f,b);}}}m--;}for(i=0;i<n;i++)q[i]=r[i];m=n;n=0;}}B(P p,Q*a,Q*b){for(i=m=n=0;i<A;i++)if(b[i]>-2)b[i]=-1;P q[A],r[A];q[0]=p,q[0].v=0,b[p.x+p.y*w]=0;while(m+1){while(m+1){x=q[m].x,y=q[m].y,v=q[m].v;for(f=-1;f<2;f++){for(e=-1;e<2;e++){if(e!=0&&f!=0||(x+e<0||x+e>=w||y+f<0||y+f>=h))continue;i=G(a,x+e,y+f);if(i!=7&&i!=1&&i!=0){j=3;if(i==4||i==5)j=1;if(x+e!=p.x&&y+f!=p.y)j++;Q*p=&b[x+e+(y+f)*w];if(*p!=-2&&(*p==-1||*p>v+j)){*p=v+j;if(i!=2)r[n].x=x+e,r[n].y=y+f,r[n].v=v+j,n++;}}}}m--;}for(i=0;i<n;i++){q[i]=r[i];}m=n-1,n=0;}}D(P S,P*T,Q n,P U,Q*a){Q m[A];Q x,y,v=0,c=0,d=1,d1=1;for(i=0;i<n;i++)T[i].v=0;for(i=0;i<A;i++)m[i]=-1;x=S.x,y=S.y;if(n==0){B(U,a,m);goto fin;}while(v<n){j=-1;for(i=0;i<n;i++)if(T[i].v==0)if(j==-1||abs(T[i].x-x)+abs(T[i].y-y)-(T[i].x==x)*!d*2-(T[i].y==y)*d*2<abs(T[j].x-x)+abs(T[j].y-y)-(T[j].x==x)*!d*2-(T[j].y==y)*d*2)j=i;T[j].v=1;B(T[j],a,m);fin:v++;c=m[x+y*w];while(c>0||c==-1){Q tx,ty;j=-1;for(f=-1;f<2;f++){for(e=-1;e<2;e++){if(e!=0&&f!=0)continue;if(x+e<0||x+e>=w||y+f<0||y+f>=h)continue;i=G(m,x+e,y+f);if(i>-1&&(i<c||c==-1)){if(j==-1||j>i||((e*d||f*!d)&&j==i)){j=i;tx=x+e,ty=y+f;d1=e!=0;}}}}J(m,x-1*!d1,y-1*d1,-2);J(m,x+1*!d1,y+1*d1,-2);d=d1;x=tx,y=ty,c=j;if(G(a,x,y)!=2)J(a,x,y,0);}for(f=0;f<h;f++)for(e=0;e<w;e++)if((i=G(a,e,f))>3&&i!=7)if(C(m,e,f,-2))J(a,e,f,5);if(v==n){B(U,a,m);goto fin;}}}main(Q c,R**v){R*a=v[1];w=strchr(a,'|')-a;h=(strchr(a+w,43)-a)/w+1;A=w*h;Q p[A];for(y=0;y<h;y++)for(x=0;x<w;x++){c=a[x+y*w];J(p,x,y,0);if(c==45||c=='|'||c==43)J(p,x,y,1);if(c==68)J(p,x,y,2);if(c==88)J(p,x,y,3);}t=E(3,p,&Y);u=E(2,p,&Z);H(p,5);for(c=0;c<Y;c++)for(y=-1;y<2;y++)for(x=-1;x<2;x++)if(G(p,t[c].x+x,t[c].y+y)>=4)J(p,x+t[c].x,y+t[c].y,7);for(y=1;y<h-1;y++)for(x=1;x<w-2;x++)if(G(p,x,y)==5)if(C(p,x,y,5)>2)J(p,x,y,4);s=E(4,p,&c);for(i=0;i<c;i++)s[i].v=0;for(y=1;y<h-1;y++)for(x=1;x<w-2;x++)if(G(p,x,y)>=8)if(C(p,x,y,5))J(p,x,y,4);i=u[0].x!=0;D(u[i],s,c,u[!i],p);for(y=0;y<h;y++){for(x=0;x<w;x++){i=0;if(G(p,x,y)>2){for(f=-1;f<2;f++)for(e=-1;e<2;e++)i+=G(p,x+e,y+f)==0;if(i>0)J(p,x,y,6);}}}free(s);for(i=0;i<A;i++)if(p[i]>=7||p[i]==4||p[i]==5)p[i]=0;for(y=0;y<h;y++){for(x=0;x<w-1;x++){if((x==0||x==w-2||y==0||y==h-1)&&G(p,x,y)!=2)J(p,x,y,1);}}H(p,1);P q[A],r[A];for(i=0;i<Y;i++){m=1,n=0;q[0]=t[i];while(m){while(m){x=q[m-1].x,y=q[m-1].y;for(f=-1;f<2;f++){for(e=-1;e<2;e++){if(e!=0&&f!=0)continue;c=G(p,x+e,y+f);if(c==6){if(G(p,x+e*2,y+f*2)==0){J(p,x+e,y+f,2);m=1,n=0;e=f=2;}}else if(c!=1&&c!=3&&c!=7){J(p,x+e,y+f,7);r[n].x=x+e;r[n].y=y+f;n++;}}}m--;}for(c=0;c<n;c++)q[c]=r[c];m=n;n=0;}}for(i=0;i<A;i++)if(p[i]==6)p[i]=1;R b[A];for(y=0;y<h;y++){for(x=0;x<w;x++){c=G(p,x,y);I(b,x,y,32);if(c==1){i=0;if(G(p,x,y-1)==1||G(p,x,y-1)==2)i|=1;if(G(p,x,y+1)==1||G(p,x,y+1)==2)i|=2;if(G(p,x-1,y)==1||G(p,x-1,y)==2)i|=4;if(G(p,x+1,y)==1||G(p,x+1,y)==2)i|=8;if(i==3)I(b,x,y,'|');else if(i==12)I(b,x,y,45);else I(b,x,y,43);}if(c==2)I(b,x,y,68);if(c==3)I(b,x,y,88);if(x==w-1)I(b,x,y,10);}}b[A-1]=0;puts(b);}

I know that it is good practice in C to free memory when you are done with it, yet when golfing it takes unnecessary bytes. You could save 16 bytes by simply removing free(t);free(u); at the end of your program.
Also, '\0' is equal to 0, saving another 3 bytes.

If you add something like typedef int Q; and replace all occurrences of int with Q, you could save another 44 bytes.

source: Stack Exchange

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

sort: votes


text:
Grids can be curvy. How long is yours?
Consider depicting a simple, open, two-dimensional curve on a W wide by H high grid of text where X represents part of the curve and . represents empty space and no other characters are used.
Every grid space has 8 neighboring grid spaces, its Moore neighborhood. Grid spaces beyond the borders are considered empty.
A grid contains a curve if it has exactly one X OR if it has more than one X where:

Exactly two Xs have only one neighboring X. These are the curve's endpoints.
Every X besides the endpoints neighbors exactly two Xs. These form the bulk of the curve.

For example, this grid where W = 9 and H = 4 contains a curve:
....X....
.X.X.X.X.
X..X..X.X
.XX.....X

Likewise, these grids (W = 4, H = 3) have curves:
....  .X..  ....  ....  .X.X
....  X..X  ..X.  XX..  X.X.
..X.  .XX.  .X..  ....  ....

These grids, however, do not contain a curve:
....  .XX.  ...X  XX..  ....  X.X.
....  X..X  ..XX  XX..  .X.X  .X..
....  .XX.  .X..  ....  ...X  X.X.

We can find the length of a curve by summing the distances between all neighboring pairs of Xs:

The distance between two orthogonally neighboring Xs is 1 unit.
XX
X
X
The distance between two diagonally neighboring Xs is √2 units.
X.
.X
.X
X.

For example, the length of the curve in the grid
XXX.
...X
..X.

can be visualized as

so we can see it is 1 + 1 + √2 + √2 = 4.828427...

The length of a curve with only one X is zero.
When a grid does not form a curve its length is not well defined.
Challenge
Given a grid of text of Xs and .s, output the length of the curve it contains, or else output something such as -1 or Null to indicate the grid has no curve.
For input you may use other characters than X and . if desired, and H and W may be taken as input if needed. Input as a nested list or matrix filled with 1s and 0s instead of a string is also fine.
You may output a float for the curve length or alternatively two integers A and B where length = A + B*√2.
The shortest code in bytes wins.
Test Cases
XXX.
...X
..X.
2 + 2*√2 = 4.828427...

....X....
.X.X.X.X.
X..X..X.X
.XX.....X
3 + 8*√2 = 14.313708...

....
....
..X.
0 + 0*√2 = 0

.X..
X..X
.XX.
1 + 3*√2 = 5.242640...

....
..X.
.X..
0 + 1*√2 = 1.414213...

....
XX..
....
1 + 0*√2 = 1

.X.X
X.X.
....
0 + 3*√2 = 4.242640...

....
....
....
....
-1

.XX.
X..X
.XX.
-1

...X
..XX
.X..
-1

....
.X.X
...X
-1

X.X.
.X..
X.X.
-1

I recommend allowing the solver to choose their output format for grids that have no curves (any consistent value that's not of the form m + n*sqrt(2) for any m,n≥0).

@Greg Sounds fine. Done

[x.x,...,.x.] isn't a valid curve, right?

@carusocomputing correct

MATL, 52 51 bytes
t2Y6~Z+*ssGt3Y6Z+*tt1=z2=wssGzqE=*Gz1=+?}_q]ssy-h2/

Input is a matrix of zeros and ones.
Output is B, then A. Non-curves give a negative A.
Try it online! Or verify all test cases.
Explanation
Computing the length of the curve uses two 2D convolutions1: one with the Moore mask, and another with a mask containing only the diagonal neighbours. The results are two matrices with the same size of the input, which will be denoted as M and D respectively. M gives the total number of neighbours for each point, whereas D gives the number of diagonal neighbours.
The results in M and D must be filtered to discard points that don't belong to the curve. Also, they must be divided by 2, because "being neighbour of" is a a symmetric relation, so each point in the curve is counted twice.
Determining if the curve is valid is more cumbersome than I expected. To do this, the code tests three conditions:

Does the number of ones in M equal 2? (That is, are thre exactly two points with a single neighbour?)
Does the total sum of M equal the number of points in the input curve times 2 minus 2? (Together with condition 1, this tests if all non-zero values in M except two of them equal 2)
Does the input curve contain a single point?

The curve is valid if conditions 1 and 2 are true, or if condition 3 is.
t       % Implicit input matrix of zeros and ones. Duplicate
2Y6~    % Push [1 0 1; 0 0 0; 1 0 1]
Z+      % 2D convolution, keeping size
*       % Multiply to zero out results for non-curve points. Gives matrix D
ss      % Sum of matrix D
Gt      % Push input again wtice
3Y6     % Push [1 1 1; 1 0 1; 1 1 1]
Z+      % 2D convolution, keeping size
*       % Multiply to zero out results for non-curve points. Gives matrix M
tt      % Duplicate twice
1=z     % Number of ones
2=      % Does it equal 2? This is condition 1
wss     % Swap. Sum of matrix
G       % Push input again
zqE     % Number of nonzeros values minus 1, and then multiplied by 2
=       % Are they equal? This is condition 2
*       % Multiply. This is a logical AND of conditions 1 and 2
G       % Push input again
z1=     % Does it contain exactly one nonzero value? This is condition 3
+       % Add. This is a logical OR with condition 3
?}      % If result was false
  _q    %   Negate and subtract 1. This makes sure we get a negative value
]       % End
ss      % Sum of matrix M
y       % Duplicate sum of matrix D from below
-       % Subtract
h       % Concatenate horizontally
2/      % Divide by 2. Implicitly display

1 Convolution is the key to success.

Python 3, 316 315 311 bytes
I think this covers all cases; at least the test cases work.
Also, there surely is still a lot to golf down, probably in the beginning where the edge cases are handled.
def f(d,R,C):
 s=sum;d=[0]*(C+2),*[[0,*r,0]for r in d],[0]*(C+2);o=-1,0,1;k=[[[(1,0),(0,1)][i*j]for i in o for j in o if d[r+i][c+j]and i|j]for c in range(1,-~C)for r in range(1,-~R)if d[r][c]];w=[x/2for x in map(s,zip(*s(k,[])))]or[0,0];print([w,-1][s(w)!=s([s(z)for z in d])-1or[len(t)for t in k].count(1)>2])

Try it online!
How it works:

d,R,C are 1. a list of lists with 1 as curve and 0 as background, 2. row and column count
Insert a row of 0's before and after and a column of 0's before and after d so we don't have to worry about the edge of the 2d array
For every 1 in the 2d array, scan the neighbourhood for 1's and add (1,0) to a list if the relation is diagonal, else add (0,1)
Sum all tuples, so that (n,m) represents the number of diagonal and non-diagonal neighbours, respectively
Check if the number of relations is exactly the number of 1's minus one; if not, not a curve.

Thanks to @Helka Homba for pointing out a missing case.
Thanks to @TuukkaX and @Trelzevir for the golfing tips.

Looks like d=[[1,0,1],[0,1,0],[1,0,1]] will fail here (added testcase).

@HelkaHomba You're right, I oversaw that. Thanks!Fixed it (now unfortunately with more bytes).

s=sum saves 4 bytes.

Mathematica, 153 150 bytes
Switch[Sort[Join@@BlockMap[If[#[[2,2]]<1,Nothing,Tr[Tr/@#]]&,#~ArrayPad~1,{3,3},1]],{1},0,{2,2,3...},1/.#~ComponentMeasurements~"PolygonalLength",_,]&

Takes a 2D array, with 0s for .s and 1s for Xs. Outputs Null for non-curves.
1/.#~ComponentMeasurements~"PolygonalLength"&

Mathematica has a 45-byte built-in for this, but it outputs some numbers for non-curves and 1/sqrt(2) for input {{1}}. Correcting these cost 105 bytes (could be golfed?).

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


text:
Output the text "Code Bowling"
Code-Bowling
You've been hired by Brunswick Bowling to create a simple program to output the text Code Bowling on their monitors. This company is worth a pretty penny and you feel you can swindle them for quite the bit of cash.
The job description clearly states that they pay on a scoring basis and you're pretty confident you can manipulate their scoring system to your advantage and get the largest pay check possible from these guys. To do so will require you packing as much code as you can into your program/function, even though their scoring system is designed to prevent you from doing so.
Get out your piggy banks, let's code!

Challenge
The challenge is to simply output the text Code Bowling, exactly as it is written here, with the highest score possible. (See section: Scoring System below)
Leading and trailing new-lines (line-breaks) are acceptable.
Your code may be an entire program or just an executable function.

Rules
Obligatory: This challenge is using Code-Bowling: Common Rules, Revision 1.0.0; See Meta for details.

Character : Byte Ratio
In Code-Bowling a character-count is preferred over a byte-count. The obvious reasoning for this is that multi-byte unicode characters (e.g. ) can be used in place of single-byte unicode characters to fluff up byte count and will make bowling more about who renames the most variables with high-byte unicode characters rather than who most strategically creates meaningful complex code.
Variable/Function/Object Names
All variable names (or object pointers, function names, etc) should be 1 character long. The only acceptable time to use 2-character variables names is after all possible 1-character variables have been used. The only acceptable time to use 3-character variables names is after all possible 2-character variables have been used. Etc.
Un-used Code
All code must be used. Meaning the program must fail to always properly complete the task if any individual character (or varying set(s) of characters) is/are removed. Naturally, a subset of the program should not be able complete the task on its own without the rest of the program.
Comments
Comments are not permitted towards character-count, unless somehow utilized by your program/function.

Scoring System:
  Pangram Challenge:
A pangram is a sentence that uses every letter at least once. (The quick brown fox jumps over the lazy dog).
This challenge-type has a scoring systems designed where a perfect pangram would achieve the theoretical maximum score (though you are not required to use every character at least once.) Additionally, using any character more than once will start incurring a penalty. This challenge also expands to more than just the alphabetical characters.
  Scoring Metric:

Each character used increases your score by 1.
Repeated use of any alphanumeric character (a-z, A-Z, 0-9) will result in a deduction of 3 points per repeat (first use does not
  result in a deduction).
Repeated use of basic punctuation ([!?.-,":';]) - including the brackets - will result in a deduction of 2 points per repeat.
Repeated use of other ASCII characters {`~@#$%^&*_+=|\/><} - including the curly brackets - will result in a deduction of 4 points
  per repeat.
Use of spaces, tabs, and newlines will result in a deduction of 1 point per use. That is, they do not count towards
  character total.
Characters not mentioned above (Exotic Characters) will result in a deduction of 1 point per use. That is, they do not count towards
  character total.

  Scoring Tool:
An automated scoring widget has been created and can be found here.

This is a code-bowling variant. The program with the highest score wins! (Since there is a maximum score of 94, whoever reaches it first (if it can be reached) will be marked as the accepted answer, though others are free to keep answering for fun)

I managed to get a score of -75k. If this was lowest score I'd be doing amazingly.

How should command line arguments be counted? Do we ignore them, or treat them as if they were part of the code?

Bowling rule #3 implies rule #4, doesn't it?

How has brainfuck not won this yet? Oh right... Repeated characters.

@JanDvorak Indeed ಠ_ಠ

@carusocomputing Try headsecks. The score will probably still be awful. Also, you couldn't really use BF, since any non-commands are comments and could be removed.

Delimit would be good for this, because it doesn't really care what characters you use, just the combined ASCII of a set of characters

Shortest code would be a nice tiebreaker on this challenge!

@StewieGriffin That would be good, I wish I had included that in the original challenge, unfortunately I declared whoever reaches it first (if it can be reached) will be marked as the accepted answer in the post before the first 94 answer was made. I feel changing the ruling now would be unfair to the winner unless he's willing to have it changed for the sake of competition!

Maybe someone can solve that by awarding bounties to the other 94-ers

Glypho, 94
The source file is encoded in CP437.
␀␀!"☺☺#$☻♥♥☻♦♣♦♣%♠♠&•◘•◘'○○(◙♂◙♂♀♪♪♀♫☼♫☼►◄◄►↕↕)*‼¶¶‼§§+,▬↨↨▬↑↓↑↓→←→←∟∟-.↔▲▲↔/▼▼▼⌂Ç⌂Çüééüââ01ää23àååàçêçê4ëë5èïèïîî67ìÄÄì8ÅÅ9ÉÉ:;æÆÆæô<=ôöòòöûùûù>ÿÿÿÖÖ?@ÜÜAB¢££¢¥₧¥₧CƒƒDáíáíóóEFúññúÑªÑªGººHI¿¿J⌐¬⌐¬K½½½¼¼LM¡««¡N»»»░░OP▒▒QR▓││▓┤╡┤╡S╢╢T╖╕╖╕U╣╣V║╗║╗╝╜╜╝W╛╛╛┐X┐┐Y└└└┴┬┴┬├─├─Z┼┼┼╞╞[\╟╟]^╚╔╔╚╩╦╩╦_╠╠`═╬═╬╧╨╨╧╤╥╥╤a╙╙╙╘╘bc╒╒de╓╓fg╫╪╪╫┘┌┌┘█▄█▄▌hi▌▐j▐▐▀αα▀ßΓßΓπΣπΣkσσσµlµµτmnτΦΘΘΦΩδΩδo∞∞∞φpφφεεqr∩≡≡∩±±st≥≤≤≥u⌠⌠⌠⌡⌡vw÷xy÷≈°°≈∙∙z{·|}·√ⁿⁿ√~²²²

Try it online!
Explanation
Glypho is quite useful for challenges like this because it doesn't care about the actual characters being used at all. Instead it looks at each chunk of 4 characters and the command being used is determined by the pattern these four characters make:
0000 n
0001 i
0010 >
0011 \
0012 1
0100 <
0101 d
0102 [
0110 +
0111 o
0112 *
0120 -
0121 ]
0122 !
0123 e

That means we can just solve the problem and then fill in unique characters in each quartet with the printable characters and all the repeated ones with some of the "exotic" characters, which are ignored by the scoring. Glypho is sufficiently verbose that a normal handwritten solution contains enough unique characters to fit all the 94 printable ones inside. In fact, I ended up golfing it down until it had exactly 94, just so that I could use unique exotic characters for the repeated ones (hopefully, to make it harder to reduce the program).
The shorthand form of the above program is this:
11+d*d*d+d+1+1+dd1+o
d+11+d*d1+*1+-+do
11+d*d1+d**do
1+o
11+d*d*d+o
<o
ddo
11+d*d++o
111++d-<+ddo
<-+do
<1+1+o
1-+1-+o

Where each line prints one of the characters.
I've used this Retina script to convert it to Glypho using 0123. Afterwards, I've just filled in the characters in place of the digits.
In theory it might be possible to reduce this further, if someone managed to golf down the shorthand program and then managed to recombine the characters such that the right patterns show up, but I'm not sure how to prove or disprove that this is possible. If anyone manages to form a valid solution from a subset of my program, please let me know so I can delete the answer until it's fixed. Until then, I'll have to assume that this is valid.

Great stuff! I'm accepting this for now since 94 is the maximum score. Everyone else is free to keep submitting answers for fun though.

Great job, Martin! If only I'd been a few hours faster... :D

@AlbertRenshaw Maybe the tie-breaker should be byte-count? :D

Python 3, 82 87 88
Thanks to @JonathanAllan for +1 score
print("g!#$%&'*n+,./012i34579;<l=>?@ADEwFGHIJKLoMNOPQRSBTUVWXYZ ^_`abchejkmqsuvdyz{|}~ \x6f       C"[::-8])

Try it online!
Nothing special, just slicing and skipping characters. The string is reversed so you can't remove characters and have the original string being printed.

Woah. that is good.

Very nice answer, but why the shuffled order? Wouldn't it be simpler (for you) to have it in the order they are naturally (HIJKLMN...) except for every 8th character of course?

@StewieGriffin It would have been easier, yes. I just iterated through sets and didn't really care about sorting.

Is there a reason you filled the other characters in such a strange order?

You're such as inspiration TidB! My new question :)

Score 92: Try it online!

><>, 92 94
YAY, I DID IT!
␑ is the exotic character \x11 with decimal value 17. The program exits with an error after printing the result (it's a stack underflow). I had to manage which mirrors and directional commands I used carefully, since I can only use each one once.
   >"vCoUV␑3`h]Z_X
       /a[f+
#$%&'r(!
.0456~8?
:;<=@9l)
ABDEFcGe
HIJKL*
MNOPQ7
RSTWYd
bgijk1
mnqst-
uwxyz2
{|}  ,
     \p^

Try it online
The core program:
   >"vCoUV␑3`h]Z_X
       /a[f+
     r !
     ~ ?
     9 )
     c e
     *
     7
     d
     1
     -
     2
     ,
     \p^
Explanation:
Push the string vCoUV␑3`h]Z_X   > (execution wraps). Move downward. Reverse the stack and remove the v.
Push 9 and c (12). Multiply to get 108 (l). Push 7. Push d (13), subtract 1, divide by 2 to get 6. Put l at (x,y) of (13,6), which is below the e. I could've done this way shorter, but this is lengthened so I have room to put more ASCII characters.
Move up into a loop. Push length of stack with l. If greater than 14, output character, otherwise create a new stack with top 10 elements, add 15 then reflect execution right then up and output. This is used to prevent the extra spaces and > from being printed at the end, as well as turning the random-looking string into what needs to be printed. Continue looping.
If any of the lines is shorter (by removing a character), the program will no longer work, either because the vertical parts of the program no longer line up, or because the string to print isn't correct anymore. Attempting to remove a character from in front of each line will change the stack depth and where the l is placed, also causing problems.
Fish

94! Nice! I didn't think you'd get there haha

When I started making the first version, I knew I could reuse some. Then I got rid of the " and l with quite a bit of work. Once I hit 92, I was sure there must be a way to remove the last o. It took a bit of effort, though. You can tell by the revision history.

Octave, 20 21 22 25 27 33
The best I've managed this far is
g=@()disp(horzcat([67 9583 -412],'e B',"nvkhmf"+!0));

This creates an anonymous function f that takes no input. You can call it f(). I'd say the semicolon at the end is necessary, in order to avoid printing of the function body.
It is possible this can be improved by combining eval and printf, but I've tried and failed over and over.
This uses all digits once, by exploting the fact that Octave does a mod(x,256) operation when implicitly converting numbers to characters. This means that we can use negative numbers, as well as numbers outside the normal 32-126-range. The following numbers all result in the letter i when converted to characters: ... -2455 -2199 -1943 ... 105 361 .... Instead of using 'owling' in the end, we use "nvkhmf" and add 1. This creates a vector of integers that are implicitly converted to characters. Instead of 1, we use !0 (or not(false). Also, we use " instead of ' to avoid two penalty points.
We need to find the set of numbers that gives the lowest score. The string Code Bowling result in the following matrix, when we subtract and add -10*256 - 10*256.
  -2493  -2449  -2460  -2459  -2528  -2494  -2449  -2441  -2452  -2455  -2450  -2457
  -2237  -2193  -2204  -2203  -2272  -2238  -2193  -2185  -2196  -2199  -2194  -2201
  -1981  -1937  -1948  -1947  -2016  -1982  -1937  -1929  -1940  -1943  -1938  -1945
  -1725  -1681  -1692  -1691  -1760  -1726  -1681  -1673  -1684  -1687  -1682  -1689
  -1469  -1425  -1436  -1435  -1504  -1470  -1425  -1417  -1428  -1431  -1426  -1433
  -1213  -1169  -1180  -1179  -1248  -1214  -1169  -1161  -1172  -1175  -1170  -1177
   -957   -913   -924   -923   -992   -958   -913   -905   -916   -919   -914   -921
   -701   -657   -668   -667   -736   -702   -657   -649   -660   -663   -658   -665
   -445   -401   -412   -411   -480   -446   -401   -393   -404   -407   -402   -409
   -189   -145   -156   -155   -224   -190   -145   -137   -148   -151   -146   -153
     67    111    100    101     32     66    111    119    108    105    110    103
    323    367    356    357    288    322    367    375    364    361    366    359
    579    623    612    613    544    578    623    631    620    617    622    615
    835    879    868    869    800    834    879    887    876    873    878    871
   1091   1135   1124   1125   1056   1090   1135   1143   1132   1129   1134   1127
   1347   1391   1380   1381   1312   1346   1391   1399   1388   1385   1390   1383
   1603   1647   1636   1637   1568   1602   1647   1655   1644   1641   1646   1639
   1859   1903   1892   1893   1824   1858   1903   1911   1900   1897   1902   1895
   2115   2159   2148   2149   2080   2114   2159   2167   2156   2153   2158   2151
   2371   2415   2404   2405   2336   2370   2415   2423   2412   2409   2414   2407
   2627   2671   2660   2661   2592   2626   2671   2679   2668   2665   2670   2663

So, ['',2627 2415 2148 1893 -2528 66 -1169 -1161 2668 105 -146 103] results in ans = Code Bowling. The challenge is then to find the set of numbers and characters that reduces the score the most. Using all digits is of course good, but duplicates are bad. Since all digits are used, and non are used twice, this is the best possible mix. Also, we get to use -, resulting in one point.
One could claim that it can be reduced to the line below (31 points), but then it would no longer be an "executable function", and would therefore have a different functionality.
disp(horzcat([67 9583 -412],'e B',"nvkhmf"+!0))

Did you try function q();disp(...) too? Except for the i(), they're nicely non-overlapping.

@Sanchises I can check it out. But cot in horzcat and nf in the string will lower the score quite drastically. It might be better though, if I remove horzcat and creates the string another way, but then I can't use +!0 either. I'd be surprised if it increases the score to be honest... It's only 7 characters longer than the current answer, and I'll get a 7 byte penalty, in addition to the ones I mentioned.

Yeah I couldn't trivially get a higher score with function, but then I figured you might have tried this already and I would be wasting my time (as opposed to, you know, spending my time usefully on PPCG)

C, 27 29
+2 points thanks to @ceilingcat!
f(){char q<:]="Code B\157wling";puts(q);%>

Suggest char q<:] instead of char q[] and puts(q);%> instead of puts(q);}

Suggestion: 1.using separate functions to output each segment of the string and then running them all in function f 2. The magic of using structs to make code unreasonably longer

@ceilingcat that's interesting I've never seen that before in C... what are those?

@MatthewRoh I think you may find the scoring system punishes that pretty heavily

@AlbertRenshaw Those are digraphs

@AlbertRenshaw :( I just wanted to throw some tips to make it longer

@ceilingcat the thing is, most di/trigraphs repeat characters

Would there be a way to avoid the repeating semicolon?

Haha, first time I see a +2 points thanks to ...

@ceilingcat What is char q<:]? Never seen that.

@TomášZato check their later comment, Wikipedia

QBasic, 34
This is unformatted code (yay for case-insensitivity). You can run it in QB64 or at archive.org (though note that the latter will format the code as you type it). I think I've managed to abide by all the rules.
CLS
PrINT "C
LOcatE 1, 2 : ? CHR$(957-846); "de Bowling

The CLS is necessary: without it, the C is not guaranteed to print at the top left corner of the screen, where it will line up with ode Bowling. The LOcatE is necessary: without it, ode Bowling will be printed on the line below C. I don't believe there is any subset of the program (except whitespace) that can be deleted and keep the same output.

Can you share a link to an online interpreter? I can't run this on repl.it. I get Parse failed: Syntax error at 3:36: Token(Bowling)

@StewieGriffin Edited in a couple options.

@StewieGriffin, this takes advantage of a quirk in Microsoft implementations of Basic where the closing quote of a string is optional if that string extends to the end of the line.  I expect most non-Microsoft interpreters will object to the missing quotes.

Apparently QBasic has a very strong smell association for me.

@DLosc It smells like the book I learned it from, and like the computer room at my house growing up. I had no idea. It was LOCATE 1, 2 that did it

Haskell, score 21 38 46 47 21 70
putStr$toEnum(length"!#%&'*+,-./012345789;<=>?@ADGHIJKLMNOPQRTUVWXYZ[]^_`abcfjkqsvyz{|}~"):"ode B\x6Fwling"

Try it online! The idea is to get the leading C by constructing a string of length 67 which contains all not otherwise used characters and converting the length of this string to a character. I started with putStr$toEnum(length""):"ode B\x6Fwling" ('\x6F' is hexadecimal for '\111' which yields 'o') and computed all printable ASCII characters not contained in the program:
!#%&'*+,-./012345789;<=>?@ACDGHIJKLMNOPQRTUVWXYZ[]^_`abcfjkqsvyz{|}~

Incidentally there remain exactly 67 printable ASCII characters which can put into the string, and C itself which cannot appear in the string because then the program would be reducible to just putStr"Code B\x6Fwling".

Previous solution: (score 21)
f|x<-'C'=mapM putStr[(:)x"ode Bowling"]

Defines a function f which takes no input and prints the string. Try it online!

This can be reduced

@Leo nice catch! Does this approach also work for my updated version with 95 in the string and subtracting 4621? (I don't have time to check it myself right now but will look into it some time later)

Gotcha. Took me longer than it should have, seeing how simple the result is :)

JavaScript, 19
prompt('C\157de B\x6fwlin'+"g")

Not a very high score.

z(){var x=alert('Code \nBowling');}

@AlbertRenshaw the semicolon can be removed though

12: z(){alert('Code \ Bowli'+"ng")}

@ASCII-only you are correct! My bad. (I wonder if there is a browser/environment that requires the semi-colon, hmmm)

@sagiksp Doesn't work, doesn't have function before f

@ASCII-only Don't use o= otherwise you repeat the letter o twice in your code and suffer a -3 deduction.

Damnit o was unused

19: prompt('C\157de B\x6fwlin'+"g")

Let us continue this discussion in chat.

Jelly, 94
“!#"$&('*)+-/,13.0456:79<;>=@B?ADFHJLNCPRTEVXZ\G^IKMQ`SWbY[]d_acfhjegliknmprotquvxwy{z}¹|³⁵⁷~°⁹⁻”O%2s8UḄỌ

Try it online!
105 unique characters, 11 exotics (“¹³⁵⁷°⁹⁻”ḄỌ).
How?
Forms the string from 8-bit reversed ASCII where each bit is encoded using the LSB of the Unicode value of a character.
“...”O%2s8UḄỌ - Main link: no arguments
“...”         - the string enclosed            !  #  "  $  &  (  '  *  )  +  -  /  ,  1  3  .  0  4  5  6  :  7  9  <  ;  >  =  @  B  ?  A  D  F  H  J  L  N  C  P  R  T  E  V  X  Z  \  G  ^  I  K  M  Q  `  S  W  b  Y  [  ]   d  _  a  c   f   h   j   e   g   l   i   k   n   m   p   r   o   t   q   u   v   x   w   y   {   z   }   ¹   |   ³    ⁵    ⁷   ~   °    ⁹    ⁻
     O        - cast to ordinal (vectorises) [33,35,34,36,38,40,39,42,41,43,45,47,44,49,51,46,48,52,53,54,58,55,57,60,59,62,61,64,66,63,65,68,70,72,74,76,78,67,80,82,84,69,86,88,90,92,71,94,73,75,77,81,96,83,87,98,89,91,93,100,95,97,99,102,104,106,101,103,108,105,107,110,109,112,114,111,116,113,117,118,120,119,121,123,122,125,185,124,179,8309,8311,126,176,8313,8315]
      %2      - mod 2 (vectorises)           [ 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,  0, 1, 1, 1,  0,  0,  0,  1,  1,  0,  1,  1,  0,  1,  0,  0,  1,  0,  1,  1,  0,  0,  1,  1,  1,  0,  1,  1,  0,  1,   1,   1,  0,  0,   1,   1]
        s8    - split into chunks of 8       [[1,1,0,0,0,0,1,0], [1,1,1,1,0,1,1,0], [0,0,1,0,0,1,1,0], [1,0,1,0,0,1,1,0], [0,0,0,0,0,1,0,0], [0,1,0,0,0,0,1,0], [1,1,1,1,0,1,1,0], [1,1,1,0,1,1,1,0], [0,0,1,1,0,1,1,0], [1,0,0,1,0,1,1,0], [0,1,1,1,0,1,1,0], [1,1,1,0,0,1,1]]
          U   - upend (vectorises)           [[0,1,0,0,0,0,1,1], [0,1,1,0,1,1,1,1], [0,1,1,0,0,1,0,0], [0,1,1,0,0,1,0,1], [0,0,1,0,0,0,0,0], [0,1,0,0,0,0,1,0], [0,1,1,0,1,1,1,1], [0,1,1,1,0,1,1,1], [0,1,1,0,1,1,0,0], [0,1,1,0,1,0,0,1], [0,1,1,0,1,1,1,0], [1,1,0,0,1,1,1]]
           Ḅ  - binary to int (vectorises)   [67, 111, 100, 101, 32, 66, 111, 119, 108, 105, 110, 103]
            Ọ - to character (vectorises)    ['C', 'o', 'd', 'e', ' ', 'B', 'o', 'w', 'l', 'i', 'n', 'g']
              - implicit print               Code Bowling

Jelly is longer than others how is this possible?

@DownChristopher It's actually shorter than the python answer. The python answer has repetition though.

@DownChristopher do I detect sarcasm?

@JonathanAllan no Yeah I still find it funny that jelly is pretty long here

Röda, 33
{["ode B\x6fwling"]|push chr(3*4+57-2).._}

Try it online!
I tried to follow all rules. It works by first pushing the string ode Bowling! to the stream and then inserting C=3*4+57-2 to the front.

C, 73
Thanks to @Laikoni!
F(){printf("Code B\157wli%cg",48+strlen("!#$&'*-../2369:<=>?@ADEGHIJKLMNOPQRSTUVWXYZ[]^_`abhjkmquvxyz|~"));}

Try it online!
C,  31   33  35
F(){printf("Code B\157wli%cg",96|0xD+3*4/8);}

Thanks to @ceilingcat and @DLosc for two more points and thanks to @Ørjan Johansen for another two more points!
Try it online!

@ceilingcat Then one could remove the 8- and have valid code still. 0xA-4+8 should work, though.

Would 0xA+32/8 work? (Without something being removable, that is.)

@ØrjanJohansen I think it does. None of +32, +3, +2, +3/8, +2/8, /8 or +8 produces the right output. Thanks!

Oh, or 0xD+4*8/32. No wait, that would shorten to 0xD+4/3 wouldn't it.

@ØrjanJohansen That won't do, because 0xD+4/3 gives the correct output.

0xD+3*4/8 might work better.

@ØrjanJohansen Thanks again. These are getting complex to verify! I think it works; there are many near misses, though. For example, 96|0xD+4/8 outputs Code Bowlimg.

Using the same approach as my Haskell answer gives a score of 74, if it is not reducible in any way: Try it online!

@Laikoni Thanks! I think it's not reducible, but the output is wrong. The fixed version scores 73, still.

Cardinal 20
23 non whitespace characters
%#>/NI"CodeB8^o)wl,ing
-3 for repeated "o"
   I
 >\/N
%# "CodeB
 8^o
 ) w
   l
 , i
   n
   g

Pointer paths:
Step 1:
Pointer created at % going right
Step 2:
Pointer splits at # to go up, right and down  (P1,P2,P3)
Step 3:
P1 Sent right by >
P2 Going right
P3 Set wait for 3 steps at 8
Step 4:
P1 Reflected down by \. \ changed to /
P2 Set to print mode by "
P3 Wait for 2 ticks at 8
Step 5:
P1 Heading down
P2 Print C
P3 Wait for 1 tick at 8
Step 6:
P1 Sent up by ^
P2 Print o
P3 Finish wait at continue, pick up ASCII value of " " (32) from )
Step 7:
P1 Heading up
P2 Print d
P3 Heading down
Step 8:
P1 Reflected right by \ which was changed to /
P2 Print e
P3 Print character with ASCII value=32 from , operation
Step 9:
P1 Reflected up by / which is changed to \
P2 Print B
P3 Reached end of field and stops
Step 10:
P1 Reflected down by I
P2 Reached end of field and stops
Step 11:
P1 Reflected right by / which was changed to \. Changes back to /
Step 12:
P1 Reflected left by N
Step 13:
P1 Reflected down by /
Step 14:
P1 Set to print mode by "
Step 15:
P1 Print o
Step 16:
P1 Print w
Step 17:
P1 Print l
Step 18:
P1 Print i
Step 19:
P1 Print n
Step 20:
P1 Print g
Step 21:
P1 Reaches end of field and stops.
Try it Online

Brainfuck: -204
++++[++++>---<]>.+[--->+<]>+++.-----------.+.--[--->+<]>-.+[->++<]>.-[--->+<]>++++.++++++++.-----------.---.+++++.-------.

Well, awful score, but was fun to write.

122 characters long
repeated alnum:       -0 ()
repeated punctuation: -134 (--[---].-----------..--[---]-.[-].-[---]..-----------.---..-------.)
repeated other:       -192 (+++++++>+>+<>++++>+<>+>++<>>+<>+++++++++++++++++)
whitespace characters:  -0 ()
exotic characters:  -0 ()

Does Brainfuck win any PPCG challenge? ;P

@Draco18s probably not hahaha cry.

'Fun to write', you mean to type "Code Bowling" into a text generator?

Java 8, 2 3 5 13 17 18 19 20 21 24 77 78 points
+53 score (24 → 77) thanks to @Laikoni.
v->(char)"!#$%&'*,/0234689:;<=?@ADEFGHIJKLMNOPQRSTUVWXYZ[]^_`bfjkmpqsuxyz{|}~".length()+"\157de Bowling"

104 characters long
- repeated alnum: -15 (helng)
- repeated punctuation: -10 ("()"")
- repeated other ASCII: none
- whitespace characters: -1
SCORE: 78
Try it online.

Old 24 bytes answer:
v->"C\157de Bowlin"+(char)103;

30 characters long
- repeated alnum: -3 (1)
- repeated punctuation: -2 (")
- repeated other ASCII: none
- whitespace characters: -1
SCORE: 24
Try it online.

Using an octal escape in the text would increase your score by 6 instead of the 2 you get for your Unicode escape (having both is worse though). Also, concatenating the first or last character will increase your score by 1. Finally think you might be better off with a lambda rather than a named function.

@Neil Weird, I did already came up with Object x(){return"C\157de Bowling";} a few hours ago for 17 points.. Apparently I haven't edited / saved it in my submission, though.. :S As for the lambda, I use Java 7 which doesn't have any lambdas yet. I could add a Java 8 answer with lambda, though.

Whoops, sorry, I didn't notice the 7. (But don't forget the concatenation.)

Using the same approach as my Haskell answer gives this version with a score of 77: Try it online!.

@Laikoni Thanks! +53 score thanks to you. And since Java 8 answers are usually answered without the trailing semi-colon, I could remove that trailing semi-colon and replace the repeated ,, with ,; for another +1. Funny how the String using all available printable ASCII that were left is EXACTLY 97 characters for char-code C. :)

Batch, 19 characters
@echO(Cod%TMP:~5,1% Bowling

Starting with Windows Vista, TMP begins with C:\Users\ and therefore %TMP:~5,1% is a verbose way of writing e, despite requiring a double % at -4 penalty.

05AB1E, 94 points
”X1234bcde5fghijk68l9<mn>,o.p|q\/{})r(_-+s=tu*vwxyzAB&YDEFG^HI%$ZK#L@!MNO~PQR`ST':UVW[0];"”€a7ôJCç€?

Try it online!

- 100 characters long
- repeated alnum:       -0 ()
- repeated punctuation: -0 ()
- repeated other:       -0 ()
- whitespace characters:  -0 ()
- exotic characters:  -6 (””€ôç€)

Total score: 94

Basically converts (The Binary ASCII of Code Bowling):
['1000011', '1101111', '1100100', '1100101', '0100000', '1000010', '1101111', '1110111', '1101100', '1101001', '1101110', '1100111']

Into a string of 1's and 0's, then it replaces each 1 with a letter in the alphabet, and each 0 with a space character or a symbol or a digit.
”X1234bcde5fghijk68l9<mn>,o.p|q\/{})r(_-+s=tu*vwxyzAB&YDEFG^HI%$ZK#L@!MNO~PQR`ST':UVW[0];"”

Is the string, where 1's are letters and 0's are symbols, numbers or anything else. We then iterate through, seeing which are alphabetical, pushing 1 for alphabetical 0 for nonalphabetical. We then split into groups of 7, convert back to ASCII and print each character.

;#, score -1163
I don't think this would be much competition even if it could compete.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

Try it online! Note: TIO has no ;# interpreter, only ;#+.

stacked, 42
(67:43,1 ab)2 9*pf sum 8/0\|>+chr'de Bowling',EPS#`

Try it online!
Leaves output on stack. Here's the breakdown:
length: 51
repeated alnum:        -0 ()
repeated punct:        -4 (',)
repeated other:        -0 ()
whitespace characters: -5 (     )
exotic characters:     -0 ()
total score: 42

I could probably make it higher, but it's at 42 soo....
Another contender, 40:
(67:43,sum)9 pf 2%MIN 0\|>+chr'de Bowling',EPS#`

I used this script for scoring it.

CJam, score 93
"g!#$&'()n*+/0134i5689:;<l=>?@ADEwFGHIJKLoMNOPQRSBTUVWXYZ [\]^_`aebcfhjkmdqrstuvxpyz{|}  C"7~%2,.-

Try it online
Inspired from TidB's Python answer.
Not sure if there's any way to avoid the repetition of the double quotes.
Explanation:
The string contains "Cpde Bowling" in reverse, every 8th character.
7~% extracts "Cpde Bowling" (7~ = -8)
2,.- decrements the p character (2, = [0 1])

@Laikoni if you meant that I broke the unused code rule, it should be fixed now

@Laikoni yeah, but if you remove any single character in his code it doesn't work properly, therefore, because all code is used, it's valid.

@carusocomputing The rules mention clearly that the code should not work "if any individual character (or varying set(s) of characters) is/are removed.", so I don't think your interpretation holds. Anyway, aditsu already fixed the problem so all is fine now.

evil, -81
Better than Brainfuck!
aeeaeuwkaaeeuwygaeaeclaaxjlwalusbdgueuewguwpweewpuuuwuuuwpuweew

Explanation
aeeaeuw //Write 'C'
k       //Set P[0] to 'C'
aaeeuw  //Write 'O'
y       //Set W[0] to 'O'
gaeae   //Set Accumulator to 'D'
claa    //Create new Wheel cell at index 0, swap with Accumulator, add 2
xj      //Set alternate marker mode and drop marker
lwa     //Write value of W[0], add 1
lu      //Put it back, subtract 1 from Accumulator
sb      //Go to 'j' if Accumulator != 0
d       //Delete W[0]
        //The above loop writes 'D' and 'E'
gueuew  //Write ' '
guw     //Write 'B'
pw      //Write 'o'
eew     //Write 'w'
puuuw   //Write 'l'
uuuw    //Write 'i'
puw     //Write 'n'
eew     //Write 'g'

Submitted because nobody does anything in evil but it's kind of fun.
Score:
Length = 63
a*8  = -24
e*12 = -36
g*2  = -6
l*2  = -6
p*2  = -6
u*12  = -36
w*10  = -30

Try it online!
EDIT: TiO seems to incorrectly handle creation and deletion of new Wheel cells - I've filed a bug report on the subject. It won't work properly on there, but I ran it on my own interpreter and it works and you can trust me so I wouldn't worry about it ;)

Perl: 29, 33
$_=OWLING;printf%s,"C\157de".chr(30+8/4).B.lc

Score:
- 46 characters long
- repeated alnum:       -6 (rc)
- repeated punctuation: -6 ("..)
- repeated other:       -0 ()
- whitespace characters:  -1 (
)
- exotic characters:  -0 ()

Total score: 33

T-SQL, 65 18 32! points
PRINT char(78-9605*43%12) + 'ode Bowling'

Inspired by a trick in Dlosc's QBasic answer, I found a way to include all 10 digits and most of the mathematical operators (% is remainder/modulo, missing only /), mostly via trial and error . I don't think there is any way to get a 67 by removing any combination of digits/symbols, but you're welcome to try.
Version 2 (18 points, trivial):
DECLARE @ char(12)='Code Bowling'PRINT @

Not a great score, but this is what my first version simplified to (thanks, MickyT). Everything else I tried (encoding and decoding hex64, picking individual elements out of a string, converting ASCII values, etc) all had too many repeated characters (especially ECR and symbols (),@) that drive it into the negative.
Version 1 (65 points, invalid):
DECLARE @ char(123)=
'Code Bowling FGHJKMOQSUVWXYZbjkmpqsuvxyz045789 [!?.-":;]{`~#$%^&*_+|\><}'
PRINT left(@,LEN(@)/6)

I used the length of the string to determine how many characters I use from the left side, so removing any single character from the string will drop the integer division result down to 11, outputting only Code Bowlin.

Not sure, but I think this can be reduced to DECLARE @ char(12)='Code Bowling'PRINT @ under the rules.

@MickyT It can, does that invalidate my answer? Someone in chat said it only had to withstand removing single random characters, not long arbitrary portions, were they incorrect?

I'd leave it here for the moment, It's always good to see an t-SQL answer

@MickyT I'll leave it but cross out the score. Best I could do otherwise is a measly 18 points :P

Whitespace, score: 0
[S S T  T   N
_Push_-1_g][S S S T T   S N
Push_6_n][S S S T   N
Push_1_i][S S S T   S S N
_Push_4_l][S S S T  T   T   T   N
_Push_15_w][S S S T T   T   N
Push_7_o][S S T T   S S T   T   S N
_Push_-38_B][S S T  T   S S T   S S S N
_Push_-71_space][S S T  T   T   N
_Push_-3_e][S S T   T   S S N
_Push_-4_d][S S S T T   T   N
Push_7_o][S S T T   S S T   S T N
_Push_-37_C][N
S S N
_Create_Label_LOOP][S S S T T   S T S S S N
_Push_constant_104][T   S S S _Add_top_two][T   N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Uses this Whitespace tip of mine to print the output. The optimal constant 104 is generated by this Java program. Since all the characters (except for the o) are unique, I couldn't use any duplicates or copies to save bytes (copy the value of o would be 1 byte longer than pushing the value of o again).
Score: 117 characters long - 117 whitespace characters = 0
Still better than some of the negative scoring answers. ;)

CJam, score 47
"'#?GyQ2wE(s6&␟JI!gF$u*Aq;0p4BvOKkHLhM"3/{:i~-z+c}%

Hopefully no problems with this...
Uses one exotic character (Unit Separator, ASCII 31, represented by ␟), and one repeated character ("). I think it could be made longer still, but I'll leave it as is for now.
Try it online!
The program works by taking that long string and splitting it into length-3 substrings. Each substring is then mapped to the block, which converts its characters to their ASCII values, dumps the values on the stack, takes the absolute difference of the second two, adds the result with the first, then converts the final result back to an ASCII character.

PHP, 33 points
This was quite difficult to come up with.
The score may be inproved in the future.
<?echo IHASZODECG9F^"
'%6z\r+2/.W!";

The newline is assumed to be a Linux-style newline! Windows-style and Old-Mac-Style won't work properly.

Ruby, 75
Approximately a port of the Python answer, but Ruby doesn't have that cool step function so I use gsub instead. Also I decided to have a little fun with the exotic characters by throwing phrases into Google Translate
Try it online!
print"Cachjkmq\x6fvyzADEFdGHIJKLMeNOPQRST UVWXYZ0B234589[o!?-:;]`w~@\#$%^&l*_+=|><i コードゴルフn 代碼保齡球 gκωδικός".gsub /(.).{7}/,'\1'

USML, 12 or 9 points (non-competing)
"Code\tBowling'

Try it online!
This answer cheats a bit by abusing how HTML renders. The string actually created by this is "Code\tBowling ". Points are lost for repeating the "o" character.
For a non-cheatsy answer:
"Code Bowling

USML is still fairly early in development and is not yet capable of increasing the size of the program any further yet.

"USML is still fairly early in development and is not yet capable of increasing the size of the program any further yet.". What about this for 10 points "Code&'Bowling (*Note: Replace & with a line-break, it won't let me type them in comments)

You can also add a backslash \ infront of any of the letters and it will still output the same string since compiler either ignores it or escapes the character into itself. This gets the (competing) score up to 11 now!

You can then add a line-break and a lowercase s to the next line (getting a substring of nothing, thus not changing the output at all) to get your competing score up to 12, the same as your non-competing score except an actual valid submission :D

Infact, here is a 16-point answer in USML, I'll post the hastebin to it since it's hard to type multi-line code in the comments: https://hastebin.com/icuguviyax.tex

I'm an idiot and forgot the rules to my own challenge lol, a subset of the code above would still complete the challenge, disqualifying my answer; whoops!

Well done with the suggestions! As for the backslash, I did realize this after I posted the answer but didn't implement those changes. As for adding s to the end, this is actually undefined behavior that will be broken as I work on the compiler. Probably the next commit I push will feature argument checking, which would invalidate that solution.

Cubix, 85
Codeha1spqumtr;$"gnilwoB"Sv"ADEFH%IJK2f!OPUzQ0V3XY&*[-|L:]\T`~#x>MR56cGk'?W<()b4j}.{Z_^/978@

Try it online!
Cubified with insignificant characters replaced with .
        C o d e
        . . . .
        . . u .
        . . ; .
" g n i l w o B " S v " . . . .
. . . . . . . ! . . U . . . . .
. . . . . . . L . . \ . . . . .
> . R . . . . . . . W < . . . .
        . . . {
        . . ^ /
        . . . @
        . . . .

I think I have made the path fragile enough that removing characters will break it quite badly.
Watch it run
- 92 characters long
- repeated alnum:       -3 (o)
- repeated punctuation: -4 ("")
- repeated other:       -0 ()
- whitespace characters:  -0 ()
- exotic characters:  -0 ()

Total score: 85

Zsh --nocaseglob, score 79
>' "%&+,.:<=@ADEGHJKMOQSUVWXYZ^_abfhjkmpqrtuvxyz~'>0
?()${(#)9}*/PRINTF Code\ Bowling;[!] 1 2 3 4 5 6 7 8 `ls|wc -L`

Try it online!
Previous version (score 84):
>\";?()/*/PRINTF %s g${9:8|#0}
rev <([!-+] A D E G H J K L '&,.=@^_`~1234567MOQSUVWXYZabcfhjkmpqtuxyz nilwoB edoC')

Try it online!
Unfortunately, this wasn't irreducible for a number of reasons. Here is the limit of reducibility:
>\";?()/*/PRINTF g$8
rev <([!] A D E G H J K 'nilwoB edoC')

Try it online!

Acc!!, score -197
119
Write _-52
Write _-8
Count i while i-2 {
	Write _-19+i
}
32
Write _
_+34
Write _
_+45
Write _
_+8
Write _
_-11
Write _
Count i while i-2 {
	Write 105+i*5
}
_-5
Write _

Try it online!
Acc!! works well for this challenge as whitespace is necessary and loops are costly. I made use of the Accumulator here, but poorly, to increase chars. Here is a brief overview from the page:

Accumulator Any expression standing by itself is evaluated and assigned to the accumulator (which is accessible as _). Thus, e.g., 3 is a statement that sets the accumulator to 3; _ + 1 increments the accumulator; and _ * N reads a character and multiplies the accumulator by its charcode. (N gets input)
Write <charcode>
Outputs a single character with the given ASCII/Unicode value to stdout. The charcode can be any expression.

Loops in Acc, at least for golfing, are a pain. They require  braces, and all whitespace is necessary.
Otherwise it's pretty self-explanatory.

This is a bowling challenge, not a golfing one, so you're supposed to maximize score. In addition, its scoring is otherwise unusual. Using the scoring tool above, your code gets a negative score.

@ØrjanJohansen It does look as though they are attempting to maximize score (due to "I made use of the Accumulator here, but poorly, to increase chars"), but they're just not scoring it correctly.

@ØrjanJohansen Ah yes, it seems I completely missed the scoring section. I will update

Lenguage, 94
Reduced by 450947698176028388843917607537842418986035722486451998047037459476165368967293205287214703816225093120721837128 bytes thanks to @ovs.
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                    ...238120765277364887435892673116228159402534303033563968545104627044479808894 spaces omitted...

This gets converted to the brainf*** program +[[-<+<+>>>]>+<<<<+]>>>>>>++++.<<+.<<--.+.>>>>>--.<-.<<.>++++.<---.---.+++++.<<++. using the algorithm described here, which outputs Code Bowling. This gets the maximum score achievable for this challenge and at the same time is the longest program here!

I'm not sure if this is valid. Lenguage is obviously going to get a score of 94, but your program is reducible (40 bytes shorter bf program). Proving that any Lenguage program is irreducible is going to be very difficult.

@ovs Huh, good point. I'll edit my answer

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


text:
Simple code golf challenge: Character patterns!
In this challenge, you receive a string as input containing a string of X's, Y's and Z's eg. "XYZZ". X, Y and Z represent a particular character. This pattern is then compared with a second string input. If the pattern exists as a substring in the second input, return True, otherwise, return False. Once a pattern is found in the word, the program stops searching and returns True.
Examples
Pattern: "XXYY"
succeed ---> True (pattern found: ccee)
success ---> False (pattern not matched)
balloon ---> True (pattern found: lloo)

Pattern: "XYXYZ"
bananas ---> True (pattern found: nanas)
banana  ---> False (pattern not found)

Note: This is not the actual input. This is an example of how the  program should work. Your program should output True or False, or other Truthy/Falsy values.

Other important/useful information

The pattern does not need to contain an X, Y and a Z, it could contain X's and Y's or even (although somewhat pointless) just X's.
The pattern cannot be empty, but this will not be used as a test case.
The search string will not be empty, and will be lowercase.
The alphabetic order of X, Y and Z in the pattern does not matter.
X, Y and Z must be unique characters.
You may use any library you wish.
The score is determined by the code size, in bytes. Lowest score wins.

Good luck!

The pattern can be anything. I probably should have mentioned that the pattern doesn't have to have an X, Y, and a Z, it could have just an X and a Y. Those patterns are just examples, though, so feel free to come up with your own examples  with those patterns.

What do you mean "the pattern exists"? As a contiguous chunk? As a substring? Can, say, X and Y stand for the same thing?

@xnor X and Y must be independent of eachother, and what I mean by the pattern existing is that anywhere in the string there is a substring that matches the pattern. I will add these to my challenge description to clarify.

Related. (Same thing, but asks for exact matches of the pattern, not for substrings.)

More details: Can the pattern be empty? The search string? Will the search string only use lowercase letters? Will the pattern be alphabetically first among equivalent patterns, i.e. use X first then Y then Z?

@xnor Description updated

Can either string be longer in length than the other. For example could one input be "XYZ" and the other "ab" while in another case the input "XYZ" and "abcdef"

@GoldenRatio So long as the length of the pattern and the string is not zero, the only real rule to follow regarding length is whether the string follows the pattern. In the first case, "ab" would not follow the pattern "XYZ" because there would be nothing to represent "Z". Regarding the second example, the pattern immediately finds a match in "abc" which follows "XYZ".

Can we use a function to return the value?

@Mr.Xcoder sure!

Can I have my program print the letters that XYZ represent? For instance for f(banana,XYXY) it would return ['nab','anb'], where X=n, Y=a, Z=b and an empty set when the pattern is not found? Not sure how but this cuts like ~3 bytes off my code haha.

The characters matching X,Y,Z have do be different? Example: pattern XXYY, string aaaa

Read the description.
"X, Y and Z must be unique characters."

Can the pattern be assumed to be all uppercase?

Are X,Y,Z just characters, or can they be character groups? (XYX == aabbaa)

Perl 5, 85 bytes
Saved 40 bytes thanks to Peter Taylor's suggestion! (see my older version bellow to see the differences)
83 bytes of code + -pl flag.
s/./$h{$&}?"\\$h{$&}":($h{$&}=$.,join("",map"(?!\\$_)",1..$.++)."(.)")/ge;$_=<>=~$_

Try it online!
XYXYZ is transformed into ((?!\1).)((?!\1)(?!\2).)\1\2((?!\1)(?!\2)(?!\3).) (yup, some of the tests can't be true, but it's shorter that way), and the second input is then checked against that regex. (see the explanations of my older version to get more intuition of how it works)

My older version:
Thanks to Arnauld for pointing out a mistake I made in my first version.
113 bytes of code + -pl flags, and -Mre=eval.
s/./$h{$&}?"\\$h{$&}":($h{$&}=++$i,"(.)")/ge;$_.='(?{++$c;$\=1if!grep$v{$c}{${$_}}++,1..'.(keys%h).'})^';<>=~$_}{

Try it online!
On the example XYXYZ: the first regex will convert the pattern to (.)(.)\1\2(.), and add at the end a test to check if $1, $2 and $3 are different: if so, $\ is set to one. Then, the second input is testes against this regex, and $\ is implicitely printed at the end.
The regex generated for XYXYZ is (.)(.)\1\2(.)(?{++$c;$\=1if!grep{$v{$c}{${$_}}++}1..3})^.
(I'll to add a bit more details to the explanations when I have a moment)

So, Using regex to turn non-regex to regex? coolio

@Arnauld Indeed, thanks. (I must have read the challenge too fast, my bad). Had to double the bytecount to fix it, but it works now!

Would it not be golfier to generate a regex like (.)((?!\1).)\1\2((?!\1)(?!\2).)?

@Peter Taylor maybe.. I vaguely thought of it, but it seemed harder (read longer) to generate.. I'll have another look when I have a moment.

@Peter Taylor nevermind, it's going to be 30 bytes shorter; I'll update that in a bit, thanks :)

Jelly, 9 bytes
=þ
ẆÇ€ċÇ}

Returns the number of times the pattern was found, non-zero being truthy and zero being falsy.
Try it online!
How it works
ẆÇ€ċÇ}  Main link. Left argument: s (string). Right argument: p (pattern)

Ẇ       Window; generate all substrings of s.
 Ç€     Map the helper link over the substrings.
    Ç}  Apply the helper link to p.
   ċ    Count the number of times the right result appears in the left result.

=þ      Helper link. Argument: t (string)

=þ      Compare all characters of t for equality with all characters of t, yielding
        a square matrix of Booleans.

JavaScript (ES6), 94 bytes

f=
(p,s)=>s.match(p.replace(/./g,c=>m[c]||(t=r,r=`(?!\\${++g})`+r,m[c]=`\\`+g,t),g=m=[],r=`(.)`))

<input id=p placeholder=Pattern><input id=s placeholder=String>

Works by transforming the pattern into a regexp, e.g. for XYXYZ it generates /(.)(?!\1)(.)\1\2(?!\2)(?!\1)(.)/.
I notice an interesting distinction between PCRE and JavaScript regexp: in PCRE, \<n> fails (and therefore (?!\<n>) succeeds) before the capture group is defined, while JavaScript it succesfully matches the empty string (and therefore (?!\<n>) fails).

Python 2, 70 bytes
f=lambda p,s:s>''and(map(s.find,s[:len(p)])==map(p.find,p))|f(p,s[1:])

Try it online!
Checks if a string matches a pattern using the method in this answer. Uses a prefix of the search string whose length equals the pattern. Chops off the first character of the string string until a match is found, or False if it becomes empty

73 bytes:
f=lambda p,s:s>''and(map(s.find,s)==map(p.find,p))|f(p,s[1:])|f(p,s[:-1])

Try it online
Checks if a string matches a pattern using the method in this answer. Recursively checks all substrings by branching into removing the first or last character until the string is empty.

Python 3, 100 bytes
l=len
f=lambda p,s:l(p)<=l(s)and(l({*zip(p,s)})==l({*p})==l({s for _,s in{*zip(p,s)}})or f(p,s[1:]))

Try it online!

05AB1E, 19 16 bytes
ÙœJv¹y…XYZ‡²åi1q

Try it online!

ÙœJ              # Get powerset of all unique characters in string.
   v             # Loop through each...
    ¹            # Push input word.
     y           # Push current set of letters in powerset.
      …XYZ‡      # Replace each of the 3 letters in the original word with XYZ.
           ²å    # Check if second input is in this string, push 1 if it is.
             i1q # If 1, push 1 and quit.

Will return 1 if true, null if not true.

This can be 14 bytes if returning the possible values of XYZ is allowed:
05AB1E, 14 bytes
ÙœJv¹y…XYZ‡²å—

Try it online 2!

Assuming that a non-empty string is truthy in 05AB1E and that an empty one is falsy, your second version should comply with the spec.

Wrong result on input "abcd" and "XYZZ". You need to add a fourth letter as a default substitution.

@Dennis: If we go by the meta post the only truthy values in 05AB1E is 1 and True (which is usually a drawback for these kinds of challenges), but if the challenge spec can be interpreted as allowing us to define truthy/falsy for the challenge the second version works as you say.

@Emigna Oh, I was unaware of that.

PHP, 89 Bytes
A Gift from @Christoph and @Titus
for(;$v=$argv[1][$i++];)$r.=$$v?"\\".$$v:"(.)".!$$v=++$j;echo preg_match("#$r#",$argv[2]);

PHP, 105 Bytes
A Gift from @Christoph
foreach(str_split($argv[1])as$v)$r.=$x[$v]?"\\$x[$v]":"(.)".!$x[$v]=++$y;echo preg_match("#$r#",$argv[2]);

PHP, 167 Bytes
[,$a,$b]=$argv;foreach($s=str_split($a)as$v)$r[]=$k++>strpos($a,$v)?"\\".(1+array_search($v,array_keys(array_count_values($s)))):"(.)";echo preg_match(_.join($r)._,$b);

You should be able to save 2 bytes by using ++$p instead of ($p+1), though I haven't actually tested it.

Doesn't work for me: Sandbox. Anyway a golfed version of the code: [,$a,$b]=$argv;foreach(str_split($a)as$k=>$v)$r.=$k==($p=strpos($a,$v))?"(.)":"\\".++$p;echo preg_match("#$r#",$b);.

@Christoph Thank  You. Now it should work

Take this as a gift: [,$a,$b]=$argv;foreach(str_split($a)as$v)$r.=$x[$v]?"\\$x[$v]":'(.)'.!$x[$v]=++$y;echo preg_match("#$r#",$b); (Note that you should keep your old scores using )

@Christoph A Gift was the learning effort with the ! . It is more worth then the points that I could reach with your nice solution.

I count 109, not 108. -3 bytes if you don´t copy $argv to $a and $b; -6 bytes with for(;a&$v=$argv[1][$i++];); -1 byte with longer variable names (indeed!: Use $vv instead of $v, $ii instead of $i, $rr instead of $r, $yy instead of $y and you can use $$vv instead of $x[$v])

@Titus for(;$v=$argv[1][$i++];)$r.=$$v?"\\".$$v:"(.)".!$$v=++$j?><?=preg_match("#$r#",$argv[2]); I don't get the longer variable names: $v may only be X,Y or Z so it cannot override $r or stuff. I just discovered ?><?= it saves one byte compared to ;echo  anyone used it before?

@Christoph if you use ?><?= you must add a <?at the beginning

Java 7, 177 176 173 bytes
Object c(String p,String s){int i=p.length();if(s.length()1;for(;i-->0;)if(p.indexOf(p.charAt(i))!=s.indexOf(s.charAt(i)))return c(p,s.substring(1));return 1>0;}

Explanation:
Object c(String p, String s){                             // Method with two String parameters and Object return-type
  int i = p.length();                                     //  Index that starts at the length of the pattern
  if(s.length() 1;//false                                    //   Simply return false
  for(;i-->0;)                                            //  Loop from 0 to length_of_pattern
    if(p.indexOf(p.charAt(i)) != s.indexOf(s.charAt(i)))  //   If the index of the characters of the pattern and input aren't matching
     return c(p, s.substring(1));                         //    Return the recursive-call of pattern and input minus the first character
                                                          //  End of loop (implicit / single-line body)
  return 1>0;//true                                       //  If every index of the characters are matching: return true
}                                                         // End of method

Test code:
Try it here.
class M{
  static Object c(String p,String s){int i=p.length();if(s.length()1;for(;i-->0;)if(p.indexOf(p.charAt(i))!=s.indexOf(s.charAt(i)))return c(p,s.substring(1));return 1>0;}

  public static void main(String[] a){
    System.out.println(c("XXYY", "succeed"));
    System.out.println(c("XXYY", "success"));
    System.out.println(c("XXYY", "balloon"));

    System.out.println(c("XYXYZ", "bananas"));
    System.out.println(c("XYXYZ", "banana"));
  }
}

Output:
true
false
true
true
false

C#, 184 165 155 bytes
thanks aloisdg!
bool c(string p,string n){for(int l=p.Length,i=0,j;i<l;i++)for(j=i;j>=0;)if(p[i]==p[j]==(n[i]!=n[j--]))return l!=n.Length&&c(p,n.Substring(1));return 2>1;}

backtracking solution, as a bonus it works with a pattern with any characters!
    public static bool c(string p,string n)
    {
        for (int l = p.Length, i = 0, j; i < l; i++)
            for (j = i; j >= 0;)
                if (p[i]==p[j]==(n[i]!=n[j--]))
                    return l != n.Length && c(p,n.Substring(1));
        return 2>1;
    }

i just noticed golfing it exposed logic i didnt use, will update soon

First of all, why the var s=l==n.Length;? You only use it at return s?!s: (where !s is always false), so it can be changed to return l==n.Length?0>1:. Also, what is this: (n[i]!=n[j]||n[i]!=n[j]). You check n[i]!=n[j] twice.. This will always be true or true / false or false.. :S

The double check actually left over from a bigger if system that disappeared in golfing, so s was used alot, i wil improve it further. Thanks!

You can decalre all your variable in one line int l = p.Length,i = 0, j;

Can move your i++ and your j-- inside the for loop. for example: for(j=i;j>=0;)if(p[i]==p[j]==(n[i]!=n[j--]))

Ruby, 63 61 bytes
->a,b{a.chars.permutation.any?{|w|a.tr((w|[])*'','XYZW')[b]}}

Instead of searching for a regex pattern, just try substituting 'X','Y' and 'Z' in all possible ways, and find a literal match.
(Actually the same concept as carusocomputing's 05AB1E answer)

JavaScript (ES6), 92 89 87 86 bytes
Takes input p (pattern) and s (string) in currying syntax (p)(s). Returns 0 / 1.
p=>g=s=>s&&g(s.slice(1))|[...p].every((C,i,x)=>C==(x[c=s[i]]=x[c]||'XYZ'[c&&j++]),j=0)

Formatted and commented
p =>                             // main function: takes pattern p as input, returns g
  g = s =>                       // g = recursive function: takes string s as input
    s &&                         // if s is not empty:
      g(s.slice(1))              //   do a recursive call, starting at the next character
    |                            // merge the result with this iteration
    [...p].every((C, i, x) =>    // for each character C at position i in p:
      C ==                       //   check whether C is matching the next expected
      (                          //   character, which is either:
        x[c = s[i]] = x[c] ||    //   - a substitution character already associated to s[i]
        'XYZ'[c && j++]          //   - the next substitution character ('X', 'Y' or 'Z')
      ),                         //   - undefined if c = s[i] doesn't exist or j > 2
      j = 0                      //   initialize j = pointer in 'XYZ'
    )                            //

Test cases

let f =

p=>g=s=>s&&g(s.slice(1))|[...p].every((C,i,x)=>C==(x[c=s[i]]=x[c]||'XYZ'[c&&j++]),j=0)

console.log(f("XXYY")("succeed"))   // 1
console.log(f("XXYY")("success"))   // 0
console.log(f("XXYY")("balloon"))   // 1
console.log(f("XYXYZ")("bananas"))  // 1
console.log(f("XYXYZ")("banana"))   // 0

Mathematica 18 characters (not counting string & pattern)
StringContainsQ[string,pattern]

Examples:
StringContainsQ["succeed", x_ ~~ x_ ~~ y_ ~~ y_]

True
StringContainsQ["bananas", x_ ~~ y_ ~~ x_ ~~ y_ ~~ z_]

True

This is invalid because it doesn't take the string and pattern as string inputs as required.