text:
Print the sizes of intervals inside of a piece of music
Background
In Western music, every single music note has an assigned name. Within each octave, there are twelve unique notes in the following order: "C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C", where the final C is one octave above the first.
To tell the difference between notes of different octaves, a number (for this challenge restricted to a single digit) is appended to the end of the note name. Thus, C5 is the note that is one octave above C4. Bb6 is above B5.
An important fact is that B5 and C6 are notes that are right next to each other, and that C0 and B9 are the lowest and highest notes.
Between any two notes, there is a distance which is the number of semitones between them. Bb4 is one semitone below B4, which is itself one semitone below C5. There are twelve semitones in an octave, so Bb4 is a distance of 12 from A#3 since it is an octave above it (notice how a single note can have up to two names).
The Challenge
Your challenge is to write the shortest possible program that can take a list of music notes from STDIN and print the list of interval changes to STDOUT.
Input will be a space-separated list of music notes. Each note will consist of an uppercase letter A-G, an optional b or # sign, and a single digit number. You will not have to deal with E#/Fb or B#/Cb. Example input:
C4 D4 E4 F4 G4 A4 B4 C5 C4

Output will be a space-separated list of integers which represent the distance between each successive note, always prefixed with an + or - to show whether the note was ascending or descending relative to the one before it. There will always be one less number outputted than notes inputted. Example output for the above input:
+2 +2 +1 +2 +2 +2 +1 -12

Some more example inputs:
E5 D#5 E5 B4 E5 F#5 E5 B4
C0 B0 Bb1 A2 G#3 G4 F#5 F6
G4 Ab4 Gb4 A4 F4 A#4

And their corresponding outputs:
-1 +1 -5 +5 +2 -2 -5
+11 +11 +11 +11 +11 +11 +11
+1 -2 +3 -4 +5

Rules and Restrictions

The winner is determined by the number of characters in the source code
Your program should consist of only printable ASCII characters
You are not allowed to use any sort of built-in function that is related to music or sound
Other than that, standard code golf rules apply

Should it print +0 or -0 or 0 for two identical notes?

@Howard Since I didn't specify, either one is acceptable.

"Bb4 is one semitone below B4, which is itself one semitone below C4".  You mean C5 at the end of that, right?

Wow, never noticed that. Thanks for spotting the error. It's fixed now.

GolfScript, 61
" "/{)12*\{"bC#D EF G A B"?(+}/}%(\{.@-.`\0>{"+"\+}*\}/;]" "*

Haskell, 161 characters
f(c:r)=maybe(12*read[c])(+f r).lookup c$zip"bC#D.EF.G.A.B"[-1..]
g n|n<0=show n|1<3='+':show n
h x=zipWith(-)(tail x)x
main=interact$unwords.map g.h.map f.words

Perl, 103
#!/usr/bin/perl -an
/.((b)|(\D))?/,(($~,$,)=($,,12*$'+ord()%20%7*2+(ord()%7>3)-$-[2]+$-[3]))[0]&&printf'%+d ',$,-$~for@F

C, 123 characters
Based on leftaroundabout's solution, with some improvements.
main(c,b,d)
    char*b;
{
    while(d=c,~scanf("%s",b)?c=-~*b*1.6,c%=12,c+=b[~b[1]&16?c+=1-b[1]/40,2:1]*12:0)
        d>1&&printf("%+d ",c-d);
}

Some tricks that I think are worth mention:
1. argv[0] (here called b) is a pointer to the program name, but used here as a scratch buffer. We only need 4 bytes (e.g. C#2\0), so we have enough.
2. c is the number of arguments, so it starts as 1 (when run without arguments). We use it to prevent printing on the first round.
Possible problem - c+=b[..c+=..] is kind-of strange. I don't think it's undefined behavior, because ?: is a sequence point, but maybe I'm wrong.

If you think of it as c = c + b[..c+=..], then it's pretty clearly undefined behavior.  Regardless of the sequencing within [..], you don't know if the outer c is fetched before, during, or after b[..].

@ephemient, I guess in theory a compiler could do REG=c;REG+=b[..c+=..];c=REG. However, I'll be surprised to see something like this in practice. But it's still UB.

It's Code Golf – we've already invoked UB by using scanf without a prototype, and that's okay.  It's just good to know what is and isn't legal in real life :)

C, 241 229 183
F(c){c-=65;return c*1.6+sin(c/5.+.3)+9;}
#define r if(scanf("%s",b)>0){c=F(*b)%12;c+=b[b[1]<36&&++c||b[1]>97&&c--?2:1]*12
main(e,c,d){char b[4];r;}s:d=c;r;printf("%+d ",c-d);goto s;}}

Instead of doing the plus sign yourself, you can just do printf("%+d ",c-d).

You can omit includes http://ideone.com/G00fS

Very nice. Some suggestions: F(*b-65) instead of c-=65;, b[1]<36&&++c||b[1]>97&&c--?2:1 -> b[1]&16?1:(c+=b[1]%2*2-1,2), abuse argv by: main(e,b,c,d)char*b{ (Use the first argument pointer as a work buffer).

Another one - I think c=F(*b)%12 can be replaced with c=-~*b*1.6;c%=12. Why? sin in the original F can be replaced with 9.6. c*1.6+9.6 is (c+6)*1.6, c-=65 and (c+6) become c-59, and then c+1 (60*96%12==0).

Thanks for all the suggestions! They work fine and make it shorter, but I think I'll leave it as it is now; it wouldn't really be my solution anymore without the sine.

Factor, 303 characters
USING: combinators formatting io kernel math regexp sequences ;
f contents R/ [#-b]+/ all-matching-slices
[ 0 swap [ {
{ [ dup 48 < ] [ drop 1 ] }
{ [ dup 65 < ] [ 48 - 12 * ] }
{ [ dup 98 < ] [ "C-D-EF-G-A-B" index ] }
[ drop -1 ]
} cond + ] each
swap [ over [ - "%+d " printf ] dip ] when* ] each drop

With comments,
! combinators => cond
! formatting => printf
! io => contents
! kernel => swap dup drop over dip when*
! math => < - * +
! regexp => R/ all-matching-slices
! sequences => each
USING: combinators formatting io kernel math regexp sequences ;

f       ! Push false, no previous note value.

! Find notes (as string slices) in standard input. The golfed regexp
! R/ [#-b]+/ matches all notes and no whitespace.
contents R/ [#-b]+/ all-matching-slices

! For each string slice:
[
    0       ! Push 0, initial note value.
    swap    ! Move note slice to top of stack, above note value.

    ! For each Unicode codepoint in note:
    [
        ! Convert the Unicode codepoint to its value in semitones.
        ! For golf, [ 48 ] is shorter than [ CHAR: A ].
        {
            ! Sharp # {35} has 1 semitone.
            { [ dup 48 < ] [ drop 1 ] }
            ! 0-9 {48-57} has 0 to 9 octaves (1 octave = 12 semitones).
            { [ dup 65 < ] [ 48 - 12 * ] }
            ! A-G {65-71} has 0 to 11 semitones.
            { [ dup 98 < ] [ "C-D-EF-G-A-B" index ] }
            ! Flat b {98} has -1 semitone.
            [ drop -1 ]
        } cond

        +       ! Add semitones to cumulative note value.
    ] each

    swap    ! Move previous note value to top of stack.
    ! When there is a previous note value:
    [
        ! Keep current note on stack.
        over [
            ! Compute and print interval.
            - "%+d " printf
        ] dip
    ] when*
    ! Current note replaces previous note at top of stack.
] each

drop    ! Drop previous note, so stack is empty.

For this script, a "space-separated list" can have 1 or more spaces between elements, and 0 or more spaces at the beginning or end. This script does print an extra space at end of output, but it also accepts an extra space (or newline) at end of input.
If I would adopt a stricter definition, where a "space-separated list" has exactly 1 space between elements, and 0 spaces at the beginning or end, then I can shorten contents R/ [#-b]+/ all-matching-slices to contents " " split (using splitting, not regexp). However, I would need to add more code to prevent the extra space at end of output.
If I use the deprecated word dupd, I can shorten over [ - "%+d " printf ] dip to dupd - "%+d " printf, saving 8 characters. I am not using deprecated words because they "are intended to be removed soon."


text:
Brainf*** Golfer
One of easiest code written by a programming language is a program printing sequence of characters (ex. "Hello, world!"). However, some esoteric programming languages like Brainfuck, even this simplest code is quite annoying to write.
Your task is to write a program (don't have to written in brainfuck), which prints a (minimum-length) Brainfuck program printing the given text.
Input
A sequence of characters (between 1 and 255) is given by any format (variable, argument, stdin, file, ...).
Output
Output is a valid (no non-matching [ and ]) brainfuck code (assume unsigned 8-bit wrapping cell and unlimited number of cells to left and right) printing exact string that was given as input.
For example, one possible output for input A is ++++++++[<++++++++>-]<+..
Your program shouldn't take long time (>2m) to run.
The BF program shouldn't take long time (>10s) to run.
Scoring
(Notice : current scoring method may change, since it is not easy to calculate...)
The length of program (generating BF code) itself doesn't matter. However, hard-coding BF codes in the program code is not OK. Only acceptable range (ex. a BF code printing a single character 0x01 : +.) of BF codes might be hard-coded.
The score is sum of length of BF codes printing these strings.

A string Hello, world! appended with a single 0x0A (\n) (i.e. the "Hello, world!" program)
Single character from 0x01 ~ 0xFF

Sum of length of these 255 BF codes are multiplied by 1/16, rounded, and added to the score.

List of first 16 strings, generated by splitting a random sequence of bytes generated on 11-11-11 by 0x00, removing all zero-length strings.
Lenna.png, removing all 0x00s.
Lyrics of the song 99 bottles of beer, starting with 99 bottles~, newlines are 0x0A, paragraphs are separated by two 0x0As, and no newline character at the end.
Other strings you may provide.

Your program may include calculating the score of itself.
Of-course, lowest-score code will be the winner.

Duplicate (although better phrased) of http://codegolf.stackexchange.com/questions/3450/how-to-encode-shortest-brainf-ck-strings

I don't think that this should be closed as a duplicate, though. This question has a scoring method and is more directly a competition, while the other one was partly asking for an explanation of some BF code and does not have any code entries.

This seems rather hard to calculate the scores. It is a lot of different files we need to track down and run through. What is the point of 'Other strings you may provide'. Why would I add more if it will add to my score?

Lenna.png is going to dominate the score, as it is by far the largest input.  Maybe normalize a bit by size?

Minimum-length code for 'A' is ----[---->+<]>++.

OP obviously doesn't care about this challenge. Let's edit the scoring rules to something sensible? Currently, only one answer (unsuccessfully) tried to use these rules, so changing rules will not invalidate answers.

In Java, computes a short BF snippet which can convert any number to any other number.  Each output byte is generated by either transforming the last output byte or a fresh 0 on the tape.
The snippets are generated in three ways.  First by simple repetitions of + and - (e.g. ++++ converts 7 to 11), by combining known snippets (e.g. if A converts 5 to 50 and B converts 50 to 37, then AB converts 5 to 37) and simple multiplications (e.g. [--->+++++<] multiplies the current number by 5/3).  The simple multiplications take advantage of wraparound to generate unusual results (e.g. --[------->++<]> generates 36 from 0, where the loop executes 146 times, with a total of 4 descending and 1 ascending wraparounds).
I'm too lazy to compute my score, but it uses about 12.3 BF operations per byte on Lenna.png.
import java.io.*;

class shortbf {
    static String repeat(String s, int n) {
        StringBuilder b = new StringBuilder();
        for (int i = 0; i < n; i++) b.append(s);
        return b.toString();
    }

    // G[x][y]: BF code that transforms x to y.
    static String[][] G = new String[256][256];
    static {
        // initial state for G[x][y]: go from x to y using +s or -s.
        for (int x = 0; x < 256; x++) {
            for (int y = 0; y < 256; y++) {
                int delta = y - x;
                if (delta > 128) delta -= 256;
                if (delta < -128) delta += 256;

                if (delta >= 0) {
                    G[x][y] = repeat("+", delta);
                } else {
                    G[x][y] = repeat("-", -delta);
                }
            }
        }

        // keep applying rules until we can't find any more shortenings
        boolean iter = true;
        while (iter) {
            iter = false;

            // multiplication by n/d
            for (int x = 0; x < 256; x++) {
                for (int n = 1; n < 40; n++) {
                    for (int d = 1; d < 40; d++) {
                        int j = x;
                        int y = 0;
                        for (int i = 0; i < 256; i++) {
                            if (j == 0) break;
                            j = (j - d + 256) & 255;
                            y = (y + n) & 255;
                        }
                        if (j == 0) {
                            String s = "[" + repeat("-", d) + ">" + repeat("+", n) + "<]>";
                            if (s.length() < G[x][y].length()) {
                                G[x][y] = s;
                                iter = true;
                            }
                        }

                        j = x;
                        y = 0;
                        for (int i = 0; i < 256; i++) {
                            if (j == 0) break;
                            j = (j + d) & 255;
                            y = (y - n + 256) & 255;
                        }
                        if (j == 0) {
                            String s = "[" + repeat("+", d) + ">" + repeat("-", n) + "<]>";
                            if (s.length() < G[x][y].length()) {
                                G[x][y] = s;
                                iter = true;
                            }
                        }
                    }
                }
            }

            // combine number schemes
            for (int x = 0; x < 256; x++) {
                for (int y = 0; y < 256; y++) {
                    for (int z = 0; z < 256; z++) {
                        if (G[x][z].length() + G[z][y].length() < G[x][y].length()) {
                            G[x][y] = G[x][z] + G[z][y];
                            iter = true;
                        }
                    }
                }
            }
        }
    }
    static void generate(String s) {
        char lastc = 0;
        for (char c : s.toCharArray()) {
            String a = G[lastc][c];
            String b = G[0][c];
            if (a.length() <= b.length()) {
                System.out.print(a);
            } else {
                System.out.print(">" + b);
            }
            System.out.print(".");
            lastc = c;
        }
        System.out.println();
    }

    static void genFile(String file) throws IOException {
        File f = new File(file);
        int len = (int)f.length();
        byte[] b = new byte[len];
        InputStream i = new FileInputStream(f);
        StringBuilder s = new StringBuilder();
        while (true) {
            int v = i.read();
            if (v < 0) break;
            if (v == 0) continue; // no zeros
            s.append((char)v);
        }
        generate(s.toString());
    }
    public static void main(String[] args) throws IOException {
        genFile(args[0]);
    }
}

I know that I'm about two and a half years late and this isn't golf, but the repeat method could just be return new String(new char[length]).replaceAll("\0", str);

Well here's about the worst possible solution, although a rather nice looking one in Brainfuck itself:
++++++[>+++++++>+++++++++++++++>+++++++<<<-]>++++>+>+>,[[<.>-]<<<.>.>++.--<++.-->>,]

Score is probably the worst we are likely to see without intentionally making it bad.
Working on calculating actual score.

Could you explain what this does? Reading BF code is rather difficult.

For each byte of input it simply prints N +'s and a .

With I believe a [-] to clear the cell between each character.

Score: 4787486 4143940 4086426 (without randomly generated data)
(4085639 of that are from Lenna.png. That's 99.98%)
I don't get the part with the random data. Don't I need an account which I have to pay for to get the data?
Pretty naive. Here's the generated code for "1Aa" (49, 65, 97) with a little documentation:
                   // field 0 and 1 are loop counters.
                   // The fields 2, 3 and 4 are for "1", "A" and "a"
++++++++++[        // do 10 times
    >
    ++++++++++[    // do 10 times
        >          // "1" (49) is below 50 so we don't need to do anything here
        >+         // When the loops are done, this part will have increased the value of field 3 by 100 (10 * 10 * 1)
        >+         // same as above
        <<<-       // decrease inner loop counter
    ]
    >+++++         // this will add 50 (10 * 5) to field 2, for a total of 50
    >----          // subtract 40 from field 3, total of 60
    >              // Nothing done, value stays at 100
    <<<<-          // decrease outer loop counter
]
>>-.               // subtract 1 from field 2, total now: 49, the value for "1"
>+++++.            // add 5 to field 3, makes a total of 65, the value for "A"
>---.              // subtract 3 from field 4, total of 97, the value for "a"

The Java code is a bit ugly but it works. The generated instruction per input byte ratio is probably better the higher the average byte value is.
If you want to run it, you have to put Lenna.png in the same directory as the .class file. It prints the score to console and writes the generated BF code into a file called "output.txt".
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;

public class BrainFuckGenerator {
    public static CharSequence generate(byte[] bytes) {
        final StringBuilder brainfuckBuilder = new StringBuilder();
        for(int j = 0; j<10; j++)
                brainfuckBuilder.append("+");

        brainfuckBuilder.append("[>");

        for(int j = 0; j<10; j++)
            brainfuckBuilder.append("+");

        brainfuckBuilder.append("[");

        final StringBuilder singles = new StringBuilder();
        final StringBuilder tens = new StringBuilder();
        final StringBuilder goBack = new StringBuilder();

        for(byte b: bytes) {
            brainfuckBuilder.append(">");
            for(int j=0; j<(b/100); j++) {
                brainfuckBuilder.append("+");
            }

            tens.append(">");
            if((b - (b/100)*100)/10 <= 5) {
                for(int j=0; j<(b - (b/100)*100)/10; j++) {
                    tens.append("+");
                }
            } else {
                brainfuckBuilder.append("+");
                for(int j=0; j<10 - (b - (b/100)*100)/10; j++) {
                    tens.append("-");
                }
            }

            singles.append(">");
            if(b%10 <= 5) {
                for(int j=0; j<b%10; j++) {
                    singles.append("+");
                }
            } else {
                tens.append("+");
                for(int j=0; j<10 - (b%10); j++) {
                    singles.append("-");
                }
            }
            singles.append(".");

            goBack.append("<");
        }
        goBack.append("-");

        brainfuckBuilder
            .append(goBack)
            .append("]")
            .append(tens)
            .append("<")
            .append(goBack)
            .append("]>")
            .append(singles);

        return brainfuckBuilder;
    }

    public static void main(String[] args) {
        /* Hello, World! */
        int score = score("Hello, world!"+((char)0xA));

        /* 255 single chars */
        int charscore = 0;
        for(char c=1; c<=0xff; c++)
            charscore += score(String.valueOf(c));

        score += Math.round(((double)charscore)/16);

        /* Lenna */
        final File lenna = new File("Res/Lenna.png");
        final byte[] data = new byte[(int)lenna.length()];
        int size = 0;
        try(FileInputStream input = new FileInputStream(lenna)) {
            int i, skipped=0;
            while((i = input.read()) != -1)
                if(i == 0)
                    skipped++;
                else
                    data[size++ - skipped] = (byte)(i&0xff);
        } catch (IOException e) {
            e.printStackTrace();
        }

        score += score(Arrays.copyOf(data, size), "Lenna");

        /* 99 Bottles */
        final StringBuilder bottleBuilder = new StringBuilder();
        for(int i=99; i>2; i--) {
            bottleBuilder
                .append(i)
                .append(" bottles of beer on the wall, ")
                .append(i)
                .append(" bottles of beer.")
                .append((char) 0xa)
                .append("Take one down and pass it around, ")
                .append(i-1)
                .append(" bottles of beer on the wall.")
                .append((char) 0xa)
                .append((char) 0xa);

        }

        bottleBuilder
            .append("2 bottles of beer on the wall, 2 bottles of beer.")
            .append((char) 0xa)
            .append("Take one down and pass it around, 1 bottle of beer on the wall.")
            .append((char) 0xa)
            .append((char) 0xa)
            .append("No more bottles of beer on the wall, no more bottles of beer. ")
            .append((char) 0xa)
            .append("Go to the store and buy some more, 99 bottles of beer on the wall.");

        score(bottleBuilder.toString(), "99 Bottles");
        System.out.println("Total score: "+score);
    }

    private static int score(String s) {
        return score(s, null);
    }

    private static int score(String s, String description) {
        final CharSequence bf = generate(s.getBytes());
        try(FileWriter writer = new FileWriter("Res/output.txt", true)) {
            writer.write((description == null ? s : description));
            writer.write(NL);
            writer.write("Code:");
            writer.write(NL);
            writer.write(bf.toString());
            writer.write(NL+NL);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return bf.length();
    }

    private static int score(byte[] bytes, String description) {
        final CharSequence bf = generate(bytes);
        try(FileWriter writer = new FileWriter("Res/output.txt", true)) {
            if(description != null) {
                writer.write(description);
                writer.write(NL);
            }
            writer.write("Code:");
            writer.write(NL);
            writer.write(bf.toString());
            writer.write(NL+NL);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return bf.length();
    }

    private static final String NL = System.getProperty("line.separator");
}

I'm going to make some small improvements but probably not much. Done.

This is broken, the generated BF outputs NUL bytes or '?' characters depending on the locale for any character not in 1..127. Plain ASCII (1-127) seems to be fine though. Noticing that (byte)s are signed and carefully choosing a locale gets a lot of them (taking the score over 5800000) but there are still several thousand NULs from the bf conversion of Lenna.png. So there's something else too.

I'm not sure how good it is, but I had fun writing this. (In Clojure...)
(ns bf.core)
(def input "Hello world!")
(defn abs [x] (if (and (< x 0) (= (type x) (type 1))) (* x -1) x))
(defn sqrt? [x y] (if (= (* y y) x) true false) )
(defn sqrt [x] (for [y (range x) :when (sqrt? x y)] y) )
(defn broot [x]
;  Run this using trampoline, e.g., (trampoline broot 143)
  (if (< x 2) nil)
  (let [y (sqrt x)]
    (if (not= (seq y) nil)
      (first y)
      (broot (dec x) )
      )
    )
  )
(defn factor [x]
  (if (<= x 2) x)
  (for [y (range (- x 1) 1 -1)
        :when (= ( type (/ x y) ) (type 1) )
        ]
    y)
  )

(defn smallest_factors [x]
  (let [ facts (factor x) ]
  (if (= (count facts) 2) facts)
  (if (< (count facts) 2) (flatten [facts facts])
    (let [ y (/ (dec (count facts) ) 2)
          yy (nth facts y)
          z (inc y)
          zz (nth facts z)
          ]
      (if (= (* yy zz) x ) [yy zz] [yy yy])
      )
    )
    )
  )

(defn smallestloop [x]
  (let [ facts (smallest_factors x)
        fact (apply + facts)
        sq (trampoline broot x)
        C (- x (* sq sq) )]
    (if (and (< fact (+ (* 2 sq) C) ) (not= fact 0))
      facts
      [sq sq C])
    )
  )
(def lastx nil)
;Finally!
(defn buildloop [x]
  (if (nil? lastx)
     (let [pluses (smallestloop x)]
       (apply str
              (apply str (repeat (first pluses) \+))
              "[>"
              (apply str (repeat (second pluses) \+))
              "<-]>"
              (if (and (= (count pluses) 3) (> (last pluses) 0))
                (apply str(repeat (last pluses) \+))
              )
              "."
              )
    )
    (let [diff (abs (- x lastx) )]
      (if (< diff 10)
        (if (> x lastx)
          (apply str
               (apply str (repeat diff \+))
               "."
                 )
          (apply str
                 (apply str (repeat diff \-))
                 "."
                 )
          )
        (let [signs (smallestloop diff)]
          (apply str
             "<"
             (apply str (repeat (first signs) \+))
             "[>"
             (if (> x lastx)
               (apply str (repeat (second signs) \+))
               (apply str (repeat (second signs) \-))
             )
             "<-]>"
             (if (and (= (count signs) 3) (> (last signs) 0))
               (if (> x lastx)
                 (apply str(repeat (last signs) \+))
                 (apply str(repeat (last signs) \-))
               )
             )
             "."
           )
         )
        )
      )
    )
  )
(for [x (seq input)
  :let [y (buildloop (int x))]
      ]
  (do
   (def lastx (int x))
   y
   )
  )

There are probably more efficient solutions, and more elegant ones, but this follows my thought pattern somewhat linearly, so it was easiest.

Python 3.x
Well, I'm not going to win any prizes for the shortest output code but maybe for the program to generate the code...
x=input();o=''
for i in x:
 a=ord(i)
 o+="+"*a+".[-]"
print(o)

'Hello, World!\n':
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++.[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++.[-]+++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+.[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++++++
++++.[-]++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++.[-]+++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++.[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++.[-]+++++++++++++++++++++++++++++++++.[-]++++++++++.[-]

Accidentally answered to Madisons answer. Shorter generator: print("".join(["+"*ord(i)+".[-]"for i in input()]))

You can golf your program by 2 chars by replacing .[-] with .>

47 bytes

BrainF**k
I'm a pretty bad BF programmer, so this answer is probably pretty inefficient. I'm unsure of the score, but it should perform slightly better than the existing answer on your average text. Rather than zeroing the cell out after every character, this one will "adjust" to a new character with subtraction if the previous character given is larger.
>>++++++[-<+++++++>]<+>>+++++[-<+++++++++>]>+++++[-<+++++++++>]<+>>,[-<+>>>>>>+<<<<<]<[-<<<.>>>]<.>>+>,[[-<<+>>>+>>+<<<]>>>>[-<<+>>]<[->+<]<<[->-[>]<<]<[->->[-<<<<<<.>>>>>>]<<]>+[-<<->>>[-<<<<<<.>>>>>>]<]<<<[>]<<.>[-]>+>,]

(Note, this is code I wrote a long time ago, and have repurposed for this competition. I sincerely hope I've done the conversion correctly, but if it fails for any input let me know.)
A version showing the state of the tape throughout the code:
>>++++++[-<+++++++>]<+>             [0 '+' 0]
                                           ^
>+++++[-<+++++++++>]                [0 '+' '-' 0]
                                               ^
>+++++[-<+++++++++>]<+>             [0 '+' '-' '.' 0]
                                                   ^
>,[-<+>>>>>>+<<<<<]                 [0 '+' '-' '.' a 0 0 0 0 0 a]
                                                     ^
<[-<<<.>>>]<.>>+>                   [0 '+' '-' '.' 0 1 0 0 0 0 a]
                                                       ^
,[[-<<+>>>+>>+<<<]                  [0 '+' '-' '.' b 1 0 b 0 b a]
                                    [b is not 0]       ^
>>>>[-<<+>>]<[->+<]                 [0 '+' '-' '.' b 1 0 b a 0 b]
                                                             ^
<<[->-[>]<<]

<[->->[-<<<<<<.>>>>>>]<<]

>+[-<<->>>[-<<<<<<.>>>>>>]<]        [0 '+' '-' '.' b 0 0 0 0 0 b]
                                                       ^|^
                                    [OUTPUT ONE CHARACTER BY THIS POINT]
<<<[>]<<.>[-]>                      [0 '+' '-' '.' 0 0 0 0 0 0 b]
                                                     ^
+>,]                                [End when b == 0]
                                    [GOAL: '+' '-' '.' b 1 0 b a 0 a]

Generated code for Hello, World!:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------.------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++.+++.------.--------.-------------------------------------------------------------------.

This is my first answer on CG.SE! If I've screwed something up, let me know!

><>
i:&v
.21<>i:0(?;:&:@(4g62p$:&-01-$:@0(?*l2=?~02.
>:?!v"+"o1-
"."~<.15o
+-

I wrote this in response to a question marked for a duplicate, and even though this isn't the greatest golf (for this specific question, at least) I figured it'd be kind of a waste if I didn't share it in all of its disgustingly gibberish-y glory. Really, I'm half-surprised it even works. I'll take any suggestions to golf it down since that was my main goal in its creation.
As a side note, in the second line the beginning three characters .21 could be replaced with v followed by two spaces if that makes it any easier to read. I don't like to see spaces in my ><> programs because that means there's wasted space (literally). It also is a remnant from one of many prototypes.
The way it functions is really simple, and quite frankly I'd have a difficult time thinking of a way to implement another algorithm. It prints however many "+"s need to be printed for the first character, and then prints more "+"s or "-"s as needed for each additional character, separating each section with periods. What I find cool about the program is that it modifies its own source code so that it prints "+" or "-" (it replaces the "+" on line 3 with the appropriate character after determining whether the current character is greater than or less than the previous one).
Output for Hello, World!:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------.------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++.+++.------.--------.-------------------------------------------------------------------.

I might score this the way it was intended to be scored, but I'm almost positive I'd lose and I don't entirely know how to read something like lenna.png in ><>.
If this answer interests you and you'd like an explanation, by all means ask, but for now I'll leave it without one just because of how twisty and turny it is.
EDIT 1: It's been a while but I was able to golf off 2 bytes with an almost complete overhaul of the way the program decides whether to print a plus or a minus. It's a somewhat disappointing return for a large overhaul but at least it works.

This gibberish program makes another gibberish program! This is the greatest program i've ever seen!

Kotlin
First I must admit that about half of this is shamelessly stolen from Keith Randel's answer. I literally copied and pasted his code for finding multiplications into mine. It is very well done. I have made 2 modifications to his code.

It is very easy to reverse the direction of any of the transitions Keith's code produces. All you have to do is replace < with > and > with <. Ex. +[->++<]> becomes +[-<++>]<. This means that equally, good code* that only uses 2 cells can be produced.
The second thing I did was to add a hash. To add a hash the code simply includes a > after the .. Then for all subsequent characters, the program calculates if the code to move to the hash (such as <<<.>>>) is shorter than the regular code to produce this output. To find the locations for the hash the program loops through each character of the input and checks if hashing that character decreases the length of the program. It only hashes each type of character once which is slightly inefficient but is necessary to make the program not run like a snail.

Speaking of time complexity my program is quadratic time as opposed to Keith's which is linear. This is because the full code for any hash configuration has to be generated for each character. It is still possible to stop the algorithm early and get a better result than you started with as each cache only improves the score.
So how good does it do. Theoretically, it always does better than Keith's however, this isn't quite true. Keith's code can get to zero from any number simply by inserting a > but mine cannot because it would move too far from the hash. As a result, some of my transitions are slightly longer than Keith's meaning I actually achieve a lower score on Lenna.png. However since most of the transitions where starting with zero instead are very small or very large if you only include letters in the printable ASCII range 32 to 126 my program does beat Keith's. So although it can be worse my algorithm is better in practice. Lets look at some numbers.
Numbers
Lenna.png (no 0s), 471470 characters

Keith:  5832730 bf chars,  12.37 bf chars / input
Me:    <5894582 bf chars, <12.5  bf chars / input

Keith + 0.13

Lenna.png (32 to 126), 174177 characters

Keith:  2022451 bf chars,  11.61 bf chars / input
Me:    <1977716 bf chars,  11.25 bf chars / input

Me + 0.36

Hello, World!\n, 14 characters

Keith:      139 bf chars, 9.93 bf chars / input
Me:         139 bf chars, 9.93 bf chars / input

Even

I went to the store today, 25 characters

Keith:      265 bf chars, 10.6 bf chars / input
Me:         190 bf chars,  7.6 bf chars / input

Me + 3

447 characters of Lorem Ipsum

Keith:     4427 bf chars,  9.9 bf chars / input
Me:        3017 bf chars, 6.75 bf chars / input

Me + 3.15

1001 random lowercase letters

Keith:     8035 bf chars, 8.03 bf chars / input
Me:        7028 bf chars, 7.02 bf chars / input

Me + 1.01

Code
const val CELL_SIZE = 256
const val WRAPPING = true

enum class Direction {
    LEFT, RIGHT;

    fun opposite() = when (this) {
        LEFT -> RIGHT
        RIGHT -> LEFT
    }
}

data class Transition(
    val code: String,
    val startD: Direction,
    val endD: Direction,
) {
    fun plus(t: Transition) = if (endD == t.startD) {
        Transition(code + t.code, t.startD, t.endD)
    } else {
        val r = t.reverse()
        Transition(code + r.code, t.startD, r.endD)
    }

    fun reverse(): Transition {
        val newCode = code.replace(">", "|").replace("<", ">").replace("|", "<")
        return Transition(newCode, startD.opposite(), endD.opposite())
    }
}

var simpleTransitions = {
    val list = Array(CELL_SIZE) { start ->
        Array(CELL_SIZE) { end ->
            var delta = end - start
            if (WRAPPING) when {
                delta > CELL_SIZE / 2 -> delta -= CELL_SIZE
                delta < -CELL_SIZE / 2 -> delta += CELL_SIZE
            }
            val char = if (delta > 0) "+" else "-"
            Transition(char.repeat(abs(delta)), Direction.LEFT, Direction.LEFT)
        }
    }

    //check for multiplication
    for (x in 0..255) {
        for (n in 1..39) {
            for (d in 1..39) {
                var j = x
                var y = 0
                for (i in 0..255) {
                    if (j == 0) break
                    j = j - d + 256 and 255
                    y = y + n and 255
                }
                if (j == 0) {
                    val s = "[" + "-".repeat(d) + ">" + "+".repeat(n) + "<]>"
                    if (s.length < list[x][y].code.length) {
                        list[x][y] = Transition(s, Direction.LEFT, Direction.RIGHT)
                    }
                }
                j = x
                y = 0
                for (i in 0..255) {
                    if (j == 0) break
                    j = j + d and 255
                    y = y - n + 256 and 255
                }
                if (j == 0) {
                    val s = "[" + "+".repeat(d) + ">" + "-".repeat(n) + "<]>"
                    if (s.length < list[x][y].code.length) {
                        list[x][y] = Transition(s, Direction.LEFT, Direction.RIGHT)
                    }
                }
            }
        }
    }

    for (i in 0 until CELL_SIZE) {
        if (list[i][0].code.length > 3) list[i][0] = Transition("[-]", Direction.LEFT, Direction.LEFT)
    }

    var change = true
    while (change) {
        change = false
        for (i in 0 until CELL_SIZE) {
            for (j in 0 until CELL_SIZE) {
                for (k in 0 until CELL_SIZE) {
                    if (list[i][j].code.length + list[j][k].code.length < list[i][k].code.length) {
                        list[i][k] = list[i][j].plus(list[j][k])
                        change = true
                    }
                }
            }
        }
    }

    println("done")
    list
}()

fun generate(s: String, cells: Int): String {
    var caches: MutableList<Boolean> = MutableList(s.length) { false }
    var currentCost = generateFromCache(s, caches)
    val changes: MutableMap<Char, Int> = mutableMapOf()

    if (cells > 2) {
        for ((i, c) in s.withIndex()) {
            val newCaches = caches.mapIndexed { index, b -> if (s[index] == c) false else b }.toMutableList()
            var lowest: Char? = null
            if (newCaches.count { it } >= cells - 2) {
                lowest = changes.minByOrNull { it.value }!!.key
                newCaches[newCaches.withIndex().indexOfFirst { it.value && s[it.index] == lowest }] = false
            }
            newCaches[i] = true
            val newCost = generateFromCache(s, newCaches)
            if (newCost.length < currentCost.length) {
                println(newCost.length)
                changes[c] = currentCost.length - newCost.length
                currentCost = newCost
                caches = newCaches
                if (lowest != null) changes.remove(lowest)
            }
        }
    }

    return currentCost
}

my JavaScript solution it`s quick and dirty :)
output for Hello World\n
++++++++++[>+++++++>++++++++++>+++++++++++>+++>+++++++++>+<<<<<<-]>++.>+.>--..+++.>++.>---.<<.+++.------.<-.>>+.>>.

Source:
BfGen("Hello World!\n");
// ++++++++++[>+++++++>++++++++++>+++++++++++>+++>+++++++++>+<<<<<<-]>++.>+.>--..+++.>++.>---.<<.+++.------.<-.>>+.>>.
// Length of BF code: 115
// Score: 8.846153846153847

function BfGen(input) {
    function StringBuilder() {
        var sb = {};

        sb.value = '';
        sb.append = (txt) => sb.value += txt;

        return sb;
    }

    function closest (num, arr) {
        var arr2 = arr.map((n) => Math.abs(num-n))
        var min = Math.min.apply(null, arr2);
        return arr[arr2.indexOf(min)];
    }

    function buildBaseTable(arr) {
        var out = StringBuilder();
        out.append('+'.repeat(10));
        out.append('[')
        arr.forEach(function(cc) {
            out.append('>');
            out.append('+'.repeat(cc/10));
        });
        out.append('<'.repeat(arr.length));
        out.append('-');

        out.append(']');
        return out.value;
    }

    var output = StringBuilder();

    var charArray = input.split('').map((c) =>c.charCodeAt(0));
    var baseTable = charArray.map((c) => Math.round(c/10) * 10).filter((i, p, s) => s.indexOf(i) === p);

    output.append(buildBaseTable(baseTable));

    var pos = -1;
    charArray.forEach(function (charCode) {
        var bestNum = closest(charCode, baseTable);
        var bestPos = baseTable.indexOf(bestNum);

        var moveChar = pos < bestPos? '>' : '<';
        output.append(moveChar.repeat(Math.abs(pos - bestPos)))
        pos = bestPos;

        var opChar = baseTable[pos] < charCode? '+': '-';
        output.append(opChar.repeat(Math.abs(baseTable[pos] - charCode)));
        output.append('.');
        baseTable[pos] = charCode;
    });

    console.log(output.value)
    console.log('Length of BF code: ' + output.value.length);
    console.log('Score: ' + output.value.length / input.length);
}

Welcome to the site!  You should include the score in the title of your answer.

i just made the bf generator, original score system has image processing what is not relevant :(
Hello world ratio is less then 9 (bf length / original text length)

Python 3
print("".join("+"*ord(i)+".[-]"for i in input()))

This is essentially just an slightly improved version of icedvariables' answer.
(-1 Byte from Wheat Wizard, -5 from FatalError, -2 from jez)

I believe this is python 3.  If so You should include so in your header.  If so you can also remove the line break after your :.  This could also probably be done as a list comprehension to save bytes.

-5 bytes with print("".join(["+"*ord(i)+".[-]"for i in input()]))

-2 bytes: lose the square brackets so you're calling join() on a generator expression rather than a list comprehension:  print("".join("+"*ord(i)+".[-]"for i in input()))

-2 bytes: you can simply move to the next cell (the question states you should assume an infinite band in both directions print("".join("+"*ord(i)+".>"for i in input())) (this also reduces the score since you lose 2 bytes in the output)

I built something in Java. Didn't calculate the score. Texts with 3 or less characters are encoded with a multiplication per letter e.g. "A" = ++++++++[>++++++++<-]>+.. Texts with more than 3 characters are encoded with a calculated list which is split into 3 areas. The first area is x times 49, then plus x times 7 and finally plus x. For example "A" is 1*49 + 2*7 + 2
public class BFbuilder {
    public static void main(String[] args) {
        String text = "### INSERT TEXT HERE ###";

        if (text.length()<=3){
            String result = "";
            for (char c:text.toCharArray()) {
                result += ">";
                if (c<12) {
                    for (int i=0;i<c;i++) {
                        result += "+";
                    }
                    result += ".>";
                } else {
                    int root = (int) Math.sqrt(c);
                    for (int i = 0; i<root;i++) {
                        result += "+";
                    }
                    result += "[>";
                    int quotient = c/root;
                    for (int i = 0; i<quotient;i++) {
                        result += "+";
                    }
                    result += "<-]>";
                    int remainder = c - (root*quotient);
                    for (int i = 0; i<remainder;i++) {
                        result += "+";
                    }
                    result += ".";
                }
            }
            System.out.println(result.substring(1));
        } else {
            int[][] offsets = new int[3][text.length()];
            int counter = 0;
            String result = "---";

            for(char c:text.toCharArray()) {
                offsets[0][counter] = c/49;
                int temp = c%49;
                offsets[1][counter] = temp/7;
                offsets[2][counter] = temp%7;
                counter++;
            }

            for (int o:offsets[0]) {
                switch (o) {
                case 0: result+=">--";
                break;
                case 1: result+=">-";
                break;
                case 2: result+=">";
                break;
                case 3: result+=">+";
                break;
                case 4: result+=">++";
                break;
                case 5: result+=">+++";
                break;
                }
            }
            result += ">+[-[>+++++++<-]<+++]>----";
            for (int o:offsets[1]) {
                switch (o) {
                case 0: result+=">---";
                break;
                case 1: result+=">--";
                break;
                case 2: result+=">-";
                break;
                case 3: result+=">";
                break;
                case 4: result+=">+";
                break;
                case 5: result+=">++";
                break;
                case 6: result+=">+++";
                break;
                }
            }
            result += ">+[-[>+++++++<-]<++++]>----";
            for (int o:offsets[2]) {
                switch (o) {
                case 0: result+=">---";
                break;
                case 1: result+=">--";
                break;
                case 2: result+=">-";
                break;
                case 3: result+=">";
                break;
                case 4: result+=">+";
                break;
                case 5: result+=">++";
                break;
                case 6: result+=">+++";
                break;
                }
            }
            result += ">+[-<++++]>[.>]";
            System.out.println(result);
        }
    }
}

The provided String "### INSERT TEXT HERE ###" becomes
--->-->-->-->-->->->->->->->-->->->->->-->->->->->-->-->-->-->+[-[>+++++++<-]<+++]>---->++>++>++>+>>+>+>->+>++>+>++>->++>++>+>>->+>->+>++>++>++>+[-[>+++++++<-]<++++]>---->--->--->--->+>>-->+++>+++>++>--->+>--->+++>+>--->+>->+++>++>+++>+>--->--->--->+[-<++++]>[.>]
"Hello, World!" becomes
--->->>>>>-->-->->>>>>-->+[-[>+++++++<-]<+++]>---->>--->-->-->-->+++>+>++>-->->-->--->+>+[-[>+++++++<-]<++++]>---->->>>>+++>->+>>+++>->>->++>+[-<++++]>[.>]

source: Stack Exchange

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

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

sort: votes


text:
Code golf: Solve a Knights and Knaves logic problem by parsing English
Background
There are two people, Bill and John. One of them is a knight, which always tells the truth, and the other is a knave, which always tells a lie. You don't know who is the knight and who is the knave. Each person then says several statements about who is the knave and who is the knight. Using this information, you must come to a conclusion as to who is the knight and who is the knave.
The Knights and Knaves logic problem is based on Booleen algebra. The words that a person says form a Booleen satisfiability problem. The knave's statements must always be false and the other knight's statements must always be true.
John says "Both I am a knave and Bill is a knave". If John were the knight, then this statement would be false, so he can't be the knight. If he were the knave and Bill were the knight, this statement would still be false, even thought the first part is true. So, John is the knave.
The Challenge
Your challenge is to write the shortest program possible that will take a list of statements made by each person and will figure out who is the knave and who is the knight. There are a lot of details to cover, so this problem is described in three sections.
Input
Input will be two lines followed by a newline. Each line will give the name of one of the characters, followed by a colon, followed by several sentences said by that person. If one person is the knight, then all of his sentences will be true, and all of the knave's sentences will be false. The first letter of a sentence will always be capitalized, and every sentence will end with a period. Here is an example:
Joe: Both I am a knight and neither Steve is a knave nor I am a knave.
Steve: Joe is a knave. Either Joe is a knight or I am a knight.

Parsing
Each sentence consists of at least one clause. Each clause contains one of several things (hopefully you can understand my notation):
both [clause] and [clause]
either [clause] or [clause]
neither [clause] nor [clause]
[I am | (other person's name) is] a [knight | knave]

This is unambigious becuase it can be understood in a way similar to Polish notation. Here is an example of a sentence:
Both I am a knight and neither Steve is a knave nor I am a knave.

The translation into Booleen algebra is straightforward. The "both" statements are ANDs, the "either" statements are XORs, and the "neither" statements are NORs.
(I am a knight) AND ((Steve is a knave) NOR (I am a knave))

Output
Output will consist of two lines. Each line consists of a person's name (in order) and then says whether he is the knight or the knave. There will always be one knight and one knave. Here is the output for the above example:
Joe is the knave.
Steve is the knight.

If the problem is unsolvable (either you can't tell who is what, or there is no solution), then your program can do anything EXCEPT produce a valid output.
More examples
Input
Sir Lancelot: Either both I am a knight and Merlin is a knave or both I am a knave and Merlin is a knight.
Merlin: Either both I am a knight and Sir Lancelot is a knight or both I am a knave and Sir Lancelot is a knave.

Output
Sir Lancelot is the knight.
Merlin is the knave.

Input
David: Neither I am a knave nor Patrick is a knight. Either I am a knight or Patrick is a knave.
Patrick: Either I am a knight or both I am a knight and David is a knight.

Output
David is the knave.
Patrick is the knight.

Input
Lizard: I am a knight.
Spock: I am a knave.

One possible output
Rock Paper Scissors

Rules, Regulations and Notes

Standard code golf rules apply
Your program must be only made up of printable ASCII
All input and output will be from STDIN and STDOUT

What about case sensitivity? Your syntax description is lowercase, your examples are uppercase. Is case insensitivity a requirement?

The first letter of each sentance will be capitalized, but other than that only names would be capitalized. What specific problem are you seeing?

Since you use proper English capitalization, the first letter in both/either/neither depends on context. I guess being case-insensitive is the easy way to deal with it.

Python, 491 chars
Works by converting each line to a Python expression, and eveluating it.
The knave and knight are evaluated as 0 and 1. For the two people, we try both options.
For example, Joe: Steve is a knave becomes Joe==(Steve==knave). This way, if Joe is a knave, the result is true only if he's lying.
You get ugly errors when it's impossible or undecided. If impossible, r[0] is an index error, because r is empty. If undecidable, concatenating r[1:] to a list of strings causes trouble.
import sys
def p():
    a=s.pop(0)
    try:return{"both":"(%s*%s)","either":"(%s|%s)","neither":"(1-(%s|%s))"}[a.lower()]%(p(),p())
    except KeyError:r=s[2];del s[:4];return"(%s==%s)"%((a,m)[a=="I"],r)
x=[];w=[]
for l in sys.stdin:
    m,l=l.split(":");w+=[m]
    for s in l.split("."):
        s=s.split()
        while s:x+=["%s==%s"%(m,p())]
k=("knave","knight")
r=[a for a in[{w[0]:z,w[1]:1-z}for z in(0,1)]if all(eval(l,{k[0]:0,k[1]:1},a)for l in x)]
print"\n".join(x+" is the "+k[r[0][x]]+"."for x in w+r[1:])

Ruby, 352 characters
The solution became quite long so there might still be some place to golf. It requires the input to be well-formed (as all the examples above are - but don't try to name a person "Both"...).
q=->{gets.split /: |\.\s/}
C,*E=q[]
D,*F=q[]
r=->c,m{t=c.shift;t[1]?(x=r[c,m];c.shift;y=r[c,m];t[0]==?B?x&y :t[0]==?E?x^y :1-(x|y)):(c.shift(2);h=c.shift[2]==?I?m : 1-m;t==?I?h :1-h)}
s=->u,v,b{u.map{|c|r[c.gsub(v,?J).upcase.split,b]==b}.all?}
t=->b{s[E,D,b]&&s[F,C,1-b]}
u=->v,b{v+" is the kn#{b ?:ight: :ave}."}
puts t[1]^t[0]&&u[C,t[1]]+$/+u[D,t[0]]

You seem to leave off the periods in the output, but it seems like a two character fix.

@PhiNotPi Done. Was a zero-character fix...

Perl - 483 bytes
(($a,$b),($c,$d))=map{split':'}@ARGV;$h='y';$i='x';$s=' is the kn';$g='ight.';$v='ave.';for($b,$d){$_.=' 1';s/ am a | is a /==/g;s/knight/1)/g;s/knave/0)/g;s/I=/(\$$i=/g;s/($a|$c)=/(\$$h=/g;s/([^.]+)\./($1)and/g;s/ or / xor /g;s/ nor / or /g;while(s/(?<= )(\w+ \((?:[^()]+|(?1))\) \w+ \((?:[^()]+|(?1))\))/($1)/g){}s/neither/!/gi;s/both|either//gi;$h=$i++}$x=0;$y=1;$k=!eval($b)&&eval($d);$x=$y--;$n=!eval($d)&&eval($b);print"$a$s$v
$c$s$g"if($k&&!$n);print"$a$s$g
$c$s$v"if($n&&!$k)

Similar to the Python solution. It reduces the sentences to Perl code and then evals them. It can print almost-valid output if the input is weird but doesn't print anything if it's undecidable. Well-formed input works as expected. The sentences are passed in on the command line inside quotes and no special flags are needed.

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


text:
Rosetta Stone Challenge: Find the rule for a series
The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism!
The Challenge
Your challenge is to implement a program that will input a list of numbers and output the rule used to generate each successive number in the series, in as many programming languages as possible. You are allowed to use any sort of standard library function that your language has, since this is mostly a language showcase.
What is a "series?"
A series is an ordered list of integers. Each successive number in the series can be generated by applying a simple rule to the previous number in the series. In this challenge, the rule consists of multiplying the number by a constant, and then adding a second constant. Both of the constants can be any integer. The goal of this challenge is to output those two constants.
For the series 2 5 11, the rule can be written as 2 1. This means that each number is the previous number, times 2, plus 1. An important fact is that most series have exactly one rule. Some series have either an infinite number or none at all, but you will not have to deal with this.
Input
Input will be a list of three different integers which are the numbers in the sequence. The numbers can be either space, comma, or newline delimited, but please specify which. I am going to be flexible on this limitation because certain languages may have input restrictions. Here are four examples of input:
0 7 14
2 5 11
2 0 -4
5 -19  77

Output
Output will be two integers which represent the rule used to generate the series. The first number will be the multiplicative constant, while the second number will be the additive constant. The formatting of the output can be space, comma, or newline delimited. I am flexible on this limitation as well. Here are the corresponding examples of output:
1 7
2 1
2 -4
-4 1

The Objective Winning Criterion
As for an objective winning criterion, here it is: Each language is a separate competition as to who can write the shortest entry, but the overall winner would be the person who wins the most of these sub-competitions. This means that a person who answers in many uncommon languages can gain an advantage. Code-golf is mostly a tiebreaker for when there is more than one solution in a language: the person with the shortest program gets credit for that language.
Rules, Restrictions, and Notes
Your program can be written in any language that existed prior to April 9th, 2012. I will also have to rely on the community to validate some responses written in some of the more uncommon/esoteric languages, since I am unlikely to be able to test them.

Current Leaderboard
This section will be periodically updated to show the number of languages and who is leading in each.

AWK (32) - mellamokb
bash (31) - Peter Taylor
Befunge (29) - Howard
bc (39) - kernigh
brainfuck (174) - CMP
C (78) - l0n3_shArk
C++ (96) - leftaroundabout
Common Lisp (88) - kernigh
Cray Chapel (59) - Kyle Kanos
csh (86) - kernigh
Cuda (301) - leftaroundabout
dc (30) - kernigh
DOS BATCH (54) - mellamokb
Element (27) - Howard
es (95) - kernigh
Factor (138) - kernigh
Felix (86) - kirbyfan64sos
Fortran (44) - Kyle Kanos
Go (101) - Howard
GolfScript (16) - Howard
Golflua (44) - Kyle Kanos
Haskell (35) - leftaroundabout
J (23) - Gareth
Java (141) - Howard
JavaScript (47) - mellamokb
Julia (71) - M L
Lua (51) - Howard
Mercury (319) - leftaroundabout
MoonScript (48) - kirbyfan64sos
Nimrod (146) - leftaroundabout
Owl (22) - r.e.s.
Pascal (88) - leftaroundabout
Perl (57) - Gareth
PHP (61) - mellamokb
PicoLisp (72) - kernigh
Piet (56) - M L
PostScript (61) - Howard
Python (40) - Howard
Q (36) - tmartin
QBasic (34) - mellamokb
R (50) - r.e.s.
Ruby (44) - Howard
Scala (102) - Gareth
SQL (57) - Aman ZeeK Verma
TI-83 BASIC (25) - mellamokb
Unlimited Register Machine (285) - Paxinum
VBA (57) - Gaffi
Whitespace (123) - r.e.s.
zsh (62) - kernigh

Current User Rankings
Equal ranks are sorted alphabetically.

Howard          (9): Befunge (29), Element (27), Go (101), GolfScript (16), Java (141), Lua (51), PostScript, (61) Python, (40) Ruby (44)
kernigh         (8): bc (39), Common Lisp (88), csh (86), dc (30), es (95), Factor (138), PicoLisp (72), zsh (62)
leftroundabout  (6): C++ (96), Cuda (301), Haskell (35), Mercury (319), Nimrod (146), Pascal (88)
mellamokb       (6): AWK (32), DOS BATCH (54), JavaScript (47), PHP (61), QBasic (34), TI-83 BASIC (41)
Gareth          (3): J (23), Perl (57), Scala (102)
Kyle Kanos      (3): Cray Chapel (59), Fortran (44), Golflua (44)
r.e.s.          (3): Owl (22), R (50), Whitespace (123)
kirbyfan64sos   (2): Felix (86), MoonScript (48)
M L             (2): Julia (71), Piet (56)
Aman Zeek verma (1): SQL (57)
CMP             (1): brainfuck (174)
Gaffi           (1): VBA (57)
l0n3_shArk      (1): C (78)
Paxinum         (1): Unlimited Register Machine (285)
Peter Taylor    (1): bash (31)
tmartin         (1): Q (36)

It doesn't look like people actually read the tags, or other descriptions...

@leftaroundabout: Why do you say that?  I am aware (for instance) that my solution doesn't take array input and plan to fix it later.  And I'm too lazy to post more than one solution at the moment :)  According to the Object Winning Criterio, code-golf is the tie-breaker for two posts with the same language, hence I've included the character count for easy reference in case someone else posts a JavaScript solution.  This may in fact be one of those rare moments when a question deserves both the code-golf and code-challenge tags.

Yeah, you're right: someone has to do the not-unusual languages as well.

I like the way you specified this problem, but mathematical pendants will tell you that a general series is not required to have a generating rule at all.

I know, but trying to calculate a generating rule wouldn't be much fun if there wasn't one. :)

As long as you keep the Current Leaderboard in the same standard format as above, you can use this to generate each user's scores: http://jsfiddle.net/bk2WM/2/

@mellamokb Wow, thanks. As the number of languages increases, that could actually become very useful.

Added a score-board to my post from the current list.

My newest version (http://jsfiddle.net/bk2WM/4/) provides a raw output (in the textarea) you can copy/paste into a post, and formats it like I did in my post. Feel free to change/play with the layout.

Doesn't my PostScript solution count? ;-)

@Howard Sorry, I must have overlooked it.

QBasic, 42
INPUT "",a,b,c
m=(c-b)/(b-a)
PRINT m;b-m*a

Requires input with commas, outputs with spaces (is this ok?)

Mercury, 319
:-module r.
:-interface.
:-import_module io,list,int,char,string.
:-pred main(io::di,io::uo)is det.
:-implementation.
main(!IO):-io.read_line_as_string(J,!IO),(if J=ok(I),[A,B,C]=list.map(string.det_to_int,string.words_separator(char.is_whitespace,I)),M=(C-B)/(B-A)then io.format("%d %d",[i(M),i(B-M*A)],!IO)else true).

Haskell, 85 81
f[a,b,c]|m<-(c-b)`div`(b-a)=[m,b-m*a]
main=getLine>>=mapM_ print.f.map read.words

Now inputs with spaces, outputs with newlines.

C, 80
main(a,b,c,m){scanf("%d %d %d",&a,&b,&c);m=(c-b)/(b-a);printf("%d %d",m,b-m*a);}

C++, 96
#include<iostream>
main(){int a,b,c,m;std::cin>>a>>b>>c;m=(c-b)/(b-a);std::cout<<m<<' '<<b-m*a;}

Nimrod, 146
import strutils
var
 q:array[0..3,int]
 b,m:int
for i in 0..2:q[i]=ParseInt(readLine(stdin))
b=q[1]
m=(q[2]-b)div(b-q[0])
echo($m,",",$(b-m*q[0]))

Input w/ newlines, output comma.

This one won't count, but I feel it still fits in in some way:
Mathematical theorem, 713 characters of LaTeX
\documentclass{article}\usepackage{amsmath}\usepackage{amsthm}\begin{document}Theorem: for a sequence $(a_i)_i$ of integers with $a_2\neq a_1$ where $a_3-a_2$ is divisible by $a_2-a_1$, $m:=\frac{a_3-a_2}{a_2-a_1},\ p:=a_2-m\cdot a_1$ give rise to a sequence\[b_i:=\begin{cases}a_1&\text{for }i=1\\b_{i-1}\cdot m+p&\text{else}\end{cases}\] such that $b_i=a_i\ \forall i\leq 3$.

Proof: $i=1$ is trivial,\[\begin{aligned}b_2=&b_1\cdot m+p=a_1\frac{a_3-a_2}{a_2-a_1}+a_2-\frac{a_1a_3-a_1a_2}{a_2-a_1}=a_2,\\b_3=&b_2\cdot m+p=\frac{a_2a_3-a_2^2}{a_2-a_1}+a_2-\frac{a_1a_3-a_2^2}{a_2-a_1}\\=&\frac{a_2a_3-a_1a_3+(a_2-a_1)a_2-a_2^2+a_1a_2}{a_2-a_1}\\=&\frac{a_2-a_1a_3+0}{a_2-a_1}=a_3.\end{aligned}\]\qed\end{document}

While we're at writing := definitions...
Pascal, 90 88
program r;var a,b,c:integer;begin;read(a,b,c);c-=b;c:=c div(b-a);write(c,' ',b-c*a);end.

Cuda, 301
#include<stdio.h>
__global__ void r(int*q){if(!(blockIdx.x|threadIdx.x)){q[1]-=*q;q[1]/=(*q-q[2]);*q-=q[1]*q[2];}}
main(){int p[3],*q;scanf("%d%d%d",p+2,p,p+1);cudaMalloc(&q,24);cudaMemcpy(q,p,24,cudaMemcpyHostToDevice);r<<<1,1>>>(q);cudaMemcpy(p,q,24,cudaMemcpyDeviceToHost);printf("%d %d",p[1],*p);}

You can save two chars in the C solution by eliminating m and reusing c, and another two by using c-=b;c/=b-a; instead of c=(c-b)/(b-a);.

In the C solution, you don't need the spaces in the scanf() format string.

GolfScript, 16 characters
~1$- 1$3$-/.p@*-

Input is given as space-separated list.
JavaScript, 56 characters
p=prompt;x=alert;a=p();b=p();x(m=(p()-b)/(b-a));x(b-a*m)

Input is given on prompt.
Ruby, 44 characters
a,b,c=eval("[#{gets}]");m=c-b;p m/=b-a,b-m*a

Input is here given as comma-separated list.
Python, 40 characters
a,b,c=input();m=c-b;m/=b-a;print m,b-m*a

Input is again comma-separated.
Java, 141 characters
enum E{E;static int s(){return new java.util.Scanner(System.in).nextInt();}{int a=s(),b=s(),m=s()-b;m/=b-a;System.out.print(m+" "+(b-a*m));}}

Input separated by newline.
Lua, 51 characters
r=io.read
a,b=r(),r()
m=(r()-b)/(b-a)
print(m,b-m*a)

Input separated by newline.
Go, 101 characters
package main
import"fmt"
var a,b,c int
func main(){fmt.Scan(&a,&b,&c)
c-=b
c/=b-a
fmt.Print(c,b-a*c)}

Input separated by newline.
Fortran, 90 characters
      PROGRAM X
      READ(*,*)I,J,K
      K=(K-J)/(J-I)
      WRITE(*,*)K,J-I*K
      END

Input separated by newline.
Befunge, 29 characters
&01p&:11p:&-01g11g-/:.01g*-.@

PostScript, 61 characters
2 5 14
1 index sub 1 index 3 index sub idiv dup = 3 2 roll mul sub =

Owl, 23 characters
<%<%<$-1`4'-/%.32)2'*-.

Input separated by newline.
Element, 27 characters
_-a;_3:'-_+"a~+/2:`a~*+\ ``

Input separated by newline.

Shameless heist of my JavaScript solution ;)

Well two can play this game... :P

@mellamokb Nice one. But I did already upvote your answer ;-) So what's left for us: beat the 48 characters...

Done, now 47 characters :)

I might argue that your befunge solution requires another row at runtime, so should be 29x2. I;m also just jealous.

@CMP Ah, code-golf is bytes of source code ;-)

Wow, you golfed in my language. I feel honored. I also feel obligated to beat you. :)

About your Element solution, it appears that the last ` mark isn't needed. Is this an error on your part or an error in my interpreter that I posted on Pastebin? Oh, and I have a 27 character solution.

@PhiNotPi You were right. It was an issue with my script which piped the input directly into your interpreter (i.e. with no newlines appended). The interpreter then removes the last character and thus the last code character. I changed the chop to chomp and everything was fine then. Oh, and I also found a 27 character solution. I'm still figuring out how to golf in Element as this was the first time I used this language at all ;-)

I'm surprised that you have managed to learn the language so quickly! Here is my 27 character solution: _-2:''3:'-+""+/2:`"*+\ `` (I hope it displays properly) EDIT: It appears to be very similar to your solution, actually.

By the way, what is your opinion of Element as a language for golfing? I think that it is good with math, but not very good for complex string manipulation.

I also found that solution after posting mine. It endded is equivalent: first item on control stack corresponds to element a in the above version.

I agree. It takes several characters to do something like a simple split on an input string. And sometimes you have to work around the point that you can't simply swap top numbers on the stack.

You can swap the top two items on the stack with 0 1@ which moves the top item so that it is the second item (the stack is indexed starting on zero for the top item). This would be shorter with a single command, but the @ operation is more versatile in that it can move any item to anywhere in the stack.

Brainfuck - 174
,>,>,<[>->+>+<<<-]>>>[<<<+>>>-]<<<<[>>>->+<<<<-]>>>>[<<<<+>>>>-]<<[->-
[>+>>]>[+[-<+>]>+>>]<<<<<]>>>[<<<+>>>-]<[-]<[-]<.[>>+<<-]>>[<<<<[>>+>+
<<<-]>>>[<<<+>>>-]>-]<<[<->-]<.

Piet - 82?
Not sure how to measure competitive golf here. I'm gonna go with total image size (in codels) Mine is 41x2:

Befunge - 34
&00p&10p&10g-10g00g-/:.00g*10g\-.@

English - 278
The multiplier is the quotient of the difference of the second
and third values and the second and first values.
To generate a new term, multiply the current term by the multiplier
and add the difference of the first value and the product of the
multiplier and the second value.

Not sure if this counts, but thought I'd give it a shot. It is remarkably difficult to describe even a simple algorithm accurately. Kinda wish English supported some kind of grouping symbol to establish precedence.

Link me to an interpreter (a complete one that understands the entire language, and is not just geared towards solving this problem) and I may accept it.

ummm, http://www.worldinterpreting.com?

It's ok, another person has written a mathematical proof in LaTeX. It didn't count, but adds to the variety.

If I try out your Piet solution with npiet I get this result:
D:\Software\Programming\Piet\npiet-1.3a-win32>npiet series2.png
? 5
? -19
? 77
05
The solution should be -4 1

The image you posted does not work unless you grow it by one pixel (not codel!) at the right side. 461 pixels aren’t divisible by 11, which is a rather unusual codel size, by the way ;)

AWK, 35 characters
{m=($3-$2)/($2-$1);print m,$2-$1*m}

Input format: 2 0 -4

bc, 39 characters
define f(a,b,c){
m=(c-b)/(b-a)
m
b-a*m}

Input format: z=f(2, 0, -4)
The input is a bc expression. After bc reads the source file, it reads the standard input. This is why the input must look like a function call.
I use OpenBSD bc, which requires a newline after the {.

Common Lisp, 88 characters
(let*((a(read))(b(read))(c(read))(m(/(- c b)(- b a))))(format
t "~A ~A" m (- b(* a m))))

Input format: 2 0 -4

csh, 86 characters
set i=(`cat`)
@ m=($i[3] - $i[2]) / ($i[2] - $i[1])
@ n=$i[2] - $i[1] * $m
echo $m $n

Input format: 2 0 -4
The 86th character is newline at end of file. csh is the only language for which I count newline at end of file. This is because csh never runs the last command unless newline is there.
set i=($<) does not work, because $< has no word splitting.

dc, 30 characters
?scsbsalclb-lbla-/psmlblalm*-p

Input format: 2 0 _4, where _ is the underscore.

es, 95 characters
i=(`cat)
b=$i(2)
m=`{expr \( $i(3) - $b \) / \( $b - $i(1) \)}
echo $m `{expr $b - $i(1) \* $m}

Input format: 2 0 -4
es is the extensible shell by Paul Haahr and Byron Rakitzis.

Factor, 138 characters
USING: eval formatting io kernel locals math ;
contents eval( -- a b c ) [let :> ( a b c )
c b - b a - / dup a * b swap - "%d %d" printf ]

Input format: 2 0 -4

PicoLisp, 74 72 characters
(in()(let(r read a(r)b(r)c(r)m(/(- c b)(- b a)))(print
m (- b(* a m)))))

Input format: 2 0 -4
EDIT: Lost 2 characters by changing a(read)b(read)c(read) to r read a(r)b(r)c(r).

TI-83 BASIC, 63 61 characters
:Input A
:Input B
:Input C
:(C-B)/(B-A)→M
:Disp M
:Disp B-A*M

Input format: 2 ENTER 0 ENTER ¯4 ENTER, where ¯ is the calculator's unary minus.
I counted Unicode characters; → (the right arrow) counts as U+2192. For example, the calculator counts Input A as 2 characters, but I count Input A as 7 characters. I also count : as 1 character.
EDIT: I miscounted: there are 61, not 63, characters.

zsh, 62 characters
i=(`cat`)
((b=i[2],m=(i[3]-b)/(b-i[1]),n=b-i[1]*m))
echo $m $n

Input format: 2 0 -4

AWK (32)
{m=$3-$2;print m/=$2-$1,$2-$1*m}

Demo: http://ideone.com/kp0Dj

bash (38)
awk '{m=$3-$2;print m/=$2-$1,$2-$1*m}'

Demo: http://ideone.com/tzFi8

DOS/BATCH (54 55)
set/a m=(%3-%2)/(%2-%1)&set/a n=%2-%m%*%1&echo %m% %n%

Takes parameters as space-separated list of arguments.

Java (143 185)

enum R{R;{int a=0,b=0,c,i=2;for(;(c=new java.util.Scanner(System.in).nextInt()+b*--i)+i>=c;b=c)a+=c*i;c/=b-a;System.out.print(c+" "+(b-a*c));}}

JavaScript (48 61 67)
p=prompt;m=p(b=p(a=p()))-b;alert([m/=b-a,b-a*m])

Demo: http://jsfiddle.net/BT8bB/6/

PHP (61 77)
<?list(,$a,$b,$c)=$argv;$c-=$b;echo($c/=$b-$a).' '.$b-=$c*$a;

Demo: http://ideone.com/CEgke

QBasic (34)
INPUT a,b,c
m=(c-b)/(b-a)
?m;b-m*a

TI-83 Basic (25 41)
:Prompt A,B,C
:(C-B)/(B-A
:Disp Ans,B-AAns

Yes, the missing right parenthesis is on purpose.  It's a well-known optimization technique that closing the parentheses before a STO operation is not necessary in TI-83 Basic programming.

The JS one doesn't work for me in Firefox - I get an error that p is undefined. Does the JS spec say that function arguments should be evaluated before the function is resolved?

Hmm.  Yes you are correct.  According to the spec, it should not work, as explained in this similar SO question: http://stackoverflow.com/questions/9941736/why-javascript-doesnt-let-a-function-redefine-itself-from-within-itself.  The functions are supposed to be bound before their arguments are evaluated, and Chrome apparently does it in reverse order.

I've tried long and hard to beat the highest Java solution by a completely different approach you can see above.  143 is the closest I've been able to get.  Anyone have any ideas, please send my way!

Whitespace, 123

I/O is newline-separated. (To obtain the source code, enter edit mode and copy the whitespace between the preformat tags; or, see the online example at Ideone.)
Explanation, where S,T,L represents Space,Tab,Linefeed:
Pseudocode     Whitespace
----------     ----------
push 0         SS SSL
readn          TLTT
push 1         SS STL
readn          TLTT
push 2         SS STSL
dup            SLS
readn          TLTT
retr           TTT
push 1         SS STL
retr           TTT
-              TSST
push 1         SS STL
retr           TTT
push 0         SS SSL
retr           TTT
-              TSST
/              TSTS
dup            SLS
outn           TLST
push 10        SS STSTSL
outc           TLSS
push 0         SS SSL
retr           TTT
*              TSSL
push 1         SS STL
retr           TTT
swap           SLT
-              TSST
outn           TLST
exit           LLL

R, 50
x=scan(n=3);y=diff(x);z=y[2]/y[1];c(z,x[2]-x[1]*z)

I/O is space-separated.

Owl
---22---
< <%<-2`2`-/%.10)2'*-.

I/O is newline-separated.
---19--- (if this version is allowed; but I think it's cheating, since the \ is executable code):
1`-1`3`-/%.32)2'*-.

I/O is space-separated. Command-line usage: owl prog 5 19\ 77 (the \ acts as a postfix unary minus in Owl).

With your Owl entry, I can suspend judgement of your 19 char solution since your 22 char solution is already winning for the language.

J, 23 characters
(],1{x-0{x*])%~/2-/\x=:

Usage:
   (],1{x-0{x*])%~/2-/\x=: 5 _19 77
_4 1

Negative numbers are represented by underscores in J.
PHP, 88 characters
<?php
list($x,$y,$z)=split(' ',fgets(STDIN));
$a=($z-$y)/($y-$x);
echo$a." ".($y-$a*$x);

Scala, 102 characters
val x=readLine.split(" ").toList.map(_.toInt)
val a=(x(2)-x(1))/(x(1)-x(0))
print(a+" "+(x(1)-x(0)*a))

Perl, 57 characters
s!(.+) (.+) (.+)!$a=($3-$2)/($2-$1);$a." ".($2-$1*$a)!e

Requires the '-p' option, for which I have added 2 characters.
Assumes that the input is valid to save some characters.
All my answers take space separated numbers.

About J programs ... Is input allowed to be coded directly in the source file instead of prompting it from the user?

@r.e.s. I've given it just the way I would invoke it on the command line. Adding 1!:1]3on the right of the expression will read the input from STDIN. I think there has been discussion on meta or in comments to some J answers over whether this should be allowed or not. I'm somewhat ambivalent - I enjoy figuring out how to get J to do what I want in the smallest space, I'll take the 6 character penalty for input from STDIN if that's what everyone wants.

I was thinking that if it's allowed for J, then some other entries might be shortened in a similar way.  (BTW, I couldn't get your suggested expression to work, but (],1{x-0{x*])%~/2-/\x=:".1!:1]1 seems ok in console mode.)

@r.e.s. Oh yeah, I forgot to convert from a string to a list of numbers (though the 3 at the end normally works ok for me?)

If you make the Perl a subroutine rather than a full program, you can get it down to 50 bytes (and no command-line flags are necessary): ($a=($_[1]-pop)/($_[0]-$_[1])).$/.($_[1]-$_[0]*$a)

PHP, 74,72,69

<?fscanf(STDIN,'%d%d%d',$a,$b,$c);echo($d=($c-$b)/($b-$a)).' '.($b-$d*$a);

When input is passed as arguments:
<?echo($d=($argv[3]-$argv[2])/($b=$argv[2]-$a=$argv[1])).' '.($b-$d*$a);

Now, as @mellamokb suggested, using $n=$argv:
<?$n=$argv;echo($d=($n[3]-$n[2])/($b=$n[2]-$a=$n[1])).' '.($b-$d*$a);

C, 77,78

main(a,b,c,d){printf("%d %d",d=(c-b)/(b-a),b-d*a,scanf("%d%d%d",&a,&b,&c));}

^ doesn't work so, here's the stuff: [thanks to @ugoren for bringing it to notice]
main(a,b,c,d){printf("%d %d",d,b-a*(d=(c-b)/(b-a)),scanf("%d%d%d",&a,&b,&c));}

+1 Wow, didn't know you could fscanf and scanf without spaces. Awesome!

In your second PHP solution, couldn't you save a few more characters by renaming $argv, i.e., $n=$argv at the beginning?

@mellamokb- yeah! I didn't think about that! thanks! :)

Your C code doesn't work (I tried on Linux). I relies on a very strange parameter evaluation order - why would scanf be done first, then d=.. then b-d*a?

I test for only the 0 7 14 case. Will look into it now. And the scanf gets evaluated first, I tried putting the printf inside the scanf, but i got an ouput before I could give the input.

Now, the new one seems to work fine. I infer that the execution is done from right to left.

From what I can tell, this just arbitrarily "happens" to work in most environments (ex: http://ideone.com/I2cPg), but the order of parameter evaluation in C is undefined behavior, and so technically shouldn't be relied upon: http://orangejuiceliberationfront.com/funny-thing-about-c-parameter-evaluation-order/

DOS-BATCH, 98
@ECHO OFF&SET/P p=&SET/P q=&SET/P r=&SET/A m=(%r%-%q%)/(%q%-%p%)&SET/A n=%q%-%p%*%m%&ECHO %m% %n%

Input in separate lines
Bash, 51
m=$((($3 - $2)/($2 - $1)))
echo $m $(($2 - $m*$1))

Example : sh prog.sh 2 0 -4    (space separated arguments)
Perl, 84
@s=split(/ /,<STDIN>);$m=($s[2]-$s[1])/($s[1]-$s[0]);print $m." ".($s[1]-$s[0]*$m);

Java, 297
import java.util.*;public class A{public static void main(String a[]){StringTokenizer s=new StringTokenizer(new Scanner(System.in).nextLine());int i=4;int[] p=new int[i];while(i-->1)p[3-i]=Integer.parseInt(s.nextToken());p[3]=(p[2]-p[1])/(p[1]-p[0]);System.out.print(p[3]+" "+(p[1]-p[0]*p[3]));}}

Space separated input, space separated output.
SQL, 57
select (&3-&2)/(&2-&1),&2-((&3-&2)/(&2-&1)*&1) from dual

This is a sad entry, but 'just' solves the purpose.
The query binds input at runtime 1,2,3 are variables in order of input.

Even though others have already beat your bash solution, I just wanted to suggest you could have removed all those extra spaces and saved 6 characters.

Thanks mellamokb, I did realize that, I just sort of ignored it later. Also, I hate myself of not thinking your dos/batch solution, that should have clicked my head..args ahh!

bash (42 chars)
Pure bash:
((m=($3-$2)/($2-$1),c=$2-m*$1));echo $m $c

bash (31 chars)
Shelling out to something else:
owl -p"<%<%<$-1`4'-/%.32)2'*-."

(Based on Howard's OWL implementation)

VBA, 57 characters
Sub x(a,b,c)
y=(c-b)/(b-a)
MsgBox y & " " & b-a*y
End Sub

(This is basically the same as the other 'BASIC' functions, but I didn't see any VBA submissions out there already.)

You can drop 8 bytes by changing line 3 to Debug.?y;b-a*y

This is (non-optimized) code for the unimited register machine, described here:
http://www.proofwiki.org/wiki/Definition:Unlimited_Register_Machine
The input should be in register 1,2 and 3, and the output will be in register 1, 2 after the program is done. Non-negative and non-integer numbers are not handled,
but inputs 0,7,14 and 2,5,11 are handled correctly.

Zero[8]
Trans[2,11]
Jump[3,11,7]
Succ[11]
Succ[8]
Jump[11,11,3]
Zero[5]
Trans[1,12]
Jump[2,12,13]
Succ[12]
Succ[5]
Jump[12,12,9]
Zero[17]
Trans[8,13]
Jump[13,17,25]
Zero[16]
Trans[5,14]
Jump[13,14,22]
Succ[14]
Succ[16]
Jump[14,14,18]
Succ[9]
Trans[16,13]
Jump[17,17,15]
Zero[6]
Zero[20]
Jump[9,6,40]
Zero[7]
Trans[1,21]
Jump[20,7,36]
Succ[21]
Trans[21,19]
Trans[19,21]
Succ[7]
Jump[7,7,30]
Trans[21,18]
Trans[18,20]
Succ[6]
Jump[6,6,27]
Trans[20,4]
Zero[10]
Trans[4,15]
Jump[2,15,47]
Succ[15]
Succ[10]
Jump[15,15,43]
Trans[9,1]
Trans[10,2]

EDIT: by removing brackes, and shortening instruction names:
URM 285

Z8 T2,11 J3,11,7 S11 S8 J11,11,3 Z5 T1,12 J2,12,13 S12 S5 J12,12,9 Z17 T8,13 J13,17,25 Z16 T5,14 J13,14,22 S14 S16 J14,14,18 S9 T16,13 J17,17,15 Z6 Z20 J9,6,40 Z7 T1,21 J20,7,36 S21 T21,19 T19,21 S7 J7,7,30 T21,18 T18,20 S6 J6,6,27 T20,4 Z10 T4,15 J2,15,47 S15 S10 J15,15,43 T9,1 T10,2

(+1) But ... "Non-negative and non-integer numbers are not handled" ... I think you mean to say that negative numbers are not handled. (The OP says all input & output is integer.)

Ah, did not read that output was integer...

Should I count this by character count or by the number of instructions?

Maybe count the characters in the edited version...

Q, 36
{a,x[2]-x[1]*a:%[x[2]-x 1;x[1]-x 0]}

usage
q){a,x[2]-x[1]*a:%[x[2]-x 1;x[1]-x 0]}each(0 7 14;2 5 11;2 0 -4;5 -19 77)
1  7
2  1
2  -4
-4 1

Fortran 44
read*,i,j,k;k=(k-j)/(j-i);print*,k,j-i*k;end

Input will be in a single line (comma or space separated)
Cray Chapel 59
var i,j,k:int;read(i,j,k);k=(k-j)/(j-i);write(k," ",j-i*k);

Input will be on single line, no newline (add 2 chars for that by using writeln in place of write).
Golflua 44
r=I.r;a,b=r(),r();m=(r()-b)/(b-a);w(m,b-m*a)

Newline delimited input, space delimited output

Julia, 71 characters
Space delimited input and output.
i,j,k=int(split(readline(STDIN)));println("$(l=div(k-j,j-i)) $(j-i*l)")
Example input and output:
julia> i,j,k=int(split(readline(STDIN)));println("$(l=div(k-j,j-i)) $(j-i*l)")
5 -19 77
-4 1

Piet, 86 60 56 codels (14x4), codel size 10 for better visibility
I could actually shrink down the amount of codels by a whopping 35%.
I didn’t expect such a good outcome. Coding this program backwards was, as I expected, quite successful. I doubt it can be shorter than this, but I would be really interested if anyone could find a smaller solution.
The challenge does not state if the program has to stop after showing the result, so my smallest (56 codel) program should be valid. It just loops back to the beginning after showing the result, asking for a new triplet of integers. Due to the tight packing there is no place for the output of two newline characters, but that is no problem with the npiet interpreter, because it always prints a ‘?’ if it awaits input.
There are two possible sizes to build a looped version, but a version that runs only once is only possible in a program that’s at least 64 codels (16x4) big. The versions below show the reason. Maybe it’s also interesting for those who are familiar with Piet.
The final, most tightly packed 56 codel version, with a loop:

Second version (60 codels), with a loop

If the 56 codel version is against the rules, here is the final 64 codel version, running only once:

My first version (86 codels)

Input and output are newline delimited.
Example input and output:
D:\codegolf\npiet-1.3a-win32>npiet ml_series.png
? 5
? -19
? 77
-4
1

For looped versions, looking a bit uglier:
D:\codegolf\npiet-1.3a-win32>npiet ml_series_56_codels.png"
? 5
? -19
? 77
-4
1? 5
? -19
? 77
-4
1? 5
? -19
? 77
-4
1?

I chose newline as delimiter because coding ASCII 10 (\n) obviously needs only 7 codels, compared to ASCII 32 ( ) which needs 8 codels or even ASCII 40 (,) which needs 9 codels.
Coding backwards from the result to the first input is a great way to reduce the codel use for ROL operations. The stack order at the beginning and at the end are known, the rest is easily done by hand.
Here is a text version of the 64 codel program (with stack), in my made-up shorthand.
The shorter programs just don’t terminate but loop back to the beginning.
NOP ADD DIV GRT DUP INC END
 0   +   /   >   =   c   ~
PSH SUB MOD PTR ROL OUN
 X   -   %   #   @   N
POP MUL NOT SWI INN OUC
 ?   *   !   $   n   C

                   1
        1    1   2 2     1                   a,b,c: input for series
      5 5  3 3 c c cb  3 3                       D: c-b
    b b bb b bbb b bcD D Da                      E: b-a
   bb b bb b baa a aaa a abE F                   F: D/E, (c-b)/(b-a), mul. const.
  bbb b ba a abb b bbb b bDDFFF    5             G: a*F, a(c-b)/(b-a)
 aaaa a aa a aaa a aaa a aaaaaaG  55 10          H: b-G, b-a*F, add. const.
aaaaa a ab b bbb b bbb b bbbbbbbH HH  H H
n=n==5X1X@3X1X@n2X1X@-3X1X@-/=N*-5X=  + CN~
| |            |     |     || |||\____/ ||
| |            |     |     || |||  |    |+———— output add. const.
| |            |     |     || |||  |    +————— output newline character
| |            |     |     || |||  +—————————— 5 DUP + =10, ASCII for \n
| |            |     |     || ||+————————————— H, add. const.
| |            |     |     || |+—————————————— G
| |            |     |     || +——————————————— output mul. const.
| |            |     |     |+————————————————— F, mul. const.
| |            |     |     +—————————————————— E
| |            |     +———————————————————————— D
| |            +—————————————————————————————— input c
| +——————————————————————————————————————————— input b
+————————————————————————————————————————————— input a

MoonScript(48 chars, newline delimited input, space delimited output)
r=io.read
a,b=r!,r!
m=(r!-b)/(b-a)
print m,b-m*a

Felix(86 chars, newline delimited input, comma delimited output)
gen r()=>int $ readln stdin;
var a,b=r(),r();
var m=(r()-b)/(b- a);
println(m,b- m*a);

Julia(84 chars, space delimited input, space delimited output)
a,b,c=tuple(map(int,split(readline(STDIN)))...)
m=(c-b)/(b-a)
println("$m $(b-m*a)")

Your Julia solution throws an error.
ERROR: BoundsError()
in indexed_next at tuple.jl:19 (repeats 2 times)
while loading d:\codegolf\series.jl, in expression starting on line 1

@ML That's weird. Might be something that changed in the newest version of Julia. I'll try it.

If I try it out in the console I get the error immediately after the first line. Somehow the line creates a tuple, that’s always (a,b,0)
If I include it via a .jl file then it creates the output, but throws the error if I press enter to get the Julia REPL back.
julia> include("happy_birthday_codegolf.jl")
5 -19 77
-4 1
ERROR: BoundsError()
in indexed_next at tuple.jl:19 (repeats 2 times)
while loading d:\codegolf\series.jl, in expression starting on line 1
Is there any way to insert line breaks in comments? Sorry for the mess.

@ML Does putting it in a file and running it via julia file.jl give the same error?

I guess it’s not readable in my mess of an answer above. Yes, I tried both the console and including it via a .jl file. “If I include it via a .jl file then it creates the output, but throws the error if I press enter to get the Julia REPL back.” If I run your example via .jl file, then the program waits for some input before the julia> REPL/prompt comes back.

Funny, now it works. But it spits out two float values instead of integers. julia> include("series.jl") / 5 -19 77 / -4.0 1.0   How about using div(a,b) instead of a/b?

@ML I think at the time I wrote the program, Julia always used integer division. Maybe. I haven't been following the project too much lately.


text:
Shortest Hello World program with no semi colons
I recently saw some questions on SO that asked if you could make a Hello World program without using any semi colons using C#. The challenge is to do this again, but in the shortest  amount of code possible!

I assume this is meant to be a language-specific challenge?  Otherwise there are plenty of languages where this task would be trivial.  (For example, 'Hello World' is a valid GolfScript program that prints Hello World. Although HQ9+ will easily beat it.)

@llmari Sorry, yes, I have updated question. I would have tagged it C# but it doesn't exist and I don't have the rep to create it, thanks.

C#, 76
class X{static void Main(){if(System.Console.Write("Hello, World!")is X){}}}

I tried this in my VS2012 and it works just fine, even though it is quite a surprise that you can apply the is operator to void...

C# 85 chars
class H{static void Main(){if(System.Console.Out.WriteAsync("Hello, world!")is H){}}}

Which .NET version is this? .NET 4 doesn't seem to contain a definition for TextWriter.WriteAsync().

@primo .NET 4.5 does.

C# (114)
class M{static void Main(){if(typeof(System.Console).GetMethods()[78].Invoke(null,new[]{"Hello, world!"})is M){}}}

Note that the proper index for Write(string)/WriteLine(string) may be different on your system.  However, since there are only 106 methods total, I'm almost certain either Write(string) or WriteLine(string) will be a two-digit index number on every system, so the character count should be generally valid.
Demo: http://ideone.com/5npky (Write method is apparently index 23 here)

This solution is brilliant. +1

I also thought is was ironic that after putting it together, it came out exactly 1 character shorter than yours :)

Can save three characters by changing null to 0. Get a nice character count of 111 :)

115 Bytes
class H{static void Main(){if(((System.Action)(()=>System.Console.Write("Hello, world!"))).DynamicInvoke()is H){}}}

It's likely possible to produce something a bit shorter, but I'm pretty sure that you're going to need make some sort of asynchronous call.

C# 96 95 94 chars
A bit of a cheat, but works if you have IronRuby installed:
class P{static void Main(){if(IronRuby.Ruby.CreateEngine().Execute("puts'Hello World'")>1){}}}

You can save 1 char by replacing == with a one-character comparison operator.

@PeterTaylor I've updated the code. Thanks for this great suggestion!

I also removed the space between puts and the string. puts'Hello World' is valid ruby code