text:
Calculate a Pedigree
A little genetics lesson
When you only have access to someone's visible traits or phenotype, a pedigree of their family history is often used to figure out the actual genetic information or, genotype of each family member.
When dealing with simple dominance as we will be, a simple pedigree chart will be enough to figure out the alleles, or the version of the genes that they have, of each person. In simple dominance a person with a dominant allele (denoted with a capital letter) will always have the trait that that version represents, no matter the other allele. It takes two recessive alleles (denoted with a lowercase letter) to have that version expressed. In other words the dominant allele always masks the recessive version of that gene. Here is an example of a pedigree chart:

Each row here is a generation. Circles are female, males squares, horizontal  lines are marriage, vertical lines children. Pretty simple. Black means recessive phenotype, white, dominant. Starting from the top, (assume the alleles are A and a), we know person 2 has aa, homozygous recessive because that is the only possible option for the recessive phenotype. Now even though person one could be either Aa or AA to be dominant phenotype, because he has a recessive child, he must be Aa, or heterozygous. You can do this for all the other people. In the event you don't have any information that enables you to figure out the second allele, it can be done like so: A_.
Your Task

You will receive a pedigree chart in the form of a list of generations like [GenI, GenII, etc.] in any sane format.
Each generation will be a list of strings, each string representing a person.
The people are made up of three parts - an ID, their phenotype, and their "connections".
Their ID is a single printable ascii character that is unique in the entire tree other than A or a. (No, there won't be more than 95 people in the chart).
Their phenotype is one of A or a, A being the dominant allele, and a being recessive.
Their connections are a sequence of ID's of other people that they have connections with.
A connection in the same generation is marriage, in different generations is child and parent.
The connections are repeated on both sides (i.e. the husband has say he is a husband of wife, and wife says she is husband of wife).
You have to figure out the genotypes of everyone as much as possible.
Return the same list, except instead of people, put their genotypes in the same position.
The genotype has to be outputted in order so Aa instead of aA.
A little leeway on the input format is fine.
This is code-golf so shortest answer in bytes wins.

Examples
[["0A1234", "1a0234"], ["2A01", "3a01", "4A015678",
"5a4678"], ["6a45", "7A45","8A45"]] (The one above)   ->

[["Aa", "aa"], ["Aa", "aa", "Aa", "aa"], ["aa", "Aa", "Aa"]]

[["0A12", "1A02"], ["2A301", "3a2"]]    ->

[["A_", "A_"], ["A_", "aa"]]

Bonus

-30 bytes if you deal with incomplete and co-dominance also. On the detection of three phenotypes instead of two in the entire chart, apply incomplete/co dominance to your algorithm.

Are we allowed to only modify the A and a and leave the ids and connections as is (i.e. [["0A12","1A02"],["2A301","3a2"]] becomes [["0A_12","1A_02"],["2A_301","3aa2"]] instead of [["A_","A_"],["A_","aa"]])?

05AB1E, 39 bytes
εNUε'aåi„aaë¯.øX<X>‚è˜y2£lSδåPài„Aaë„A_

Port of my Java answer.
Try it online or verify all test cases.
Explanation:
ε                     # Map over the rows of the (implicit) input-list:
 NU                   #  Store the outer-map index in variable `X`
   ε                  #  Map over the strings `y` of the current row:
    'aåi             '#   If the current string contains an "a":
        „aa           #    Push string "aa"
       ë              #   Else (it contains an "A" instead):
        ¯.ø           #    Surround the (implicit) input-list with two empty lists
                      #    (05AB1E has automatic wrap-around when indexing lists,
                      #     so this is to prevent that)
           X<X>‚      #    Push `X-1` and `X+1` and pair them together
                è     #    Index both into the list to get (potential) parent and child rows
                 ˜    #    Flatten it to a single list
        y             #    Push the current string we're mapping again
         2£           #    Only leave the first 2 characters (its id and the letter "A")
           l          #    Lowercase the "A" to "a"
            S         #    And convert it to a list of characters: [id, "A"]
             δå       #    Check in each string whether it contains the id and "A"
               P      #    Check for each whether it contained BOTH the id AND "A"
                ài    #    If a child/parent is found for which this is truthy:
                  „Aa #     Push string "Aa"
                 ë    #    Else:
                  „A_ #     Push string "A_"
                      # (after which the mapped result is output implicitly)

Java 10, 356 349 340 bytes
a->{int i=0,j,k,f,z=a.length;var r=new String[z][];for(;i<z;i++)for(r[i]=new String[j=a[i].length];j-->0;)if(a[i][j].contains("a"))r[i][j]="aa";else{var t=".a.*"+a[i][j].charAt(0)+".*";for(f=k=0;i>0&&k<a[i-1].length;)f=a[i-1][k++].matches(t)?1:f;for(k=0;i+1<z&&k<a[i+1].length;)f=a[i+1][k++].matches(t)?1:f;r[i][j]=f>0?"Aa":"A_";}return r;}

Try it online.
General explanation:
1) Any a will always become aa
2a) If a child A has parents aa and A, it will become Aa
2b) If a child A has parents A and A, it will become A_
2c) (It is not possible for a child A to have parents aa and aa)
3a) If a parent A has at least one child a, it will become Aa
3b) If a parent A only has children A, it will become A_
Code explanation:
a->{                     // Method with 2D String array as both parameter and return-type
  int i=0,j,k,           //  Index-integers
      f,                 //  Flag-integer
      z=a.length;        //  Length-integer
  var r=new String[z][]; //  Result 2D String array
  for(;i<z;i++)          //  Loop over the rows:
    for(r[i]=new String[j=a[i].length];
                         //   Create the inner String-array of the result
        j-->0;)          //   Loop over the columns:
      if(a[i][j].contains("a"))
                         //    If the current node contains "a":
        r[i][j]="aa";    //     Set the result at this node to "aa"
      else{              //    Else(-if the current node contains "A" instead):
        var t=".a.*"+a[i][j].charAt(0)+".*";
                         //     Set a temp String to a regex to check relations and "a"
        for(f=k=0;       //     Set the flag to 0
            i>0&&        //     If the current node has parents:
            k<a[i-1].length;)
                         //      Loop over the row above:
          f=a[i-1][k++].matches(t)?
                         //       If a parent with "a" is found:
            1:f;         //        Set the flag to 1 (else: leave it unchanged)
        for(k=0;i+1<z&&  //     If the current node has children:
            k<a[i+1].length;)
                         //      Loop over the row below:
          f=a[i+1][k++].matches(t)?
                         //       If child with "a" is found:
            1:f;         //        Set the flag to 1 (else: leave it unchanged)
        r[i][j]=f>0?     //     If the flag is 1:
                 "Aa"    //      Current node changes from "A" to "Aa"
                :        //     Else (flag is still 0):
                 "A_";}  //      Current node changes from "A" to "A_"
  return r;}             //  Return the result

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


text:
1 character typo generating most error messages from C++ compilation
It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error output with the smallest change to the source code (1 character addition).
Because other languages are more sane, this will be limited to C++ and gcc version 4.x.
Rules

Original source file must compile with gcc 4.9.2 to object code without error.
One ASCII character is added to source code to create a typo, increasing file size by 1 byte.
Compiler is run with default options. Necessary options like -c and -std=c++11 are allowed, options like -Wall are not.
Metric is
    number of bytes of generated error messages
    -----------------------------------------------------------------------
    (bytes of source code with typo) (length of filename passed to compiler)

Answers will be validated with http://ideone.com/ C++ 4.9.2.

Example:
Filename is a.cpp, which is 5 bytes long.
int foo();

Working Compilation
 gcc -c a.cpp

Corrupted source code:
in t foo();

Failing Compilation
$ gcc -c a.cpp
a.cpp:1:1: error: ‘in’ does not name a type
in t foo();
  ^
$ gcc -c a.cpp |& -c wc
64
$ wc -c a.cpp
12 a.cpp

Score:
    64/12/5 = 1.0666
Better attempt: Insert { between parens of foo()
$ gcc -c a.cpp |& wc -c
497

New score: 497/12/5 = 8.283
Good Luck!
UPDATE
I encourage people to ignore the recursive implementation. That technically wins but is not in the spirit of the contest.
UPDATE 2
As many people have noted, the contest probably would have been more interesting if the C pre-processor was not allowed.  So I would like to encourage people to post solutions that do not use  pre-processor commands at all. That implies no use of any header files at all, since #include is not allowed!
As far as using IDEONE to validate, you are allowed to either use the IDEONE output directly (and the source name as prog.cpp), or you can run the IDEONE output through a global search and replace (s/prog.cpp/a.cc/ for example) and pretend that you were able to set the file name directly.
UPDATE 3
As people pointed out, Ideone is a little too restrictive, requiring linkage not just object file creation.  As this contest is purely in the name of fun, please be honest and specify what you used to get your score. Either use ideone, or use the most vanilla build (all defaults) of gcc 4.9.2 as you can muster.  The contest is intended to bring awareness to the awfulness of C++ error messages.

Comments are not for extended discussion; this conversation has been moved to chat. Alternatively, for discussions about what should or shouldn't count as a duplicate please take the discussion to meta.

Three issues with using ideone to validate: It forces source file name to "prog.cpp", it truncates compiler error output to 64kB, and it links, adding extra errors. So it won't be a good validation tool.

I have been using GCC 4.9.2 from the toolchain-test Ubuntu repo.

What are default options? As far as I know, you can configure the default options of gcc at compile time.

@FUZxxl - if you are compiling gcc, then you need to use the default default options of gcc.

@MarkLakata So, the gcc binaries shipped by most Linux distributions are disqualified?

@FUZxxl Technically, all gcc binaries are disqualified unless they have the same output as http://ideone.com, which was defined as the reference compiler in the rules.

Brings back memories: from around 1975 our physics teacher ran an annual "most errors from 10 (hand) punched-cards of Fortran" competition...

gcc 4.5.2, Score: 8579.15 (or 14367.49 for filename "a.C", may update later)
Original file, 29 bytes, compiles clean (a.cpp):
#if 0
#include"a.cpp"
#endif

Modified file, 30 bytes:
#iff 0
#include"a.cpp"
#endif

Errors:
$ gcc -c a.cpp 2>&1 | wc -c
1286873

Score:
1286873 / (30 * 5) = 8579.15
Head and tail of error output:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0,
                 from a.cpp:2:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:1:2: error: invalid preprocessing directive #iff
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2:

... And so on, backing out with second error after max include depth:

a.cpp:3:2: error: #endif without #if
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:3:2: error: #endif without #if
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:3:2: error: #endif without #if
In file included from a.cpp:2:0,
                 from a.cpp:2,
                 from a.cpp:2:
a.cpp:3:2: error: #endif without #if
In file included from a.cpp:2:0,
                 from a.cpp:2:
a.cpp:3:2: error: #endif without #if
In file included from a.cpp:2:0:
a.cpp:3:2: error: #endif without #if
a.cpp:3:2: error: #endif without #if

Note:
- If .C ends up qualifying as a valid extension then score is 1,206,869 / (28 * 3) = 14,367.49.
- If Dennis' suggested second #include is added, file name "a.cpp", score is 80,797,292,934 / (46 * 5) = 351,292,578.97

The question says to add a character, not to replace it.

@Dennis Oh man. I got this. Watch this second edit. Your comment was a blessing in disguise.

@JasonC I can't upvote this enough times.

I think you can claim an infinite score if you add a second #include"a.cpp".

@Dennis Whoa, nice! I'm going to leave the answer as-is since I didn't think to add a second #include on my own. As for it being infinite... if it's still running when I wake up tomorrow morning, it's infinite enough for me. Will keep you posted, ha (although, it's currently piping 5.1MB/sec to wc, so if wc is using a 32-bit counter, by my calculations something weird may happen in about 13 minutes.)

@JasonC: Not infinite after all, I'm afraid. GCC eventually bails out.

@Dennis The moment you posted that comment, my re-compilation attempt after this morning's unfortunate window closure finished, with 80,797,292,934 bytes of output (which is weird, because gcc finishes fine with a second include in my version, but crashes on your original version after only half the output). So adding a second include to mine here would lead to 80797292934/(46*5)=351,292,578, which is actually higher than the one you've got now! Probably a bit higher with "a.C" too.

@JasonC: That's what I get for trying to make my answer different. Your iff generates a lot of additional output, so I guess the performs the same number of iterations, but each one has more bytes in it.

Just did some tests (not a C/C++ programmer) with GCC 4.9.2: https://gist.github.com/max-m/0cb1f1584357566f09f8
Your GCC 4.5.2 seems to generate more output for your example. Oh and by the way your modified example is 29 bytes in size, if I’m not mistaken (should increase your score a tad bit). :)

gcc 4.9.2, score: 222,898,664 663,393,783
This is heavily based on @JasonC's answer, but he said he didn't want to take credit for this improvement.
The error output of the code below is 126,044,818,789 bytes long. The score should be much higher in theory (and tend to infinity as the number of include statements increases), but it decreases in practice by adding more include statements.
Original file (37 bytes)
/*#
#include"w.cpp"
#include"w.cpp"*/

$ gcc -c w.cpp
$

Modified file (38 bytes)
/
*#
#include"w.cpp"
#include"w.cpp"*/

$ gcc -c w.cpp
w.cpp:2:2: error: stray ‘#’ in program
 *#
  ^
In file included from w.cpp:3:0:
w.cpp:2:2: error: stray ‘#’ in program
 *#
  ^
In file included from w.cpp:3:0,
                 from w.cpp:3:
w.cpp:2:2: error: stray ‘#’ in program
 *#
  ^
In file included from w.cpp:3:0,
                 from w.cpp:3,
                 from w.cpp:3:
w.cpp:2:2: error: stray ‘#’ in program
 *#
  ^
In file included from w.cpp:3:0,
                 from w.cpp:3,
                 from w.cpp:3,
                 from w.cpp:3:
⋮
w.cpp:2:2: error: stray ‘#’ in program
 *#
  ^
w.cpp:3:0: error: #include nested too deeply
 #include"w.cpp"
 ^
w.cpp:4:0: warning: extra tokens at end of #include directive
 #include"w.cpp"*/
 ^
w.cpp:4:0: error: #include nested too deeply
w.cpp:2: confused by earlier errors, bailing out
The bug is not reproducible, so it is likely a hardware or OS problem.

This will not technically produce infinite output, although, with current (or foreseeable) computer technology, you won't live long enough to see it stop. Basically, GCC has an #include nesting limit of 200 levels, so your recursive #includes effectively become a 200-bit binary counter.

Just add more include lines to get a infinite score. The output size grows faster than the code.

It could equally have been based on one of the answers from an earlier question.

It did finish this morning, with some huge number that started with an 8, and I accidentally closed the window before copying the number, because I'm awesome. I'm running it again.

@JasonC I ran it too and got an output of 77,877,399,160 bytes. That's a lot less infinite than I expected, so I'll run it again with a shorter filename.

@PeterTaylor It could have been, but was it?

@Dennis For the program in your post, on my machine gcc (4.5.2, mingw) crashed after about an hour, outputting 43,054,270,000 bytes before doing so.

@JasonC: Oh, that's on Windows. I assume GCC would have to print carriage returns on Windows. I got 42,350,746,317 bytes with the shorter filename. I'll run it again, piping the output to tail. I'm eager to see why exactly GCC gives up at the end.

@Dennis: I tried tailing the output on my laptop too, and, after a little over 2^23 "#include nested too deeply" errors, got "virtual memory exhausted: Cannot allocate memory".

Preprocessor errors like no macro name given in #define directive seemed to use much less memory.

@jimmy23013: Oh, that looks promising. I'm running it right now.

@jimmy23013: A stray # turned out to allow GCC to try even longer and produce 50% more output. I have no idea why though...

gcc, 4.9.2, Score: 22.2
Original file: 0 bytes (a.cpp)
Compiles clean:
$ gcc -c a.cpp |& wc -c
0

Modified file:
(

Errors:
$ gcc -c a.cpp |& wc -c
111

Score
111/1/5 = 22.2

Did you already brute-force this? I mean, is this the highest score for a 0 byte start file?

No I did not brute force this. I just tried 3 or 4 different characters. This was just a seed answer to get people interested in the contest :)

11,126.95 9,105.44 2,359.37 1,645.94 266.88 points
More preprocessor abuse! This time, we're making the standard library cry.
Without typo:
#define typedf
#include<fstream>

With typo:
#define typedef
#include<fstream>

Errors:
In file included from /usr/include/c++/4.9/iosfwd:39:0,
                 from /usr/include/c++/4.9/ios:38,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from a.C:2:
/usr/include/c++/4.9/bits/stringfwd.h:62:33: error: aggregate ‘std::basic_string<char> std::string’ has incomplete type and cannot be defined
   typedef basic_string<char>    string;
                                 ^
/usr/include/c++/4.9/bits/stringfwd.h:68:33: error: aggregate ‘std::basic_string<wchar_t> std::wstring’ has incomplete type and cannot be defined
   typedef basic_string<wchar_t> wstring;
                                 ^
/usr/include/c++/4.9/bits/stringfwd.h:78:34: error: aggregate ‘std::basic_string<char16_t> std::u16string’ has incomplete type and cannot be defined
   typedef basic_string<char16_t> u16string;
                                  ^
/usr/include/c++/4.9/bits/stringfwd.h:81:34: error: aggregate ‘std::basic_string<char32_t> std::u32string’ has incomplete type and cannot be defined
   typedef basic_string<char32_t> u32string;
                                  ^
In file included from /usr/include/wchar.h:36:0,
                 from /usr/include/c++/4.9/cwchar:44,
                 from /usr/include/c++/4.9/bits/postypes.h:40,
                 from /usr/include/c++/4.9/iosfwd:40,
                 from /usr/include/c++/4.9/ios:38,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from a.C:2:
/usr/include/stdio.h:48:25: error: aggregate ‘_IO_FILE FILE’ has incomplete type and cannot be defined
 typedef struct _IO_FILE FILE;
                         ^
/usr/include/stdio.h:64:25: error: aggregate ‘_IO_FILE __FILE’ has incomplete type and cannot be defined
 typedef struct _IO_FILE __FILE;
                         ^
In file included from /usr/include/c++/4.9/cwchar:44:0,
                 from /usr/include/c++/4.9/bits/postypes.h:40,
                 from /usr/include/c++/4.9/iosfwd:40,
                 from /usr/include/c++/4.9/ios:38,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from a.C:2:
/usr/include/wchar.h:106:9: error: ‘__mbstate_t’ does not name a type
 typedef __mbstate_t mbstate_t;
         ^
/usr/include/wchar.h:151:38: error: ‘size_t’ is not a type
     const wchar_t *__restrict __src, size_t __n)
                                      ^
/usr/include/wchar.h:159:38: error: ‘size_t’ is not a type
     const wchar_t *__restrict __src, size_t __n)
                                      ^
/usr/include/wchar.h:166:63: error: ‘size_t’ is not a type
 extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^
/usr/include/wchar.h:176:4: error: ‘size_t’ is not a type
    size_t __n) __THROW;
    ^
In file included from /usr/include/wchar.h:180:0,
                 from /usr/include/c++/4.9/cwchar:44,
                 from /usr/include/c++/4.9/bits/postypes.h:40,
                 from /usr/include/c++/4.9/iosfwd:40,
                 from /usr/include/c++/4.9/ios:38,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from a.C:2:
/usr/include/xlocale.h:42:9: error: ‘__locale_t’ does not name a type
 typedef __locale_t locale_t;
         ^
In file included from /usr/include/c++/4.9/cwchar:44:0,
                 from /usr/include/c++/4.9/bits/postypes.h:40,
                 from /usr/include/c++/4.9/iosfwd:40,
                 from /usr/include/c++/4.9/ios:38,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from a.C:2:
/usr/include/wchar.h:183:5: error: ‘__locale_t’ is not a type
     __locale_t __loc) __THROW;
     ^
/usr/include/wchar.h:186:6: error: ‘size_t’ is not a type
      size_t __n, __locale_t __loc) __THROW;
      ^
/usr/include/wchar.h:186:18: error: ‘__locale_t’ is not a type
      size_t __n, __locale_t __loc) __THROW;
                  ^
/usr/include/wchar.h:196:8: error: ‘size_t’ does not name a type
 extern size_t wcsxfrm (wchar_t *__restrict __s1,
        ^
/usr/include/wchar.h:207:9: error: ‘__locale_t’ is not a type
         __locale_t __loc) __THROW;
         ^
/usr/include/wchar.h:212:8: error: ‘size_t’ does not name a type
 extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
        ^
/usr/include/wchar.h:252:8: error: ‘size_t’ does not name a type
 extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
        ^
/usr/include/wchar.h:256:8: error: ‘size_t’ does not name a type
 extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
        ^
/usr/include/wchar.h:287:8: error: ‘size_t’ does not name a type
 extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
        ^
/usr/include/wchar.h:306:8: error: ‘size_t’ does not name a type
 extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
        ^

[SNIP]
/usr/include/c++/4.9/bits/fstream.tcc:934:35: error: ‘cur’ is not a member of ‘std::ios_base’
    __testvalid = this->seekoff(0, ios_base::cur, _M_mode)
                                   ^
/usr/include/c++/4.9/bits/fstream.tcc:934:50: error: ‘_M_mode’ was not declared in this scope
    __testvalid = this->seekoff(0, ios_base::cur, _M_mode)
                                                  ^
/usr/include/c++/4.9/bits/fstream.tcc:941:25: error: ‘_M_state_last’ was not declared in this scope
    + _M_codecvt->length(_M_state_last, _M_ext_buf,
                         ^
/usr/include/c++/4.9/bits/fstream.tcc:944:15: error: ‘streamsize’ does not name a type
         const streamsize __remainder = _M_ext_end - _M_ext_next;
               ^
/usr/include/c++/4.9/bits/fstream.tcc:945:13: error: ‘__remainder’ was not declared in this scope
         if (__remainder)
             ^
/usr/include/c++/4.9/bits/fstream.tcc:949:35: error: ‘__remainder’ was not declared in this scope
         _M_ext_end = _M_ext_buf + __remainder;
                                   ^
/usr/include/c++/4.9/bits/fstream.tcc:951:25: error: ‘_M_state_cur’ was not declared in this scope
         _M_state_last = _M_state_cur = _M_state_beg;
                         ^
/usr/include/c++/4.9/bits/fstream.tcc:951:40: error: ‘_M_state_beg’ was not declared in this scope
         _M_state_last = _M_state_cur = _M_state_beg;
                                        ^
/usr/include/c++/4.9/bits/fstream.tcc:960:2: error: ‘_M_codecvt’ was not declared in this scope
  _M_codecvt = _M_codecvt_tmp;
  ^
/usr/include/c++/4.9/bits/fstream.tcc:960:15: error: ‘_M_codecvt_tmp’ was not declared in this scope
  _M_codecvt = _M_codecvt_tmp;
               ^
/usr/include/c++/4.9/bits/fstream.tcc:962:2: error: ‘_M_codecvt’ was not declared in this scope
  _M_codecvt = 0;
  ^

On my Ubuntu machine, g++-4.9 -std=c++11 -c a.C generates 1,101,568 glorious bytes of errors, for a score of 1101568/33/3 = 11,126.95.

You should write a program to analyze all the std headers and determine which #define gives you the most points.

You can worsen it further by replacing typedef by t;. Now you not only break every use of typedef but you get a ton of "t does not name a type" errors as well. Or %; to produce "expected unqualified-id before % token".

#define typename * and #define int class std seemed to generate much more errors.

62.93 points
Just some C++ meta black magic, compiled with g++-4.8 -c -std=c++11 a.cc:
#include<memory>
template<int n>class B:std::unique_ptr<B<n-1>>{};template<>class B<0>{};B<-1>x;

Ungolfed:
#include <memory>

template<int n>
class B: std::unique_ptr<B<n-1>> {};

template<>
class B<0> {};

B<-1>x;

G++ has a recursion limit of 900, so changing B<1> to B<-1> with a 31-bit range has an... interesting effect.

96 bytes of code (not counting the final \n some text editors automatically add, vim doesn't).
4-letter filename, a.cc
24165 bytes of error message, and it's truncated. The full error message has a whopping 1235889 bytes of content. It would require the -ftemplate-backtrace-limit=0 switch. It would also mean 3185 points for me!

std::unique_ptr is just the template class that manages to emit the longest error message, found by trial and error and knowledge of the STL and cats and stuff.

But... how can I get rid of 6 whitespaces when I only have 3 in the code, @JasonC!

Score 7.865
Strictly speaking, the 0-byte-Answer is NOT correct, as ideone.com will refuse to compile the file without error. The same is true with the example int foo(); - it won't compile on ideone.com (I'm unable to comment because of missing reputation...)
So the smallest possible program to compile without any #includes is this:
int main(){}

If you change this to the following code, it will fail with 409 bytes of error code (after renaming prog.cpp to a.cc from the ideone.com output):
int main(){[}

409 / ( 13 * 4 ) = 7.865
Please update the question accordingly, as the examples given don't respect the given rules...

The whole ideone thing is all kinds of goofy.

I agree, I tacked on ideone rule after the question was posted and the first answers given. Cat is sort of out of the bag now.

C, named as .cc
main(){constexprs a(){*(int*)0=f;}a(0)}

Error code:
.code.tio.cpp: In function ‘int main()’:
.code.tio.cpp:1:8: error: ‘constexprs’ was not declared in this scope
 main(){constexprs int a(f){*(int*)0=f;}a(0);}
        ^~~~~~~~~~
.code.tio.cpp:1:8: note: suggested alternative: ‘__cpp_constexpr’
 main(){constexprs int a(f){*(int*)0=f;}a(0);}
        ^~~~~~~~~~
        __cpp_constexpr
.code.tio.cpp:1:40: error: ‘a’ was not declared in this scope
 main(){constexprs int a(f){*(int*)0=f;}a(0);}

Hello again! What is the original program that does not error? (I assume it is main(){}, but I am not sure) Also, isn't this just an improvement of the answer above? While you can certainly keep this answer, if it was inspired by @StefanM's answer, you should mention that. Finally, now that you have 50 rep, you can comment anywhere.

I think this is too close to Stefan M.'s answer; I would post this as a recommended improvement for that solution. That being said, duplicate answers are allowed. Please do put the original here though and mention any inspirations (though it is possible you came up with this independently, as well)

Score 12.xx (error by DELETING a character)
Please forgive the breaking of Rule 2 (IMHO adding OR deleting one character would be in the spirit of the rule), but this happened to me accidentally (thus doesn't use any 'intentionally' abusive tricks) while writing Real Code (TM) - both the working and error-causing code are (or look) simple and straightforward, so I thought it neat enough to include here.
Original code
#include <iostream>
using namespace std;
int main ()
{
cout<<"test"<<endl;
}

Code generating the error (last '<' deleted so it looks like a less-than comparison, but noooooooooooo ...)
#include <iostream>
using namespace std;
int main ()
{
cout<<"test"<endl;
}

It's 'only' 8241 bytes of compiler error messages in ideone.com g++ 4.3.2.
ETA: Added a couple of lines to make it fit the rules. I knew these silly macros would come in handy someday. Ashamed it took so long because I've known C very well for a very long time. This code compiles and runs:
#include <iostream>
using namespace std;
#define a <<
#define aa <
int main ()
{
    cout<<"test" a endl;
}

Add another letter a after "test" a to make it fail:
#include <iostream>
using namespace std;
#define a <<
#define aa <
int main ()
{
    cout << "test" aa endl;
}

Even if it seems to be in the spirit of the challenge (since the title says "one character typo"), this doesn't follow rule 2 which says that you can only add a character, not delete or change.

source: Stack Exchange

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

sort: votes


text:
Build a one-word search generator
The word BANANA appears exactly once in this word search:
B A N A A N B B
A B A N A B A N
A N A B N N A A
N N B A A A N N
N A A N N N B A
A N N N B A N A
N A A B A N A N
B A N A N B B A

The word search above contains only one occurrence of the word BANANA looking up, down, left, right, or diagonally, but it has lot of similar words, like BANANB, BANNANA, BNANA, etc.
Your job is to build a program that will generate infuriating word searches like this one.
Your program will take as input:

One word, in all capital letters, containing from three to seven unique letters with at least four letters total.
One number, to represent the dimension of the square grid for the word search. The number must be at least the number of letters in the word.

And then, output a word search using only the letters in the word, that contains exactly one occurrence of the input word, and as many infuriators as possible.
An infuriator is defined as a string that has a Damerau-Levenshtein distance of one from the target word and begins with the same letter as the word. For BANANA, this would include words like:

BANBNA, where one of the letters was substituted.
BANNANA or BANAANA, where an extra letter was added.
BANAN, BNANA, where a letter was deleted, but not ANANA, since there's no longer a B.
BAANNA or BANAAN, where two consecutive letters were switched.

When counting infuriators on a word search grid, they may overlap, but you cannot count a large string if it completely contains a smaller string you've already counted, or vice versa. (If you have BANANB, you can't count it again if you've already counted the BANAN or the backwards BNANA inside it.) You also cannot count any strings that completely contain or are completely contained by the target word itself (you cannot count the specific BANAN that is part of BANANA, nor BANANAA or BANANAN.)

Your program will be tested on a specific word list composed of the words that fit the input word requirement (to be given later once I've generated it), on a grid size equal to double the length of the word, and will be scored on the number of infuriators present in each grid. Please post your results for the inputs BANANA 12, ELEMENT 14, and ABRACADABRA 22 for verification.

Your infuriators are aptly named.

I take it you still haven't found banana yet?

I found it!

Something like MURMURS seems like a good test case, since I'd imagine an optimal answer would involve dropping the S

My kids love it.  Great challenge

Do diagonals count as well?

@tolos I take it you haven't found banana yet either

@tolos Yes, diagonals count. I was sure I'd put it in the problem statement somewhere...

@JoeZ. Are you sure you will be able to run all the given answers and compare their results? There are many obscure programming languages; some of them run only on a specific hardware platform, some have buggy or slow interpreters, etc. Maybe it's better to just announce all the test cases that define the score.

Whereas if you allowed arbitrary polyominoes, it would be in there at least a half dozen times.

@anatolyg I plan on announcing all the test cases by uploading the test case file. I just haven't gotten around to generating the file yet because I don't know what algorithm to use.

I think there should be a validator that can computes the official score for a given submission.

JavaScript
Bonus: You can seed the Word search. Default seed is: "codechallenge"

ws = document.getElementById("word_search");
Math.seedrandom("CodeChallenge");
m = -1;
n = 0;
x = 0;
var addMethod = 1;
var addFail = 0;
var final = false;

function reset() {
    ws.innerHTML = '';
}

function write(str1) {
    ws.innerHTML += "
" + str1 + "
";
}

document.getElementById("word").oninput = function () {
    document.getElementById("word").value = document.getElementById("word").value.toUpperCase();
};

document.getElementById("size").onblur = function () {

    if (document.getElementById("word").value.length > document.getElementById("size").value) {
        document.getElementById("size").value = document.getElementById("word").value.length;
    }
    if (document.getElementById("word").value == "") {
        document.getElementById("size").value = "0";
    }
};

document.getElementById("go").onclick = function () {
    reset();
    word = document.getElementById("word").value.toUpperCase();
    size = document.getElementById("size").value;
    if (size == 0) {
        word = "BANANA";
        return;
    }
    data = new Array();
    for (var i = 0; i < size; i++) {
        data[i] = new Array();
        for (var j = 0; j < size; j++) {
            data[i][j] = "NONE";
        }
    }

    while (add(dld(word)))
    for (var i = 0; i < size; i++) {
        for (var j = 0; j < size; j++) {
            if (data[i][j] == "NONE") {
                data[i][j] = word.charAt(Math.floor(Math.random() * word.length))
            }
            if (data[i][j] == "") {
                data[i][j] = word.charAt(Math.floor(Math.random() * word.length))
            }
        }
    }

    finalput(Math.floor(Math.random() * size), Math.floor(Math.random() * size), word);

    for (var i = 0; i < size; i++) {
        write(data[i].toString().replace(/,/g, ""));
    }

};

function test(x1, y1, x2, y2) {
    if (x2 > size || x2 < 0 || y2 > size || y2 < 0 || x1 > size || x1 < 0 || y1 > size || y1 < 0) {
        return false;
    }
    try {
        switch (true) {
            case x1 == x2 && y1 < y2:
                for (var c = y1; c < y2; c++) {
                    if (data[x1][c] != "NONE") {
                        return false;
                    }
                }
                break;
            case x1 == x2 && y1 > y2:
                for (var c = y2; c < y1; c++) {
                    if (data[x1][c] != "NONE") {
                        return false;
                    }
                }
                break;
            case y1 == y2 && x1 < x2:
                for (var c = x1; c < x2; c++) {
                    if (data[y1][c] != "NONE") {
                        return false;
                    }
                }
                break;
            case y1 == y2 && x2 < x1:
                for (var c = x2; c < x1; c++) {
                    if (data[y1][c] != "NONE") {
                        return false;
                    }
                }
                break;
            case y1 != y2 && x1 != x2:
                var x = x1;
                var y = y1;
                while (true) {
                    if (x == x2 || y == y2) {
                        return true;
                    }
                    if (data[x][y] != "NONE") {
                        return false;
                    }
                    if (x < x2) {
                        x++;
                    } else {
                        x--;
                    }
                    if (y < y2) {
                        y++;
                    } else {
                        y--;
                    }
                }
                break;
        }
    } catch (err) {
        return false;
    }
    return true;
}

function put(arg1, arg2, str1) {
    var w = Math.floor(Math.random() * 8) + 1;
    for (var l = 0; l < 8; l++) {
        switch (w) {
            case 1:
                //Right
                if (test(arg1, arg2, arg1, arg2 + str1.length)) {
                    for (var h = arg2; h < arg2 + str1.length; h++) {
                        data[arg1][h] = str1.charAt(h - arg2);
                    }
                } else {
                    w++;
                }
                break;
            case 2:
                if (test(arg1, arg2, arg1 + str1.length, arg2 + str1.length)) {
                    var g = arg1 - 1;
                    var h = arg2 - 1;
                    var i = -1;
                    while (i < str1.length) {
                        g++;
                        h++;
                        i++;
                        data[g][h] = str1.charAt(i);
                    }
                } else {
                    w++;
                }
                break;
            case 3:
                //Down
                if (test(arg1, arg2, arg1 + str1.length, arg2)) {
                    for (var h = arg1; h < arg1 + str1.length; h++) {
                        data[h][arg2] = str1.charAt(h - arg1);
                    }
                } else {
                    w++;
                }
                break;
            case 4:
                if (test(arg1, arg2, arg1 + str1.length, arg2 + str1.length)) {
                    var g = arg1 + 1;
                    var h = arg2 - 1;
                    var i = -1;
                    while (i < str1.length) {
                        g--;
                        h++;
                        i++;
                        data[g][h] = str1.charAt(i);
                    }
                } else {
                    w++;
                }
                break;
            case 5:
                //Left
                if (test(arg1, arg2, arg1, arg2 - str1.length)) {
                    for (var h = arg2; h > arg2 - str1.length; h--) {
                        data[arg1][h] = str1.charAt(Math.abs(h - arg2));
                    }
                } else {
                    w++;
                }
                break;
            case 6:
                if (test(arg1, arg2, arg1 + str1.length, arg2 + str1.length)) {
                    var g = arg1 + 1;
                    var h = arg2 + 1;
                    var i = -1;
                    while (i < str1.length) {
                        g--;
                        h--;
                        i++;
                        data[g][h] = str1.charAt(i);
                    }
                } else {
                    w++;
                }
                break;
            case 7:
                //UP
                if (test(arg1, arg2, arg1 - str1.length, arg2)) {
                    for (var h = arg1; h > arg1 - str1.length; h--) {
                        data[h][arg2] = str1.charAt(Math.abs(h - arg1));
                    }
                } else {
                    w++;
                }
                break;
            case 8:
                if (test(arg1, arg2, arg1 + str1.length, arg2 + str1.length)) {
                    var g = arg1 - 1;
                    var h = arg2 + 1;
                    var i = -1;
                    while (i < str1.length) {
                        g++;
                        h--;
                        i++;
                        data[g][h] = str1.charAt(i);
                    }
                } else {
                    w++;
                }
                break;
        }
    }
}

function finalput(arg1, arg2, str1) {
    if (final == false) {
        try {
            var w = Math.floor(Math.random() * 8) + 1;
            console.log(arg1 + "," + arg2 + "," + w);
            for (var l = 0; l < 8; l++) {
                switch (w) {
                    case 1:
                        //Right

                        for (var h = arg2; h < arg2 + (str1.length - 1); h++) {
                            data[arg1][h] = str1.charAt(h - arg2);
                            if(h<0){throw "err";}
                        }

                        break;
                    case 2:

                        var g = arg1 - 1;
                        var h = arg2 - 1;
                        var i = -1;
                        while (i < str1.length - 1) {
                            g++;
                            h++;
                            i++;
                            data[g][h] = str1.charAt(i);
                            if(h<0){throw "err";}
                        }

                        break;
                    case 3:
                        //Down

                        for (var h = arg1; h < arg1 + (str1.length - 1); h++) {
                            data[h][arg2] = str1.charAt(h - arg1);
                            if(arg2<0){throw "err";}
                        }

                        break;
                    case 4:

                        var g = arg1 + 1;
                        var h = arg2 - 1;
                        var i = -1;
                        while (i < str1.length - 1) {
                            g--;
                            h++;
                            i++;
                            data[g][h] = str1.charAt(i);
                            if(h<0){throw "err";}
                        }

                        break;
                    case 5:
                        //Left

                        for (var h = arg2; h > arg2 - (str1.length - 1); h--) {
                            data[arg1][h] = str1.charAt(Math.abs(h - arg2));
                            if(h<0){throw "err";}
                        }

                        break;
                    case 6:

                        var g = arg1 + 1;
                        var h = arg2 + 1;
                        var i = -1;
                        while (i < str1.length - 1) {
                            g--;
                            h--;
                            i++;
                            data[g][h] = str1.charAt(i);
                            if(h<0){throw "err";}
                        }

                        break;
                    case 7:
                        //UP

                        for (var h = arg1; h > arg1 - (str1.length - 1); h--) {
                            data[h][arg2] = str1.charAt(Math.abs(h - arg1));
                            if(arg2<0){throw "err";}
                        }

                        break;
                    case 8:

                        var g = arg1 - 1;
                        var h = arg2 + 1;
                        var i = -1;
                        while (i < str1.length - 1) {
                            g++;
                            h--;
                            i++;
                            data[g][h] = str1.charAt(i);

                            if(h<0){throw "err";}
                        }

                        break;
                }
            }
            final = true;
        } catch (err) {
            console.count("Anwser Fail");
            setTimeout(finalput(Math.floor(Math.random() * (size - (word.length * 2))) + word.length, Math.floor(Math.random() * (size - (word.length * 2))) + word.length, str1),50);
        }
    }

    return arg1 + "," + arg2 + "," + w;
}

function add(str1) {
    switch (addMethod) {
        case 1:
            if (typeof x == "undefined") {
                var x = Math.floor(Math.random() * size + 1);
                var y = Math.floor(Math.random() * size + 1);
            }
            try {
                while (data[x][y] != "NONE" && addFail <= 10) {
                    x = Math.floor(Math.random() * size + 1);
                    y = Math.floor(Math.random() * size + 1);
                    addFail++;
                }
            } catch (err) {
                return true;
                addFail++;
            }
            if (addFail == 11) {
                addMethod = 2;
                return add(str1);
            }
            try {
                put(x, y, str1);
            } catch (err) {
                return true;
            }
            addFail = 0;
            return true;
            break;
        case 2:
            m++;
            if (m == size) {
                m = 0;
                n++;
            }
            if (n == size) {
                addMethod = 3;
                return add(str1);
            }
            try {
                if (data[n][m] == "NONE") {
                    put(n, m, str1);
                }
            } catch (err) {
                return true;
            }

        case 3:
            for (var i = 0; i < size; i++) {
                for (var j = 0; j < size; j++) {
                    if (data[i][j] == "NONE") {
                        data[i][j] = str1.charAt(Math.floor(Math.random() * str1.length));
                    }
                }
            }
            return false;
    }
}

function dld(str1) {
    var result = "";
    switch (Math.floor(Math.random() * 4)) {
        case 0:
            //replace one letter
            var q = Math.floor(Math.random() * (word.length - 1)) + 1;
            result = word.slice(0, q) + word.charAt(Math.floor(Math.random() * word.length)) + word.slice(q + 1, word.length);
            break;
        case 1:
            //Add one letter
            var q = Math.floor(Math.random() * (word.length - 1)) + 1;
            result = word.slice(0, q) + word.charAt(Math.floor(Math.random() * word.length)) + word.slice(q, word.length);
            break;
        case 2:
            //Delete letter
            var q = Math.floor(Math.random() * (word.length - 1)) + 1;
            result = word.slice(0, q) + word.slice(q + 1, word.length - 1);
            break;
        case 3:
            var q = Math.floor(Math.random() * (word.length - 1)) + 1;
            result = word.slice(0, q) + word.charAt(q + 1) + word.charAt(q) + word.slice(q + 2, word.length);
            break;
    }
    if (result.search(str1) != -1) {
        return dld(str1);
    }
    return result;
}

<input type="text" id="word" value="BANANA" placeholder="BANANA"></input>
<input type="number" id="size" value="12" placeholder="Size"></input>
<input type="button" id="go" value="Go!"></input>

BANANA - 12:
AANananabABA
BNBAAANNNNAB
NABNAAANANNA
BAAABNNNNANB
BAANAANAAAAA
NABANANBNNBN
ABBAANBBAAAN
BNANBNBAAAAA
AANAANAANNAA
BNBNBBBNAANA
ABBNABBBANNB
ABNBAAAABNNA

ELEMENT - 14:
MEEMMLNLETELEN
LLENNMENEEMEEE
MEMELMEELTELEN
NNMEEEEETNTLNM
TLLEMTETNMNEEE
EELEELLENENTTE
EELMEMELMMLTTE
EEMNLENeTEENLN
EEEETElELEEEEE
EEMNEeMENEMTET
ENNNmNENEEEEEE
ETEeNEELLENLEE
LLnELTNEMLLEEE
EtTELLEENMEMNE

Good luck:
ABRACADABRA - 22:
DRADCBBAAAABABABARBCCB
DBCABAAADABACDBAAAARBA
CDABBDRBRRBDARRDCRARRA
BAAAACRABRACBARAAABBRC
ACARDARARAAAABRABAADBB
BBAAAARBCDRAACDAADARAB
ABBAAAARABBBAAABACDAAA
AADARDARAAARABRCBABRBB
ARRADCCDACRAAAAAADBAAC
AAAABBARDBAARRCABRDDAA
RADABRAAARAABRRAARDARB
AARARCRBAACARBABRDDDAA
BABACDCCARCRAAADCABARA
RBABACAAAAAACDARRBCACR
RARABBADRARBCRAABRDRAR
BBRAAAAABRBAAABRAACRAR
BAADRAAAABRDAAABBBBAAA
RAADRACDAADABRACAAABRR
AARAAABBAAABRAABCCBAAR
RAAAAAARBRRBARAAAAAARR
RCAAAAARARBRCCBBCCACAA
DAAAABARDABADRAADAAACC

 If you run this in the snippet, and look at the console, the last number will show the coords of the beginning of the answer.

Extra: MISSISSIPPI - 32:
SPSSIIPSMIMIMPMISPPIIPSIIIIISSSS
ISISIISSMPPPISSIISPPPSPSISSSIPMP
PSPMIIMISMISSIPMPIIIIISIMIMSSSSI
PSIISPSIPSPSIPIPMMMIPIISSMMISMMM
SPIISIPMSISPMPPPMIMPIISISIIISIPS
ISSIISMISSPMIPPISSSMSIISIISSMIPS
SSPISIMSSSIPSSSPMSSPISPPSSSSPSSM
IPMIISMISSSSSSSSSPSMPISISIMIISSP
IISSSSMMPSPSISIIISISSMMSISIMPSPP
IIIIIIMIISISMPPPIIISSMSSIPSSSISI
IPIIPPSSSSIISIISSMIPIISSPPSSIPIS
PSISPIIISPPSIIMPIIPSSSSSISPIISSS
SIISSIMSIISSISSSSMIISSIPSIIIIIII
MPSSISSSISISSPMPSISSISSSSISIIMII
ISPSIIIPIIIISMSSMIIPMSSSPSSSSSSS
SSIIIISPIIPIPISIPSMPPMSSSISIIIPI
IPPIPMPIPSIIPPISSPISPSPIIIISIIMS
SPMSSPIIPPSSISISIPSSPSIIISIIIPIP
PSSIIIISMSSIIIMSSIIIPSMPMSIPIIIM
IISSSIIMIMPMISPPIPMMMIIIPSPPSPIS
SISISSIISISSISPSSSSPSIIISIPPISSI
IMSIPSISIIMPSSSISISIISIPSSSSISII
PMIPPPSSISIIISSSSSIIIPISSISIPSMI
ISIPSMMMSMISPISIPSSPSSPISSISIIIS
SISMIIISSIIMSIPMSSSSIPSSSPISPSPI
PPSPISSSISPSIIISSSSPIPSSMIPSSSPS
SSIMSSIISIIPSPSIPSSMSIIIMSSSIPPP
PMSISSPMISIIISIIPSPSPSMSIMISIMIP
IPSISSIIPSSPIMSSSSSSSSSSIIIPISSI
PSIIMIMIISPSSIMISMMPPIPPSSMISMII
IPPIPSIISSSSIPIIPIMMISSIPISIIIIP
IPPISSIMSIIPPSISIISSSMIIIPSIISSS

 Try to find MISSISSIPPI! I will comment the answer later. No cheating.

The second one doesn't contain "ELEMENT" at all. It only contains four T's, and searching backwards reveals that none of the T's lead to proper spellings of ELEMENT.

Oops, I accidentally pasted used a old version of my code. Facepalm

(18, 3) bottom right?

C++
I wrote this one up today. It is not the most efficient way and does not always generate the most random looking word searches but it gets the job done and it does it relatively quick.
Bonus: Supports Palindromes too!!!
It works by taking input for the word and the size of the word search. It then generates infurators by dropping letters, inserting letters, or flipping letters. It then adds those to the grid as well as the correct word. It then checks all instances of the first letter in every direction for the word. If 1 instance is not found ( 2 for palindromes ) it brute forces the cycle over. It then outputs the word search to console as well as a file.
Here it is at 213 lines of code with whitespace and comments.
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#include <stdio.h>
#include <time.h>

// Keep Track of Coordinates
struct XY {

public:
    int X;
    int Y;
};

// Just in case someone breaks the rules
std::string ToUppercase( const std::string& pWord ) {
    char *myArray = new char[ pWord.size() + 1 ];
    myArray[ pWord.size() ] = 0;
    memcpy( myArray, pWord.c_str(), pWord.size() );

    for ( unsigned int i = 0; i < pWord.size(); i++ ) {
        if ( (int) myArray[ i ] >= 97 && (int) myArray[ i ] <= 122 ) {
            myArray[ i ] = (char) ( (int) myArray[ i ] - 32 );
        }
    }

    return std::string( myArray );
}

// Random number between a max and min inclusively
int RandomBetween( int pMin, int pMax ) {
    return rand() % ( pMax - pMin + 1 ) + pMin;
}

// Find all instances of a character
std::vector<XY> FindHotspots( const std::vector<char> &pWordSearch, char pFirstChar, unsigned int pLength ) {
    std::vector<XY> myPoints;
    for ( unsigned int i = 0; i < pLength; i++ ) {
        for ( unsigned int j = 0; j < pLength; j++ ) {
            if ( pWordSearch[ i * pLength + j ] == pFirstChar ) {
                XY myXY;
                myXY.X = i;
                myXY.Y = j;
                myPoints.push_back( myXY );
            }
        }
    }
    return myPoints;
}

// Searchs each index from specific point in certain direction for word
// True if word is found
bool Found( const std::vector<char> &pWordSearch, const std::string &pWord, int pRow, int pCol, int pX, int pY, int pLength ) {
    for ( unsigned int i = 0; i < pWord.length(); i++ ) {
        if ( pRow < 0 || pCol < 0 || pRow > pLength - 1 || pCol > pLength - 1 )
            return false;
        if ( pWord[ i ] != pWordSearch[ pRow * pLength + pCol ] )
            return false;
        pRow += pX;
        pCol += pY;
    }
    return true;
}

// Goes through all the hotspots and searchs all 8 directions for the word
int FindSolution( const std::vector<char> &pWordSearch, const std::string &pWord, unsigned int pLength ) {
    std::vector<XY> myHotspots = FindHotspots( pWordSearch, pWord[ 0 ], pLength );

    int mySolutions = 0;
    for ( unsigned int i = 0; i < myHotspots.size(); i++ ) {
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, 1, 0, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, 1, 1, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, 0, 1, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, -1, 1, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, -1, 0, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, -1, -1, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, 0, -1, pLength ) )
            mySolutions++;
        if ( Found( pWordSearch, pWord, myHotspots[ i ].X, myHotspots[ i ].Y, 1, -1, pLength ) )
            mySolutions++;
    }
    return mySolutions;
}

// Generate words that are similar
//
// 1. Word with last character same as first
// 2. Word with 1 character removed
// 3. Word with 1 character added
std::vector<std::string> GenerateInfurators( const std::string &pWord ) {
    std::vector<std::string> myInfurators;
    for ( unsigned int i = 0; i < pWord.size() / 2; i++ ) {
        char myReplace = '0';
        do {
            myReplace = pWord[ RandomBetween( 0, pWord.size() - 1 ) ];
        } while ( myReplace == pWord[ pWord.size() - 1 ] );
        myInfurators.push_back( pWord.substr( 0, pWord.size() - 2 ) + myReplace );
    }

    for ( unsigned int i = 1; i < pWord.size() - 2; i++ ) {
        myInfurators.push_back( pWord.substr( 0, i ) + pWord.substr( i + 1 ) );

        std::string myWord = pWord;
        myInfurators.push_back( myWord.insert( i, 1, pWord[ i - 1 ] ) );
    }

    return myInfurators;
}

// Adds word in random position in word search
void AddWordRandomly( std::vector<char> &pWordSearch, const std::string &pWord, unsigned int pLength ) {
    int myXDirec = 0;
    int myYDirec = 0;
    do {
        myXDirec = RandomBetween( -1, 1 );
        myYDirec = RandomBetween( -1, 1 );
    } while ( myXDirec == 0 && myYDirec == 0 );

    int myRow = 0;
    if ( myXDirec == 0 ) {
        myRow = RandomBetween( 0, pLength - 1 );
    } else if ( myXDirec > 0 ) {
        myRow = RandomBetween( 0, pLength - pWord.size() - 1 );
    } else {
        myRow = RandomBetween( pWord.size(), pLength - 1 );
    }

    int myCol = 0;
    if ( myYDirec == 0 ) {
        myCol = RandomBetween( 0, pLength - 1 );
    } else if ( myYDirec > 0 ) {
        myCol = RandomBetween( 0, pLength - pWord.size() - 1 );
    } else {
        myCol = RandomBetween( pWord.size(), pLength - 1 );
    }

    for ( unsigned int i = 0; i < pWord.size(); i++ ) {
        pWordSearch[ myRow * pLength + myCol ] = pWord[ i ];
        myRow += myXDirec;
        myCol += myYDirec;
    }
}

// Checks for palindromes
bool WordIsPalindrome( const std::string &pWord ) {
    for ( unsigned int i = 0; i < pWord.size(); i++ ) {
        if ( pWord[ i ] != pWord[ pWord.size() - 1 - i ] )
            return false;
    }
    return true;
}

int main() {
    // Handle all input
    std::string myWord;
    std::cin >> myWord;
    myWord = ToUppercase( myWord );

    std::string myStrLength;
    std::cin >> myStrLength;
    unsigned int mySideLength = std::stoi( myStrLength );

    // Setup variables
    // New time seed
    // Generate infurators
    // Add words
    std::vector<char> myWordSearch;
    srand( ( unsigned int ) time( 0 ) );
    std::vector<std::string> myWords = GenerateInfurators( myWord );
    myWords.push_back( myWord );

    bool myWordIsPalindrome = WordIsPalindrome( myWord );

    // Brute force words until 1 instance only
    // 2 instances for palindromes
    do {
        for ( unsigned int i = 0; i < mySideLength * mySideLength; i++ ) {
            myWordSearch.push_back( myWord[ RandomBetween( 0, myWord.size() -1 ) ] );
        }

        for ( unsigned int j = 0; j < 10; j++ ) {
            for ( unsigned int i = 0; i < myWords.size() - 1; i++ ) {
                AddWordRandomly( myWordSearch, myWords[ i ], mySideLength );
            }
        }
        AddWordRandomly( myWordSearch, myWord, mySideLength );
    } while ( ( FindSolution( myWordSearch, myWord, mySideLength ) != 1 && !myWordIsPalindrome ) ||
            ( FindSolution( myWordSearch, myWord, mySideLength ) != 2 && myWordIsPalindrome ) );

    // Output to console && text file
    std::ofstream myFile( "word_search.txt" );
    for ( unsigned int i = 0; i < mySideLength; i++ ) {
        for ( unsigned int j = 0; j < mySideLength; j++ ) {
            myFile << myWordSearch[ i * mySideLength + j ] << "";
            std::cout << myWordSearch[ i * mySideLength + j ] << " ";
        }
        myFile << "\n";
        std::cout << "\n" << std::endl;
    }
    myFile.close();

    system( "pause" );
    return 0;
}

I am far from a C++ expert so I'm sure there's places where this code could be improved but I was happy with how it ended up.
Here's the outputs.
BANANA-12:
BBBBBABANABB
BBANAAANANBB
BABAANABBABA
BNAANAAANABN
BANNNNNANBBB
AANABNNANNAA
NAANANAAAABA
ANNNBAANNNBN
ABABNAANABNA
BNNANNAAANNB
BBABAAANBBAB
BBANANNBBABB

ELEMENT-14:
MLELEMEEETNEET
EMTTELTEETELEE
EMNNELEENLNTEL
TLTNEEMEEELMTM
TLEMLNLMEEEETE
TTEEEEEENLNTLE
NETNENEEMTTMEN
ELELTETEEMNMEE
MTEEMTNEEEENEM
ELENEEEMMENNME
ELLEELELTMLETL
ETLTNEMEEELELE
EELTLLLLLMNEEE
EEEELEMNTLEEEE

ABRACADABRA-22:
ACRABAACADABBADBRRAAAA
BBABAABAARBAAAARBAABAA
RARRARBAAABRRRRAAABBRA
DABARRARABBBBABABARABR
BRBACABBAAAABAARRABDAD
ABRRCBDADRARABAACABACR
DCAAARAABCABRCAAAARAAA
AAABACCDCCRACCDARBADBA
CAARAAAAAACAAABBAACARA
ADRABCDBCARBRRRDAABAAR
RARBADAARRAADADAABAAAB
BBRRABAABAAADACACRBRAA
ARBBBDBRADCACCACARBABD
CAARARAAAACACCDARARAAA
ARABADACRARCDADABADBBA
RARAADRRABADBADAABBAAA
RAAAABBBARRDCAAAAAARRA
BABBAAACRDBABCABBBRAAR
AARARAARABRAAARBRRRAAB
BAAAARBRARARACAARAAAAA
ADCBBABRBCBDBRARAARBAA
AARBADAAAARACADABRAABB

Bonus: RACECAR-14:
RRACEARCECARAR
RRRRRRRRRCARAR
RARRAACECARAAA
CCACECRREAECAR
RECEAEEAAECEAE
RCRRREACCCCEAR
RRRARCERREERRR
CCARAAAAECCARC
ECECARRCCECCRR
CARRRACECCARAC
ACRACCAAACCCAR
ARRECRARRAAERR
RRCRACECARRCRR
RRRRACECRARRRR

I may update this to generate slightly more "random" looking word searches.

LOL. I merely glanced at the RACECAR one and found it immediately!

Excel VBA
Dim l() As String
w = InputBox("w")
n = InputBox("n")
ReDim l(Len(w))
Var = w
q = Len(w)
For i = 1 To Len(w)
l(i) = Left(Var, 1)
Var = Right(Var, Len(w) - i)
Next i
Cells(Int((q) * Rnd + 1), Int(((n - q) * Rnd + 1))).Select
r = Int((3) * Rnd + 1)
If r = 1 Then
For i = 0 To q - 1
ActiveCell.Offset(0, i) = l(i + 1)
Next
ElseIf r = 2 Then
For i = 0 To q - 1
ActiveCell.Offset(i, 0) = l(i + 1)
Next
ElseIf r = 3 Then
For i = 0 To q - 1
ActiveCell.Offset(i, i) = l(i + 1)
Next
End If
For i = 1 To n
For j = 1 To n
If Cells(i, j) = "" Then
Cells(i, j) = l(Int((q - 1) * Rnd + 1))
End If
Next j
Next i

It works by first randomly placing the word in the spread sheet, random in both position and direction, then filling the non-empty spaces in the surrounding grid by randomly choosing from all but the last letter of the word.
BANANA Output (2, 1):
N   B   N   A   N   A   N   N   A   B   B   A
A   A   N   A   A   A   B   A   N   A   A   N
N   N   A   B   A   N   B   N   B   A   N   N
B   A   B   N   A   N   N   A   N   A   B   N
N   N   A   N   A   N   N   A   A   A   A   B
A   A   B   A   N   N   A   B   A   N   A   A
A   A   A   A   A   N   A   N   A   A   N   A
A   N   A   B   B   A   N   A   N   B   N   N
A   A   N   N   A   B   A   N   A   B   N   A
A   N   A   N   A   N   B   A   B   N   A   A
A   N   A   A   B   A   B   N   N   N   B   A
B   A   A   A   N   N   N   A   B   N   A   A

ELEMENT Output (6, 5):
E   E   L   M   M   M   L   E   E   N   M   M   E   E
E   E   M   E   L   E   E   M   E   E   E   E   E   L
E   N   E   E   E   E   E   L   E   N   E   E   E   E
L   E   M   M   M   E   E   L   E   L   N   L   M   E
E   L   L   L   E   E   M   L   E   M   M   E   E   E
L   E   M   L   N   N   L   M   E   E   L   E   M   N
L   L   N   E   M   M   M   E   E   N   E   E   E   L
E   E   N   E   N   L   E   N   M   L   N   N   N   M
M   E   E   M   M   N   E   E   M   E   E   E   E   L
N   E   M   M   M   E   E   L   N   L   N   E   L   E
L   M   E   L   M   M   N   N   L   E   E   T   E   M
E   E   E   N   L   M   E   E   M   E   E   E   E   E
M   E   E   E   E   L   N   M   L   E   E   E   E   E
N   L   L   M   E   M   E   L   E   M   E   M   N   E

ABRACADABRA Output (2, 3):
R   B   A   R   A   R   D   R   D   A   A   R   R   D   R   A   A   C   A   R   B   A
C   B   B   R   R   A   A   A   R   A   B   A   C   R   A   A   A   D   D   A   C   A
B   A   B   R   A   C   A   D   A   B   R   A   R   A   A   R   D   B   B   B   C   R
C   R   C   A   A   R   B   D   R   A   A   A   R   A   R   D   D   B   R   B   D   A
C   A   D   A   C   A   A   D   B   A   R   D   A   A   D   D   B   D   R   A   R   B
A   A   R   R   R   B   R   B   R   B   A   A   R   C   R   B   C   A   A   A   A   A
A   R   A   B   R   A   R   A   C   D   R   A   A   R   C   A   D   C   B   C   C   D
D   R   A   A   A   D   B   C   C   R   A   A   R   B   B   A   B   A   R   B   C   R
A   R   B   R   R   C   D   R   R   B   D   A   B   A   C   C   B   A   A   A   R   R
A   A   D   A   A   A   B   D   R   A   B   A   R   A   D   B   A   A   B   B   D   R
C   A   A   B   R   R   B   A   B   B   R   A   A   C   A   D   A   R   A   A   A   A
A   R   R   C   R   R   A   R   C   A   B   A   A   A   R   A   A   R   A   R   C   R
D   B   C   A   B   A   A   A   A   B   C   A   B   B   D   A   R   R   B   B   R   A
B   A   C   B   B   D   C   B   D   B   A   A   A   A   D   A   R   R   C   C   A   R
A   A   R   R   R   R   D   A   R   C   A   A   B   A   B   C   C   A   A   R   A   R
C   A   B   A   B   R   B   C   B   B   C   B   D   A   A   R   A   R   A   B   D   D
R   A   A   A   C   B   R   D   R   B   B   R   A   R   C   D   A   A   C   A   D   A
A   D   B   A   C   R   A   C   B   A   R   A   A   A   A   C   A   R   D   A   D   B
A   R   B   B   A   A   R   A   B   A   R   A   A   R   A   R   B   R   D   B   D   A
R   B   D   B   B   A   B   R   C   D   A   C   A   A   R   C   B   A   B   B   D   R
B   C   B   A   B   A   B   D   D   B   B   R   B   B   B   A   A   R   R   A   A   C
R   D   A   C   A   A   A   R   C   R   R   A   C   R   C   A   B   R   B   A   R   A

I just realised that if the last letter of the word is repeated elsewhere in the word, the word can still be accidentally generated. Will have to re-think this.

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


text:
Fastest gun of the west, king of the hill challenge
This is a King of the Hill challenge in a round robin. It's a battle to find the best gunman of the west!
To be able to compete in this contest you need to make two functions. The first one sets the attributes of your gunman and the second is the main logic function for the gunman.
Attribute Function
function () {

    var bot = {
        name: "testBot",
        numbOfBullets: 7,
        reloadSpeed: 1,
        shotsPerTurn: 1,
        moveSpeed: 2
    }
    return bot
}

The attribute function includes 5 variables that you will need to set according to some rules (with the exception of name that can be any string). You must spend a total of exactly 15 points on your gunman -- gunmen that do not spend all 15 points are not eligible. Here is how the attributes work:

numbOfBullets - defines how many bullets your gun holds.
The initial and minimum value of numbOfBullets is 1. Each additional bullet costs 1 point with the maximum being 16 bullets with 15 points spent.
reloadSpeed - defines how many turns your gunman needs to reload his gun after he ran out of bullets.
The base and maximum value is 4 with the minimum being 1. Decreasing this attribute by 1 costs 2 points.
shotsPerTurn - defines how many times your gunman can shoot in one turn.
The base and minimum value is 1. Each increase by 1 costs 3 points so you can have a maximum of 6 shots per round with 15 points spent. Raising this attribute above numbOfBullets is counter productive since you can't shoot more bullets then your gun can hold.
moveSpeed - defines how many spaces your gunman can run in one turn.
The base and minimum value is 1. Each increase by 1 costs 3 points with a maximum of 6 speed with 15 points spent. The gunman can run either left or right every turn up to a maximum of his move speed. He can also stand still which gives him a bonus (more on this later).

The example function above has 6 points spend on bullets, 6 points spend on reload speed and 3 points spend on movement.
Main function
function main(bulletsLeft, yourShots, enemyShots, yourMovement, enemyMovement) {

    var shots = [];
    shots.push(Math.floor((Math.random() * 24) + 1));
    var move = yourMovement[yourMovement.length - 1] + 2
    var play = [];
    play.shots = shots;
    play.move = move;
    play.reload = false;
    return play;
}

Parameters:

bulletsLeft, number of bullets left in your gun
yourShots, this is a array of arrays of all the past positions your gunman has fired at.
Example for a gunman who can shoot 1 bullet per round:
[[12],[4],[22],...]

Example for a gunman who can shoot 3 bullets per round:
[[12,13,14],[11,15,16],[9,14],...]

enemyShots - same as above but for your enemy
yourMovement - an array of all your past movement positions
enemyMovement, same as above but for your enemy

What you need to return:
You are required to return a variable which has 3 attributes:

shots - an array of numbers which determine at which space/s your gunman will shoot
move - a single number that determines to what space your gunman will try to move to
reload - a true/false value with which you can make your gunman reload

The Duel
The contest follows a round robin 1 versus 1 system. Each gunman has 50 rounds against every other gunman. A round lasts until someone is hit by a bullet or until 66 turns have passed (a turn is when both players have shot).
The gunman can earn 2 points by killing their opponent, 1 point if they both die in the same turn or 0 points if they reach the 66 turns limit.
The shooting field is 24 spaces width (1-24 inclusive). To hit a player and win a round you need to shoot at the same space as he is currently standing on.
Here is a step by step guide on how a duel works. This also covers all invalid commands and special rules:

At the start of each duel both players are put on space 12 and their revolvers are fully loaded
The main function is called and the gunman make their first move command and choose where they want to shoot
First the gunmen move to their new location. If any invalid input is made at the move command (positions lower then 1 or higher then 24 or they moved more spaces then they are allowed too) they stay at the same position.
Next reloading is checked, if you ran out of bullets the previous turn or you called reloading yourself your gunman goes into the reload cycle. He is reloading for as many turns as you set your reloadSpeed value. If you decided to stand still (returning the same space integer as you where standing on before or just returning a invalid value) you reload counter goes down for 2 turns instead of one.
Now comes checking your shooting values, every turn you can enter as many shooting location as you like they will always be cut off to the actual valid amount which is determined by: The number of shots per turn and the number of bullets in your revolver (whichever is lower). Your shotsPerTurn value is increased by 1 if you decide to stand still this turn, so you can make a extra shot if you decide to stand still. If you are in the reload cycle you have 0 shots.
Now comes the actual shooting, there are 2 ways this can go down. If both gunman have the same movespeed stat then they both shoot at the same time and can both kill each other at the same time. In the case that they have different movespeed stats the bot with the higher movespeed stat starts shooting first and if he kills his opponent he wins this round. If the gunman can shoot one or more bullets in one round then it follows the same rules as above except in more cycles as a example: Lets say that bot1 has 3 bullets and is faster and bot 2 has 2 bullets then it would go like this:
Bot1 shoots, Bot2 shoots cycle 1
Bot1 shoots, Bot2 shoots cycle 2
Bot1 shoots              cycle 3

This would look the same if they had the same movespeed only that if now Bot1 hit Bot2 in the same cycle Bot2 could also hit Bot1 and it would be a tie.
RULES
First I am copying some rules from Calvin's Hobbies' entry that also apply here.
When declaring a new JavaScript variable, you must use the var keyword.
This is because a variable declared without var becomes global rather than local, so it would be easy to accidentally (or intentionally) mess with the controller or communicate freely with other players. It has to be clear that you aren't trying to cheat.
When declaring functions it is best to use the var keyword as well, i.e. use var f = function(...) {...} instead of function f(...) {...}. I'm not entirely sure why, but sometimes it appears to make a difference.
In your code you may not...

attempt to access or modify the controller or other player's code.
attempt to modify anything built into JavaScript.
make web queries.
do otherwise malicious things.

My additional rules:

The users can create as many gunman as they want and change their functions for any period of time
I will remove any entry from the game that either takes a excessive amount of time or tries to cheat in any way that I see fit
The names of the attributes that your function need to return has to be the same as in the examples with the same structure!

Your answer should be in this format, the first function being the attribute function and the second being the logic function. Notice that I used an exclamation mark because if you just make new lines between code blocks the parser wont see two different code blocks so you have to use any symbol(just use a exclamation mark) to seperate them:
var bot = {
    name: "testBot",
    numbOfBullets: 7,
    reloadSpeed: 1,
    shotsPerTurn: 1,
    moveSpeed: 2
}
return bot

var shots = []
var testBot_moveUp = true
if(Math.random() * 2 > 1)
    testBot_moveUp = false
shots.push(Math.floor((Math.random() * 24) + 1))
var move = 0
if (testBot_moveUp)
    move = yourMovement[yourMovement.length - 1] + 2
else
    move = yourMovement[yourMovement.length - 1] - 2
move = 12
var play = []
play.shots = shots
play.move = move
play.reload = false
return play

And here is the controller: GAME CONTROLLER. Just open the link and wait for the bots to load, then select which one you want in the fight (probably all) and press the start button.
I also put in a testbot as my answer which will compete, it also serves as a example on how the structure of the answer should look like. As a note, if you make a small mistake and edit your answer stackexchanges algorithm might not pick it up right away and the site that the controller uses which is generated by stackexchange isnt updated(but will later or if you make bigger changes which i suggest doing, just add some text at the end). Here is the site: codelink

I don't seem to be able to get the two bots fighting each other at the moment- if I have them both selected, pressing start doesn't seem to do anything and I'm not sure whether that's my bot being wrong or the controller taking a long time

Yea as i explained at the end of my question when you edited your answer it didnt edit it yet in the stackexchange code generator because it didnt notice that there was a change, if you add some text at the end of your answer it should work

Oh nevermind you still have the error "eemyMovement" in your code, you also have some different errors in your code like "play.reaload"

I think (fingers crossed) I've corrected those errors- it's just hard to find the errors if the controller doesn't tell me that I didn't provide the correct output and just silently does nothing

"Math.randome", just open the debug console m8 :)

You can use <!----> to separate codeblocks "invisibly" (without the !).

When i run the controller i get "Uncaught TypeError: Cannot read property 'log' of undefined(anonymous function) @ VM205:95`

yes that is because of @TheE submission, he added console.log and it broke it should be fine once it updates

"25 spaces width (1-24 inclusive)" - 1-24 is only 24 fields, though... Did you mean 0-24? If 0 isn't a field, then the playing field is asymmetrical and there is more space on the right side.

Oh i meant 24 spaces yes the 25 is a typo. Does it matter that its asymmetrical?

Something with the controller seems off when using more than two players. If I do 1:1 I get different results/winners than when I mark 3 or 4 players at once.

The more players you use the more points the each bot can gain, EDIT ah i see what you mean, will look into it

Found the error. Change "play1 = maskedEval(players[a].code, params)" to "play1 = maskedEval(playingPlayers[a].code, params)" - same for play2

nice catch thanks, that fixed it yea.

What are "setMsg" and "getMsg"?

Let us continue this discussion in chat.

Regarding var f = function(...) {...} vs function f(...) {...}, you might be interested in this answer on SO.

Awwwh... "Can't access any of your opponent's code"... And here I was ready to write an extremely cheat-y reflection answer. Then again... Someone else would've also done that and we would've had two reflceto-bot gunners, getting nowhere because they have to wait for each other to know what they're doing to do anything lol.

Pandarus
var bot = {
    name:"Pandarus",
    numbOfBullets: 2,
    reloadSpeed: 3,
    shotsPerTurn: 1,
    moveSpeed: 5
}
return bot

var myPos;
if(yourMovement.length > 0)
{
    myPos = yourMovement[yourMovement.length - 1];
}
else
{
    myPos = 12;

}
var EnemyPos;
if(enemyMovement.length>0) {
    EnemyPos = enemyMovement[enemyMovement.length - 1];
}
else
{
    EnemyPos = 12;
}

var play = {
    shots: [
    ],
    reload: true,
    move: 12
};
if (bulletsLeft < 1)
{
    //Reload
    play.reload = true;
    play.shots = [
    ];
}
else
{
    //FIRE!!!
    play.reload = false;
    var enemyMoveSum = 0;
    for (var i = 0; i < enemyMovement.length; i++)
    {
        var MoveSinceLast;
        if (i == 0)
        {
            MoveSinceLast = enemyMovement[i] - 12;
        }
        else
        {
            MoveSinceLast =enemyMovement[i] - enemyMovement[i-1];
        }

        enemyMoveSum += Math.abs(MoveSinceLast);
    }

    var enemyAvgMove;
    if (enemyMovement.length > 0)
    {
        enemyAvgMove = Math.round(enemyMoveSum / enemyMovement.length);
    }
    else
    {
        enemyAvgMove = 0;
    }

    var LeftShot = EnemyPos - enemyAvgMove;
    var RightShot = EnemyPos + enemyAvgMove;

    if (RightShot > 24 ||( (LeftShot>0) && (Math.random()*2 < 1)))
    {
        play.shots.push(
            LeftShot
        );
    }
    else
    {
        play.shots.push(
            RightShot
        );
    }
}

var MyMove = myPos;
do
{
    var move = Math.floor(Math.random() * 10) - 5;
    if(move == 0)
    {
        move = 5;
    }
    MyMove = myPos + move;
}
while (MyMove<1 || MyMove > 23)

play.move = MyMove;

return play;

Pandarus relies on his speed to get out the way of the bullets, and uses the enemies previous movements to guess where they are going to go.

Have to apoligize, there was a bug in the scoring now everything works correctly. It was very weird to me that my bot was winning lol

Oh and your submission had another weird thing, the numbers for your move command where decimals so i added rounding into the controller

I really don't know why it was outputting decimals :-) I'll try and improve it tomorrow

i removed the console.log since it was breaking the controller

Yeah sorry, anyway I've (finally) got it working (and beating your test bot) now :)

A Simple Man
Not perfect at anything, but quite good at everything through the power of less is more.
return {
    name: "A Simple Man",
    numbOfBullets: 7,   /* 9 points */
    shotsPerTurn: 2,    /* 3 points */
    reloadSpeed: 4,     /* 0 points */
    moveSpeed: 3        /* 3 points */
}

var lastPos = yourMovement[ yourMovement.length - 1 ],
    lastEnemyPos = enemyMovement[ enemyMovement.length - 1 ],
    lastEnemyMove = enemyMovement.length > 1 ?
        ( function () {
            var i = 0,
                currentMove,
                minMove = Infinity;
            while ( i < enemyMovement.length ) {
                currentMove = Math.abs( enemyMovement[ enemyMovement.length - 1 ] - enemyMovement[ enemyMovement.length - 2 ] );
                if ( currentMove < minMove ) { minMove = currentMove; }
                return minMove;
            }
        } )()
        : 1,
    needsToReload = bulletsLeft === 0;

return {
    shots: [ yourMovement.length === 1 ? 12 : lastEnemyPos + lastEnemyMove, lastEnemyPos - lastEnemyMove ],
    move: needsToReload ? lastPos : lastPos + Math.floor( Math.random() * 3 + 1 ) * ( ( Math.random() > 0.5 ) ? -1 : 1 ),
    reload: needsToReload
};

Thank @ProgramFOX for adding the syntax highlighting, but this broke the programm.

That's weird. Adding syntax highlighting is only a HTML comment and shouldn't break the program.

Don’t know, but the programm didn’t load my code anymore, now its fine again.

Ahh, I see, probably the parser didn't understand the format with the HTML comment, so it did break the program indeed. My bad!

var bot = {
    name: "Sniper",
    numbOfBullets: 4,   /* 3 points */
    reloadSpeed: 4,     /* 0 points */
    shotsPerTurn: 1,    /* 0 points */
    moveSpeed: 5        /* 12 points */
};
return bot;

var play = {};
var my_speed = 5;

var gatherStatistics = function(moves) {
    var enemyMoves = [];

    for (var m = 1; m < moves.length; ++m) {
        var diff = moves[m]-moves[m-1];

        var found = false;
        for (var i = 0; i < enemyMoves.length; ++i) {
            if (enemyMoves[i][0] === diff) {
                ++enemyMoves[i][1];
                found = true;
                break;
            }
        }
        if (!found) enemyMoves.push([diff,1]);
    }

    return enemyMoves;
};
var calcOptimalTarget = function(moves, histogram) {
    var enemy_pos = moves[moves.length-1];
    var optimalDiffs = [];
    var optimalScore = 0;

    for (var i = 0; i < histogram.length; ++i) {
        var diff = histogram[i][0];
        var score = histogram[i][1];

        if (score > optimalScore) {
            optimalScore = score;
            optimalDiffs = [diff];
        } else if (score === optimalScore) {
            optimalDiffs.push(diff);
        }
    }

    var chosenDiff = optimalDiffs[Math.floor(Math.random() * optimalDiffs.length)];
    return enemy_pos + chosenDiff;
};

/* Never reload */
play.reloading = false;

/* Run around like a mad man */
var my_pos = yourMovement[yourMovement.length-1];
var rand_sign = 2*Math.floor(2*Math.random())-1;

/* Never run into walls */
if (my_pos <= my_speed+1) {
    rand_sign = 1;
} else if (my_pos >= 24 - my_speed - 1) {
    rand_sign = -1;
}

if (yourMovement.length === 1) { /* Leap out of the way on first move */
    play.move = yourMovement[yourMovement.length-1] + rand_sign*my_speed;
} else {
    play.move = yourMovement[yourMovement.length-1] + rand_sign*((my_speed-1)*Math.floor(2*Math.random()) + 1);
}

/* Shoot all bullets by the end of the game */
var random_shot = (Math.random() > 0.15) ? true : false;

if (enemyMovement[enemyMovement.length-1] === enemyMovement[enemyMovement.length-2]) {
    /* Enemy is standing still; now is our time to STRIKE! */
    play.shots = [ enemyMovement[enemyMovement.length-1] ];
} else if (enemyMovement.length >= 2 && random_shot) {
    /* We take a random shot; best guess by enemies movement */
    var histogram = gatherStatistics(enemyMovement);
    play.shots = [ calcOptimalTarget(enemyMovement, histogram) ];
} else {
    /* No default shooting */
    play.shots = [];
}

return play;

so if the enemy never stands still the sniper never shoots? :D

var bot = {
    name: "testBot",
    numbOfBullets: 7,
    reloadSpeed: 1,
    shotsPerTurn: 1,
    moveSpeed: 2
}
return bot

var shots = []
var testBot_moveUp = true
if(Math.random() * 3 > 1)
    testBot_moveUp = false
shots.push(Math.floor((Math.random() * 24) + 1))
var move = 0
if (testBot_moveUp)
    move = yourMovement[yourMovement.length - 1] + 2
else
    move = yourMovement[yourMovement.length - 1] - 2
var play = []
play.shots = shots
play.move = move
play.reload = false
return play

Test bot, this added as a control test. If anybody loses to this you should be ashamed :). Fixed bot behaviour, copy pasted the wrong test bot(it always stayed on field 12)

var bot = {
    name: "Winger",
    numbOfBullets: 7, // 6 points
    reloadSpeed: 4, // 0 points
    shotsPerTurn: 3, // 6 points
    moveSpeed: 2 // 3 points
}
return bot;

var play = {};
var moveSpeed = 2;

//Guess the enemies speed
var enSpeed = 5; // Assume they are fast on the first turn
var prev = 12;
for(var move in enemyMovement){
    if(Math.abs(move - prev) > enSpeed){
        enSpeed = Math.abs(move - prev);
    }
    prev = move;
}

var move = 12;
if(Math.random() < 0.5){ moveSpeed = 1; }
//Move against the enemies shots
if(yourMovement.length == 0 || enemyShots.length == 0){
    move = 12 + moveSpeed;
}
else if(enemyShots.length == 1){
    if(enemyShots[0] <= 12){
        move = yourMovement[yourMovement.length - 1] - moveSpeed;
    }
    else{
        move = yourMovement[yourMovement.length - 1] + moveSpeed;
    }
}
else{
    var dir = enemyShots[enemyShots.length - 1][0] - yourMovement[yourMovement.length - 1];
    if(dir > 0){
        move = yourMovement[yourMovement.length - 1] + moveSpeed;
    }
    else{
        move = yourMovement[yourMovement.length - 1] - moveSpeed;
    }
}

//reload?
var reload = false;
if(bulletsLeft < 3){
    reload=true;
}

var enemyPos = 12;
if(enemyMovement.length > 0){
    enemyPos = enemyMovement[enemyMovement.length - 1];
}
var shots = [];
if(reload == false){
    //Shoot a spread around the opponent
    shots.push(enemyPos);
    if(enemyPos + enSpeed <= 24){ shots.push(enemyPos + enSpeed);}
    if(enemyPos - enSpeed > 0){ shots.push(enemyPos - enSpeed);}

}

//Correct move
if(move > 24){
    move = 24;
}
if(move < 1){
    move = 1;
}
if(reload && (yourMovement[yourMovement.length - 1] - yourMovement[yourMovement.length - 2]) != 0){
    move = yourMovement[yourMovement.length - 1];
}

play.move = move;
play.reload = reload;
play.shots = shots;

return play;

Winger fires a spread that bounds the enemies range. He also kind of runs towards the enemies shots.
Just gonna leave this here to push the reset.

The Weaver
More concerned with staying alive than killing, he weaves back and forth, increasing his distance every time. Picks a random spot within the enemies proven range to shoot at.
var bot = {
    name: "TheWeaver",
    numbOfBullets: 4, // 3 points
    reloadSpeed: 4, // 0 points
    shotsPerTurn: 1, // 0 points
    moveSpeed: 5 // 12 points
}
return bot;

var play = {};
var moveSpeed = 2;

//Guess the enemies speed
var enSpeed = 1;
var prev = 12;
for(var move in enemyMovement){
    if(Math.abs(move - prev) > enSpeed){
        enSpeed = Math.abs(move - prev);
    }
    prev = move;
}

//Randomly shoot in his range
var enemyPos = 12;
if(enemyMovement.length > 0){
    enemyPos = enemyMovement[enemyMovement.length - 1];
}
var shots = [];

//Shoot somewhere in his range
var distance = Math.random()*enSpeed;
var direction = 1;
if(Math.random() < 0.5){ direction = -1;}
if(enemyPos + enSpeed > 24){ direction = -1;}
if(enemyPos - enSpeed <= 0){ direction = 1;}
shots.push(enemyPos + distance*direction);

var move = 12;

//Start with a dash
if(yourMovement.length == 0){
    move = 12 + moveSpeed - 1;
}
//Quick switch
else if(yourMovement.length == 1){
    move = 11
}
//Wave baby, weave
else{
    var lastPos = yourMovement[yourMovement.length - 1];
    var lastMove = yourMovement[yourMovement.length - 1] - yourMovement[yourMovement.length - 2];
    var distance = Math.abs(lastMove + 1);
    if(distance > moveSpeed) { distance = 0;}
    var direction = lastMove/Math.abs(lastMove)*(-1);
    move = lastPos + distance*direction;
}

//Correct move
if(move > 24){
    move = 24;
}
if(move < 1){
    move = 1;
}

play.move = move;
play.reload = false;
play.shots = shots;

return play;

move = 12 + moveSpeed - 1; is equivalent to move = 11 + moveSpeed;, no? Otherwise this looks like a good bot ;)

@ConfusedMr_C Haha yes, its the same, I guess I just chose the first one for readability, makes it more clear that it moves one less than the maximum moveSpeed from the start point. Also makes it easier to replace all 12 with 15 if the size of the map changes or anything

Oh, okay. We're all programmers here so I was surprised that nobody else had mentioned it :P

Alexander Hamilton
If he doesn't win in the first round, will probably die
var bot = {
    name: "Hamilton",
    numbOfBullets: 7, // 6 pts
    reloadSpeed: 4, // 0 pts
    shotsPerTurn: 4, // 9 pts
    moveSpeed: 1 // 0pts
}
return bot

!
var shots = []
var move = yourMovement[yourMovement.length - 1] + 1
var play = []
play.shots = [12,11,10,13,14,9,15,8,16,7,17,6,18]
play.move = move
play.reload = false
return play

Aaron Burr
var bot = {
    name: "Burr",
    numbOfBullets: 7, // 6 pts
    reloadSpeed: 4, // 0 pts
    shotsPerTurn: 3, // 6 pts
    moveSpeed: 2 // 3pts
}
return bot

!
var shots = []
var move = yourMovement[yourMovement.length - 1]
// Dodging dance
switch (yourMovement.length % 4) {
  case 1:
    move += 2
    break;
  case 2:
    move -= 1
    break;
  case 3:
    move -= 2
    break;
  case 0:
    move += 1
    break;
}
var play = []
var elast = enemyMovement[enemyMovement.length - 1]
play.shots = [elast + 1, elast -1, elast]
play.move = move
play.reload = false
return play

var bot = {
    name: "Random Evader",
    numbOfBullets: 7,
    reloadSpeed: 4,
    shotsPerTurn: 1,
    moveSpeed: 4
}
return bot

var getSpeed=function(Moves){
    var m = 0;
    for(var i=1;i<Moves.length;i++){
        var d = Math.abs(Moves[i]-Moves[i-1]);
        m = m>d?m:d;
    }
    return m;
}
var validMove=function(moves,speed){
    speed = speed||getSpeed(moves);
    var m;
    do{
        m=moves[moves.length-1]+Math.floor(Math.random()*(speed*2+1)-speed);
    }while(m>25 && m<0);
    return m;
}
var shots = [];
shots.push(validMove(enemyMovement));
var move = validMove(yourMovement,4);
return {
    shots:shots,
    move:move,
    reload:false
};

Since this is never reloading, it would be better if you didn't waste any points on reload speed and instead buy more bullets.

@QuadrExAtt: Reload is automatic when you run out of shots.

var bot = {
    name: "Gun and run",
    numbOfBullets: 4,   /* 3 points */
    reloadSpeed: 4,     /* 0 points */
    shotsPerTurn: 3,    /* 6 points */
    moveSpeed: 3        /* 6 points */
};
return bot;

var play = {};
play.reload = false;
if (yourShots.length === 1) { /* Opening move */
    if (Math.random() < 0.5) {
        play.shots = [13,14,15,16];
    } else {
        play.shots = [8,9,10,11];
    }
    play.move = 12;
} else { /* YOLO */
    play.shots = [];
    switch (yourMovement[yourMovement.length - 1]) {
        case 12:
            play.move = 15;
            break;
        case 15:
            play.move = 18;
            break;
        case 18:
            play.move = 15;
            break;
    }
}
return play;

Hey its "yourShots" not my myShots, now that i think about it "myShots" would have been better lol, oh and move isnt a array its just a single number

SMG
His gun is his cover. Unfortunately, it seems to block his view. He is also good at taking advantage of standing still to reload faster and get extra shots.
var bot = {
    name: "SMG",
    numbOfBullets: 12, //11pt
    reloadSpeed: 2,    //4pt
    shotsPerTurn: 1,   //0pt
    moveSpeed: 1       //0pt
}
return bot

var shots = [];
shots.push(Math.floor((Math.random() * 24) + 1));
shots.push(Math.floor((Math.random() * 24) + 1));
var play = [];
if (bulletsLeft < 1) {
play.reload = true;
play.shots = [];
}
play.shots = shots;
play.move = Math.floor((Math.random() * 24) + 1);
play.reload = false;
return play;

Diephobus
var bot = {
    name: 'Deiphobus',
    numbOfBullets: 5,
    reloadSpeed: 3,
    shotsPerTurn: 4,
    moveSpeed: 1
};
return bot

var getSorted = function(list)
{
    var modifiedList = [0,0,0,0,0,0,0,0,0,0,0,0,0];
    modifiedList[0] = list[6];
    modifiedList[1] = list[7];
    modifiedList[2] = list[5];
    modifiedList[3] = list[8];
    modifiedList[4] = list[4];
    modifiedList[5] = list[9];
    modifiedList[6] = list[3];
    modifiedList[7] = list[10];
    modifiedList[8] = list[2];
    modifiedList[9] = list[11];
    modifiedList[10] = list[1];
    modifiedList[11] = list[12];
    modifiedList[12] = list[0];

    var messedUpOrder = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];
    for(var order = 0; order < 13; order++) {
        var currBest = -2;

        for (var i = 0; i < 13; i++) {
            if ((messedUpOrder.indexOf(i) < 0) && (modifiedList[i] > modifiedList[currBest] || currBest<0)) {

                currBest = i;
            }
        }

        messedUpOrder[order] = currBest;
    }

    var toRet = [0,0,0,0,0,0,0,0,0,0,0,0,0];
    toRet[6] = messedUpOrder[0];
    toRet[7] = messedUpOrder[1];
    toRet[5] = messedUpOrder[2];
    toRet[8] = messedUpOrder[3];
    toRet[4] = messedUpOrder[4];
    toRet[9] = messedUpOrder[5];
    toRet[3] = messedUpOrder[6];
    toRet[10] = messedUpOrder[7];
    toRet[2] = messedUpOrder[8];
    toRet[11] = messedUpOrder[9];
    toRet[1] = messedUpOrder[10];
    toRet[12] = messedUpOrder[11];
    toRet[0] = messedUpOrder[12];

    return toRet;
};
var myPos;
if(yourMovement.length>0) {
   myPos  = yourMovement[yourMovement.length - 1];
}
else{
    myPos = 12;
}
var EnemyPos;
var play = {
    shots: [
    ],
    reload: true,
    move: 12
};
if(enemyMovement.length>0) {
    EnemyPos = enemyMovement[enemyMovement.length - 1];
}
else
{
    EnemyPos = 12;
}
if(bulletsLeft<4)
{
    play.reload = true;
}
else
{
    play.reload = false;
    var enemyChanges = [0,0,0,0,0,0,0,0,0,0,0,0,0];
    for(var i = 0; i<enemyMovement.length; i++)
    {
        var enemyChange;
        if(i == 0)
        {
            enemyChange = enemyMovement[i] - 12;
        }
        else
        {
            enemyChange = enemyMovement[i] - enemyMovement[i-1];
        }

        enemyChanges[enemyChange+6] = enemyChanges[enemyChange+6]+1;
    }

    var orderedEnemyChanges = getSorted(enemyChanges);
    var CurrentShot = 0;
    play.shots = [12,12,12,12];
    for(var i = 0; i<orderedEnemyChanges.length && CurrentShot<4; i++)
    {
        var pos = orderedEnemyChanges[i] + EnemyPos - 6;
        if(pos<24 && pos>0)
        {
            play.shots[CurrentShot] = pos;
            CurrentShot ++;
        }
    }
}
if(myPos == 1)
{
    play.move = 2;
}
else if (myPos == 23)
{
    play.move = 22;
}
else
{
    play.move = myPos + (Math.floor((Math.random() * 3)) %3) - 1;
}
return play;

Diephobus beleives in mercilessly firing bullets everywhere he thinks his enemy might be, but he's a bit slow.

ASCIIGunInTheWest
Fires 2 shots a turn, and guesses where the enemy can go based on how fast he moves.
Forgive me if there's any errors, I haven't coded much in JavaScript.
var bot = {
    name: "ASCIIGunInTheWest",
    numbOfBullets: 4,
    reloadSpeed: 1,
    shotsPerTurn: 2,
    moveSpeed: 2
}
return bot

!
function main(bulletsLeft, yourShots, enemyShots, yourMovement, enemyMovement) {
    var randnum = function (min, max) { return Math.floor( Math.random() * (max - min + 1) ) + min }
    var getDiff = function (num1, num2) { return Math.abs( (num1 > num2) ? num1-num2 : num2-num1 ) }
    var shots = []
    var enemyMaxMovement = 0
    for (index = 0 index < enemyMovement.length ++index) {
    var moveDiff = getDiff(enemyMovement[index], enemyMovement[index - 1])
        if (index != 0 && moveDiff > enemyMaxMovement) {
           enemyMaxMovement = moveDiff
        }
    }
    var enemyCurrentPosition = enemyMovement[enemyMovement.length - 1]
    var enemyMinMoveRange = enemyCurrentPosition - enemyMaxMovement
    var enemyMaxMoveRange = enemyCurrentPosition + enemyMaxMovement
    shots.push( randnum(enemyMinMoveRange, enemyMaxMoveRange) )
    shots.push( randnum(enemyMinMoveRange, enemyMaxMoveRange) )
    var move = yourMovement[yourMovement.length - 1] + randnum(-2, 2)
    var play = []
    play.shots = shots
    play.move = move
    play.reload = false
    return play
}

EDIT: Apparently my bot (just mine) can't be used in the JSFiddle. Does anyone know why this is? I'm using all my points for my gunman, so I don't think I've been disqualified.

This probably would've been a lot more useful 3 years ago, but in refactoring a KotH tournament runner, I think know why: You declared a main() function, in a scope where a main function was already created by the tournament runner (yeah, implementation details).

Also, your for loop is weirdly shaped. The sixth line should have  semicolons in it.