text:
Orthogonal Orientation
Task: Given an input consisting of exactly one of the characters <>^v, output a second input consisting of the printable ASCII characters (from space to tilde), oriented with the arrow.
Let's assume the second input to the program is ABC. This is what it should do:

Input >: print ABC.
Input <: print CBA.
Input ^: print C\nB\nA, or the input rotated -90°.
Input v: print A\nB\nC, or the input rotated 90°.

Test cases
input => \n output
---
">", "thanks!" =>
thanks!
---
"<", "Hello, World!" =>
!dlroW ,olleH
---
"^", "This is text." =>
.
t
x
e
t

s
i

s
i
h
T
---
"v", "Tokyo" =>
T
o
k
y
o
---
"<", ">>>" =>
>>>

This is a code-golf, so the shortest program in bytes wins.

Full code or function?

@AlexL. You can write either afaik

Is input all as one string OK? >ABC

@DigitalTrauma Yes, that's fine.

No, I'm implying that it doesn't matter. You have no test case for the > orientation.

MATL, 10 6 bytes
4 bytes saved thanks to Martin!
19\qX!

Try it online!
19\            % implicitly take input (a character) and compute mod-19 of its ASCII code
   q           % subtract 1. Gives 17, 2, 3, 4 for the characters '^<v>' respectively.
               % These numbers correspond to 1, 2, 3, 4 modulo 4, and so are the numbers
               % of 90-degree rotations required by each character
    X!         % implicitly take input (string). Rotate the computed number of times
               % in steps of 90 degrees. Implicitly display

Old version, without modulo operations: 10 bytes
'^<v>'=fX!

Try it online!
'^<v>'         % push string
      =        % implicitly take input (a char) and test for equality
       f       % find index of matching character
        X!     % implicitly take input (string). Rotate that number of times
               % in steps of 90 degrees. Implicitly display

Damn I was really proud of my 13 bytes, but needing 3 bytes for input and 6 for rotating... oh well... maybe you can also save something with the mod 11 trick (you'll have to rotate the other way round though).

@MartinBüttner Good idea! In my case (in yours?) I think mod 19 is better, because then subtracting 1 directly gives 1,2,3,4 (mod 4). Thanks for the tip!

4 bytes shorter, what on earth...

I am officially putting MATL on the "list of language that are insanely short."

Python 3, 64 51 48 bytes
Saved 6 bytes thanks to xnor.
Saved 7 bytes thanks to Lynn.
Saved 3 bytes thanks to DSM and Morgan from sopython.
lambda c,s:'\n'[c<'?':].join(s[::1|-(c in'<^')])

The function accepts one of the characters from <>^v as the first argument and the string that needs to be rotated as the second argument.

Here's a more readable version:
lambda c, s: ('\n' if c in '^v' else '').join(s[::-1 if c in'<^' else 1])

Welcome to PPCG! If it helps, you are allowed to take two separate inputs as well. (Me not knowing python, this is just a guess.)

Maybe s[1|-(c in'<^')] and sep='\n'*(c in'^v')

I think you could do the whole thing as a lambda if you use join with your sep rather than printing.

Why did you make it cw?

@CᴏɴᴏʀO'Bʀɪᴇɴ: Because why not? There's a big room for improvement, as demonstrated in comments above. I'm not willing to get reputation for implementing other people's suggestions (even if it's acceptable). Also, CW encourages edits.

I love this answer, this is my favourite answer.

Haskell, 57 bytes
f">"=id
f"<"=reverse
f"v"=init.((:"\n")=<<)
f _=f"<".f"v"

Usage example: f "v" "ABC" -> "A\nB\nC".
Direction > is the idendity function, < reverses it's argument, v appends a newline to each character in the string and drops the last one and ^ is v followed by <.

Japt, 9 bytes
VzUc %B+1

Inspired by @DonMuesli's answer, although I just noticed the CJam one uses exactly the same technique. Test it online!
How it works
           // Implicit: U = arrow char, V = text
  Uc %B    // Take the char code of U, mod 11.
           // This converts ">", "v", "<", and "^" to 7, 8, 5, and 6, respectively.
Vz     +1  // Add one and rotate V by 90° clockwise that many times.

o_o nice job! You outgolfed jolf by over 200% o_O

But I'm getting errors? Error: Japt.stdout must be sent to an HTMLElement etc.

@CᴏɴᴏʀO'Bʀɪᴇɴ Not sure why that happens, but it happens a lot >:( Reloading always fixes this for me.

Sure enough, the issue is fixed. I am impressed!

I knew those rotate functions would eventually be useful +1

Same here. Error, then it works

Pyth, 17 15
jWgz\^_W}z"<^"w

Try it here or run the Test Suite
2 bytes saved thanks to Jakube!
Alternatively using mod tricks:
@s_MBjBz)h%Cw11

Try it here.

CJam, 13 bytes
l(iB%{W%z}*N*

Input is the orientation character followed directly by the string to be rotated.
Test it here.
Explanation
Yay for modulo magic. Taking the four characters modulo 11 maps them to:
> 7
v 8
< 5
^ 6

These are all distinct modulo 4 and more importantly they are neatly increasing: 3, 0, 1, 2. That means we can just use the result of the mod 11 to determine how often to rotate (without needing an explicit mod 4, since four rotations are a no-op anyway). We'd normally have to offset these numbers by 1, such that > actually yields 8 and becomes a no-op, but the way I'm rotating them, actually reverses the string on the first application such that we always get one rotation for free.
l    e# Read input.
(i   e# Pull off the first character and convert to its character code.
B%   e# Modulo 11.
{    e# That many times...
 W%  e#   Reverse... on the first iteration this reverses the string. Afterwards
     e#   we'll have an Nx1 or 1xN grid of characters on the stack, where
     e#   this reverses the rows instead.
 z   e#   Transpose. On the first iteration, this simply wraps the string in
     e#   array, turning it into a grid without changing its orientation further
     e#   beyond the reversal that just happened. On subsequent iterations, a
     e#   transpose combined with reversing the rows rotates the grid 90 degrees
     e#   clockwise.
}*
N*   e# Join with linefeeds.

Julia, 51 bytes
f(d,s)=join(d∈"<^"?reverse(s):s,d∈"^v"?"\n":"")

This is a function that accepts a Char and a string and returns a string.
Let d be the character denoting the direction and s be the string. If d is left or up, we use the reverse of s, otherwise we use s as given. We construct a separator as the empty string if d is left or right, or a newline if d is up or down. The pass the string and the separator to join, which will insert the separator between each character of the string and return a string.
Verify all test cases online

JavaScript (ES6), 76 67 65 bytes
(a,b)=>(/v|>/.test(a)?[...b]:[...b].reverse()).join(a>`>`?`
`:``)

Port of @Alex A.'s Julia answer. Edit: Saved 9 bytes thanks to @ETHproductions. Saved two bytes separately thanks to @edc65.

/[v^]/.test(a) => 'Z'/.test(a)?[...b]:[...b].reverse())... should be 65

Bash + GNU Utilities, 67
(egrep -q '>|v'<<<$1&&cat||rev)|(egrep -q '<|>'<<<$1&&cat||fold -1)

I wouldn't have guessed you need a space after the -q's, but you do

Perl, 54 51 + 1 = 52 bytes
@.=<>=~/./g;@.=reverse@.if/[<^]/;$,=$/x/[v^]/;say@.

Requires the -n flag and the free -M5.010|-E. Takes input as the following: direction\nline:
$ perl -nE'@.=<>=~/./g;@.=reverse@.if/[<^]/;$,=$/x/[v^]/;say@.' <<< $'^\nhello'
o
l
l
e
h

I like that $/x/[v^]/ looks like a substitution.
How it works:
                                                    # -n read first line into $_
@.=<>=~/./g;                                        # Read next line and split
            @.=reverse@.if/[<^]/;                   # Reverse `@.` if matches
                                                    # `<` or `^`
                                 $,=                # An array will be concatena-
                                                    # ted with the value of
                                                    # `$,` when printed.
                                     $/             # Contains a newline
                                        /[v^]/      # boolean
                                       x            # "\n" x 1 -> "\n"
                                                    # "\n" x 0 -> ""
                                              say@. # Print the array

Retina, 60 bytes
Needs golfing...
$
¶
+`^([<^].*)(.)(¶.*)
$1$3$2
¶

.
$&¶
+`([<>].*)¶
$1
^.¶?

Input is all as one string, e.g. ^ABC.

If ^ or <, reverse the string
Insert newlines after every character
If < or >, remove the newlines

Try it online.

http://retina.tryitonline.net/#code=JArCtgorYF4oWzxeXS4qKSguKSjCti4qKQokMSQzJDIKwrYKCk0hYC4KK2AoWzw-XS4qKcK2CiQxCl4uwrY_Cg&input=XkFCQw saves a byte (and gets rid of the additional trailing linefeed)

PowerShell, 84 bytes
param([char]$a,$b)($b[($c=$b.length)..0],$b[0..$c])[$a%7-eq6]-join("","`n")[90-lt$a]

This is going to be complete gibberish to people not familiar with PowerShell. Let's go through it.
Takes input param([char]$a,$b), with an explicit cast to character for $a. The rest of the program is one statement. We'll start with the first half, up to the -join.
We're creating a new dynamic array (...,...) and indexing into it with $a%7-eq6. The ASCII values for v and > are 116 and 62, respectively, and 116%7 = 62%7 = 6, and those are the two directions that "increase" down and to the right. So, if that -eq is $true, we'll take the second value, which is $b[0..$c], or an array of the characters of $b up to the end. We get the value $c from the first value, $b[($c=$b.length)..0], which gets selected if the input char is ^ or < (i.e., so it goes through the string backwards). Important to note is that even if the second value is selected, the $c value is still calculated and stored, so we can re-use it as a shortcut like this.
So, we've now got an array of characters either going forwards or backwards. We then -join those characters together with the result of another dynamic array index. This time we're selecting based on whether the ASCII value for $a is below 90 (really lots of values would work, I selected this one just because). Since > and < both have a value below 90, the -lt is $false, so we select the empty string "", and thus the char-array is simply concatenated. Otherwise, we select the newline character "`n" to join the char-array together with newlines.
This resultant string is left on the pipeline, and output is implicit.
Example
PS C:\Tools\Scripts\golfing> .\orthogonal-orientation.ps1 "^" "TimmyD"
D
y
m
m
i
T

Dyalog APL, 15 bytes
⌽∘⍉⍣(11|⎕UCS⍞)⍪

⍪ make string into 1-column table
⍣(…) repeat (n) times
⍞ get string input
⎕UCS convert to UCS code point
11| division rest when divided by 11
⌽∘⍉ rotate -90° (flip-transpose)
Alternate method (same length):
⌽∘⍉⍣('<^>v'⍳⎕)⍪

⎕ get evaluated input (so one must input, e.g. '^' or the name of a program/variable that returns the desired character)
'<^>v'⍳ index into the string

C, 123 119 117 114 bytes
Golfed:
f(char*d,char*a){char*b=a,c=*d%21,s[3]={0,c&8?10:0};while(*++b);while(*s=c&4?*a++:*--b)printf(s);if(c&16)puts(b);}

Test program, with explanations & somewhat ungolfed code:
#include <stdio.h>
#include <stdlib.h>

// c     c%21
// <    10010     => if(c&8), vertical; if(c&16), horizontal
// >    10100     => if(c&4), backwards
// ^    01010
// v    01101
int f(char*d,char*a){
    char *b=a,c=*d%21,s[3]={0,c&8?10:0};
    while(*++b);     // b = a + strlen(a) - 1; this is shorter
    while(*s=c&4?*a++:*--b)printf(s);
    if(c&16)puts(b); // single trailing newline if horizontal
}

int main() {
    char *c="<>^v";
    for(;*c;c++) {
        printf("--- %c ---\n", *c);
        f(c,"hello world!");
    }
    return 0;
}

Tips welcome!

106 bytes

Japt, 7 bytes
zVc %BÄ

Try it here

How? Does Japt have some kind of rotation builtin?

@emanresuA, yep, that's the z method here; rotates a string 90°*[argument].

JavaScript ES6, 91 83 84 bytes
(a,b)=>[b,(c=[...b].reverse()).join``,[...b].join`
`,c.join`
`]["><v^".indexOf(a)]

Constructs the necessary strings and obtains the index of which a lies in. indexOf is used because ^ is a regex token. Thanks to ETHproductions for the bug fix and shaved bytes!

f("v","abc") returns c\nb\na for me.

Here's an 84-byte one that works for me: (a,b)=>[b,(c=[...b].reverse()).join``,[...b].join`\n`,c.join`\n`]["><v^".indexOf(a)]

@ETHproductions Thanks! I forgot c is literally d.

Out of interest I tried indexing an object... and it turned out to be exactly the same length!

Jolf, 22 bytes
Try it here! You should replace ƒ with \x9f. Takes the sting, then the directional character.
.‘I_IγƒGIE_γ’ i"><v^"i
 ‘                      golfy array
  I                     the input
   _I                   input reversed
      ƒGIE              split by "" and join by newlines
     γ                  γ = that
          _γ            gamma reversed
.            _i"><v^"i  get the respective index

D, 198 bytes
import std.stdio,std.array,std.algorithm;void main(string[]a){auto x=a[2].split("");char[]y;if(canFind(["^","<"],a[1]))x.reverse;if(canFind(["v","^"],a[1]))y=x.join("\n");else y=x.join("");y.write;}

:c

Less golfed:
import std.stdio;
import std.array;
import std.algorithm;

void main(string[]a) {

  auto x=a[2].split("");
  string y;

  if(canFind(["^","<"],a[1]))
    x.reverse;

  if(canFind(["v","^"], a[1]))
    y=join(x,"\n");

  else
    y=join(x,"");

  y.write;
}

Perl 5, 67 bytes
66 plus one for -p
$_=reverse if/^[<^]/;$&?s/.$//:s/.//;$&=~/[v^]/&&s/(.)(?=.)/$1\n/g

The input is a single string whose first character defines the orientation.

JavaScript (ES6) 71
(a,b)=>([...b].map(c=>(a>'A'?c+=`
`:0,r=/v|>/.test(a)?r+c:c+r),r=''),r)

Test

F=(a,b)=>([...b].map(c=>(a>'A'?c+=`
`:0,r=/v|>/.test(a)?r+c:c+r),r=''),r)

console.log=x=>O.textContent+=x+'\n';

for(d of '<>^v') console.log(d+'\n'+F(d,'ABCDE')+'\n')

DUP, 48 bytes
[`5/%$$a:4<&[1$][1_]?\1-[$;$][,^+a;2>['
,][]?]#]

Try it here.
Anonymous lambda that takes both argument and STDIN input. Usage:
0"asdf"[`5/%$$a:4<&[1$][1_]?\1-[$;$][,^+a;2>['
,][]?]#]! {make sure to put one of <>^v in STDIN}

Explanation
[                                               ] {lambda}
 `5/%$$a:                                         {store STDIN char (mod 5) to a}
         4<&                                      {is 0<a<4?}
            [  ][  ]?                             {conditional}
             1$                                     {if so, push 2 1's}
                 1_                                 {otherwise, push -1}
                                                    {determines whether to output in reverse or not}
                     \1-                          {swap, -1}
                        [   ][                ]#  {while loop}
                         $;$                        {if there is a char at index}
                              ,                     {output that char}
                               ^+                   {increment/decrement index}
                                 a;2>               {check if a>2}
                                     [    ][]?      {conditional}
                                      '\n,          {if so, output newline}

Seriously, 41 bytes
,' 9uc#;+"? R #'{}j #R'{}j"fs,"><v^"í@E£ƒ

Takes the string as the first input and the direction (><v^) as the second input.
Try it online!

Vyxal, 16 bytes
C:½›₃[√⌈₂ßṘ⁋|₃ßṘ

Try it Online!
C:               # Get charcode, dupe for later use
  ½›₃[           # If C/2 + 1 %  3 == 0 (`^v`)...
      √⌈₂        # Is ceil(√C) is even?
         ßṘ      # If so, reverse
           ⁋     # Join by newlines
            |    # Else...
             ₃   # Is C divisible by 3?
              ßṘ # If so, reverse

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:
Chain words crossword-style
The challenge
Given a list of words ["Programming", "Puzzles", "Code", "Golf"] output the words crossword-style:

      P r o g r a m m i n g
      u
      z
      z
  G   l
C o d e
  l   s
  f

The Algorithm

You have to process the list in the given order.
The words are printed in alternating orientations, starting horizontally.
The two words intersect at the first letter in the first word which is also present in the second word. If this letter occurs multiple times in the seond word, take the first one.
Example:
["no", "on"] becomes:
o
n o

and not
n o
  n

Additional notes

Adjacent words in the list will have at least one common letter. ["Hi", "there"] is not a valid input.
Words will never collide. There will always be enough space to print the a word at the first possible intersection. ["Hello", "there", "end", "hello"] is not a valid input
The matching is case-sensitive.
Words can expand to the left and to the top.
The letters of the horizontal words have to be separated by one space.
The input list will contain at least two words.
All words will match the regex: [A-Za-z]+
You may print as many trailing whitespaces or newlines as you want, as long as the words are correctly chained.
On the other hand you may not add additional leading whitespaces. The word which floats to the left the most has zero leading spaces, the other lines have so many leading spaces that it all lines up correctly.
You program has to be able to deal with an arbitrary amount of words

Rules

Function or full program allowed.
Default rules for input/output.
Standard loopholes apply.
This is code-golf, so lowest byte-count wins. Tiebreaker is earlier submission.

Test cases
Input list on the first line, output starts on the second line.

["Stack", "Exchange"]
    E
    x
    c
    h
S t a c k
    n
    g
    e

["This", "site", "graduated", "finally"]
    f
    i       s
    n   T h i s
g r a d u a t e d
    l       e
    l
    y

Happy Coding!

Example 2, the first possible intersection between site and graduated is t

@edc65 Shame on me, fixed it. Thanks for the hint!

JavaScript (ES6) 253
As an anonymous function with an array parameter
z=>(z.map((w,i)=>(i&&[...p].some((c,j)=>~(k=w.search(c))?i&1?[y-=k,x+=j]:[y+=j,x-=k]:0),[p=w,x<t?t=x:x,y{x-=t,y-=u;for(c of w)(o[y]=o[y]||[])[x]=c,i&1?y++:x++},o=[]),o.map(r=>[...r].map(x=>x||' ').join` `).join`
`)

F=z=>(z.map((w,i)=>(i&&[...p].some((c,j)=>~(k=w.search(c))?i&1?[y-=k,x+=j]:[y+=j,x-=k]:0),[p=w,x<t?t=x:x,y{x-=t,y-=u;for(c of w)(o[y]=o[y]||[])[x]=c,i&1?y++:x++},o=[]),o.map(r=>[...r].map(x=>x||' ').join` `).join`
`)

// Less golfed
F=z=>(
  z.map( // Step 1, find intersection points and relative position
    (w,i)=>(
      i && // for each word after thw first, find position respect the previous word
      [...p].some((c,j)=> // scan prec word using .some to exit at the first intersection found
         ~(k=w.search(c)) // search current char of p inside w
         ?i&1 // calc position, odd is vertical, even is horizontal
           ?[y-=k, x+=j] // returning an array so to have a truthy value
           :[y+=j, x-=k] // returning an array so to have a truthy value
         :0 // false = not found, continue the scan
      ),
      [p=w, // set preceding word
       x<t?t=x:x, // keep trace of min x
       y{ // Step 2, put char into the output array
      x-=t,y-=u; // normalize position respect to min values
      for(c of w) // for each char in word, set in the output array at the right place
        (o[y]=o[y]||[])[x]=c,
        i&1?y++:x++ // increment x or y, again odd is vertical, even is horizontal
    }, o=[] // initialization of output array
  ),
  // Step 3, add the missing spaces and newlines
  o.map(r=>[...r].map(x=>x||' ').join` `).join`\n`
)

O.textContent=F(["This", "site", "graduated", "finally"])

ANSI C, 385 390 Characters
int N,a=1,x,y,d=1,u,k,l;int main(int c,char**v){for(;a<c;)N+=strlen(v[a++]);int H=N*2,W=N*4,m=H,n=N,q=m,w=n;char*p,F[W][H],*o;memset(F,32,W*H);for(a=1;a<c;a++){q=(x=m)<q?m:q;w=(y=n)<w?n:w;m=-1;for(p=v[a];*p;p++){F[x][y]=*p;if(m<0&&a<c-1&&(o=strchr(v[a+1],*p))){u=o-v[a+1];m=d?x:x-u*2;n=d?y-u:y;}if(d)x+=2;else y++;}d=!d;}for(l=w;l<H;l++){for(k=q;k<W;)putchar(F[k++][l]);putchar(10);}}

Call it like this: ./crossword This site graduated finally
Ungolfed version:
int N,a=1,x,y,d=1,u,k,l;
int main(int c, char **v) {
    for(;a<c;)
        N+=strlen(v[a++]);
    int H = N*2, W = N*4, m = H, n = N, q=m, w=n;
    char *p,F[W][H], *o;
    memset(F, 32, W*H);
    for (a=1; a < c; a++) {
        q=(x=m)<q?m:q;
        w=(y=n)<w?n:w;
        m=-1;
        for (p=v[a]; *p; p++) {
            F[x][y] = *p;
            if (m<0&&a<c-1&&(o = strchr(v[a+1], *p))) {
                u = o-v[a+1];
                m = d ? x : x-u*2;
                n = d ? y-u : y;
            }
            if (d) x+=2; else y++;
        }
        d=!d;
    }
    for (l = w; l < H; l++) {
        for (k = q; k < W;)
            putchar(F[k++][l]);
        putchar(10);
    }
}

Thank you tucuxi for the tips!

one char: a++)N+=strlen(v[a]) => )N+=strlen(v[a++])

another: char F[W][H],*p => char*p,F[W][H]

3 chars: remove {} from single-line for, replace k++)putchar(F[k][l] with )putchar[k++][l]

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


text:
Tips for golfing in D2
What general tips do you have for golfing in D? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to D (e.g. "remove comments" is not an answer). Please post one tip per answer.

Look, no parens!
D's functions and template functions can be called as values, methods (won't help), and properties.
I can't believe no one has said this yet. I'll list the ones that save bytes:

fun() and fun!()() shorten to fun (assuming there is no variable fun).
fun(par) shortens to par.fun (assuming par has no property/method fun, as well as par not being an expression like 5+2).
fun!(T)() shortens to fun!T
fun!(T)(par) shortens to par.fun!T (assuming par has no property/method fun)

And with objects:

new cls() shortens to new cls (More JavaScript anyone?)
obj.fun() and obj.fun!()() shorten to obj.fun
obj.fun!(T)() shortens to obj.fun!T

One final thing, use old versions. It allows you to use deprecated features that shorten your code. That said, best advice: D isn't good for code-golf. It is a great language, just not for code-golf.

Accepting for now :)

Yeah, good to know there's still fans of D here.

D is JavaScript.

Obviously not. But, when dealing  with float, double and real, nan is a value which must be handled, and, as specified by IEEE 754, NaN does not compare equal with itself.
writeln(double.nan == double.nan); // false

Meaning,
writeln(value!=value); // only true for nan

is way shorter than
import std.math;
writeln(isNaN(value));

Obviously, always use math.isNaN for real code. ;)

D has type inference and an auto keyword. If the object is not int, then auto is probably shorter.

Does auto work when building an associative array with the KeyType[ValueType] syntax?

@AlexA. auto asd = ["a":1, "b": 2]; works, but since KeyType[ValueType] would go in the place of the auto keyword, I don't know if that will always work with types for which literals can't be constructed

@AlexA. auto arr = ["a": true, "b": 6]; works, the keys and values must be of compatible types

If the question requires a full program, the module declaration is surprisingly unnecessary.
*cough* Java, anyone? *clears throat* Actually, D's module system is older than Java's.

D is great at method chaining, but:
str.toLower.strip().split("").sort();

is the same as
sort(split(strip(str.toLower),""));

and usually the non-chained one is shorter, which I just realised, which lets me shorten my answer to Manage Trash So :D

It's those dots

D, as a multiparadigm (Object Functional) systems programming language, seems to embrace TIMTOWTDI, or There Is More Than One Way To Do It.
Case in point, writing the program's argv:
import std.stdio, std.array, std.algorithm;

void main(string[] args) {
    for(int i=0;i<args.length;writeln(args[i++])){};

    foreach(a;args)writeln(a);

    each!writeln(args);
}

Note the C-style for-loop requires {} as the empty block and will not accept a semicolon or nothing as a blank statement, in this case. Usually,  or ; are no-ops.

Can you use char* in place of string to save a byte?

@AlexA. function D main parameters must be main() or main(string[] args) moreover, char is literally one character, char* is a pointer to literally one character and char[] is an array of character literals (strings are different). D != C || C++

OIC. Never used D, just guessing.

D has a few types of C#-style lambda expressions, which can be assigned and stand alone:
(int a,int b)=>a*b;

auto a=(int a,int b)=>a*b;

However, unlike C#, the signature's types are still needed because D doesn't have Haskell-level type inferencing.
https://dlang.org/spec/expression.html#Lambda

Function templates for golfing the types? T f(T)(T a,T b){return a + b} should infer T as int in f(5);

@fedes. Hello, friend! Yes, you are exactly correct (but I think/hope "untyped" lambdas will be shorter than typed function expressions).

Ah, ofc! When I decide to take yet another look on D, who do I find? :D I objectively declare you have good taste on languages

@fedes. Aw, why thank you! :P that implies you do too (but I haven't spent enough time in front of Smalltalk, yet anyways :) )

Like C/C++, main can be int or void, but void main(){} will always be shorter than int main(){return my_func_returning_int;}.

If the question ask to output an integer wouldn't int main(){return output} be shorter?

@dev-null if the question asks for a full program writing an integer to stdout then import std.stdio;void main(){write(7);} is what's needed. I doubt a question would mandate the program return a number because many languages can't set return codes

@dev-null however, yes, in that case that it should not be written to stdout but returned, it would be shorter

Usually you are allowed to return / output the most convenient way for your language. But I guess D only support exit codes from 0-255?

@dev-null actually, POSIX only supports exit codes up to 255. I don't know about Windows, but on Unix / Linux an exit code over 255 wraps around, because of overflow.

Calling a function on an object with no other arguments
reverse(x);

can nearly always be shortened to
x.reverse;

to shave a byte or more.
This is because the . makes the LHS an implicit first argument, and templating lets us choose the right function for the args.

Dots are good? This is confusing...

@CatsAreFluffy when there are no args. When there's another argument, the x.reverse(y, z) is longer because of the dot

x.reverse(y,z) and reverse(x,y,z) have the same byte count.

@ZacharyT Uh, yeah...

Were you comparing x.reverse(y, z) to x.reverse?

@ZacharyT I believe I was comparing counting sheep to a lack of coffee -- that is, it was probably me not thinking properly ;)


text:
Which dominoes are missing?
A standard domino set has 28 unique pieces:

Given a list of 28 or fewer unique dominoes, output the list required to make a complete set.
Input and output dominoes are specified by two digits - the number of pips on each side of the domino, e.g. 00, 34, 40, 66.
The digits may be given in any order, so 34 is the same domino as 43
Example Inputs
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66
00 10 11 20 21 22 30 31 32 33 40 41 42 43 44 50 51 52 53 54 55 60 61 62 63 64 65 66
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 34 35 36 44 45 46 55 56 66
00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66
<empty list>

Corresponding Example Outputs
<empty list>
<empty list>
33
01 12 23 34 45 56
00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66

What input formats are allowed? Lists of strings? Lists of lists of integers?

@Martin I was assuming we have a meta consensus somewhere along the lines of "whatever list, array, set, collection, vector, matrix,... Is appropriate for your language.  Members may be numbers or strings"

Does that mean that we can request each domino as a pair of integers, for example 03 16 = [0, 3], [1, 6]?

@FlipTack Yes, of course

CJam, 11 bytes
{:$7Ym*:$^}

An unnamed block (function) with I/O as a list of pairs of integers.
Test it here.
Explanation
:$   e# Sort each pair in the input.
7Ym* e# Get all pairs with elements in range [0 .. 6] using a Cartesian product.
:$   e# Sort each pair.
^    e# Symmetric set-difference. This will remove all pairs that are in the input
     e# and also remove duplicates, because it's a set operation.

Why do you need the {} brackets?

Pyth, 12 10 bytes
-.CU7 2SMQ

Input and output in format [[0, 0], [0, 1], ...].
   U7       generate range [0, 1, ..., 6]
 .C   2     all combinations-with-replacement of 2, generates [[0,0],[0,1],...]
         Q  get the input
       SM   sort each domino (turns ex. [1,0] into [0,1])
-           remove the map-sort'd input from the full array

Try it here.
Thanks to @MartinBüttner for saving 2 bytes with a different input/output format!

JavaScript (ES7 proposed), 80 76 bytes
s=>[for(n of d="0123456")for(o of d.slice(n))if(s.search(n+o+'|'+o+n)<0)n+o]

Takes input as a space-separated string and returns an array of strings. Array comprehensions really pull their weight for this one.

Ruby 74 bytes
->b{a=(0..27).map{|i|"%d%d"%[i%7,(i+i/7)%7]}
b.map{|e|a-=[e,e.reverse]}
a}

Takes an array of strings, returns an array of strings.
Commented in test program
f=->b{a=(0..27).map{|i|"%d%d"%[i%7,(i+i/7)%7]} #generate complete set of dominos (each domino once) and store in a
b.map{|e|a-=[e,e.reverse]}                     #remove provided dominos (check both forward and reverse representations)
a}                                             #return a

p f[%w{00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 33 34 35 36 44 45 46 55 56 66}]
p f[%w{00 10 11 20 21 22 30 31 32 33 40 41 42 43 44 50 51 52 53 54 55 60 61 62 63 64 65 66}]
p f[%w{00 01 02 03 04 05 06 11 12 13 14 15 16 22 23 24 25 26 34 35 36 44 45 46 55 56 66}]
p f[%w{00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66}]
p f[[]]

Output
[]
[]
["33"]
["01", "12", "23", "34", "45", "56"]
["00", "11", "22", "33", "44", "55", "66", "01", "12", "23", "34", "45", "56", "60", "02", "13", "24", "35", "46", "50", "61", "03", "14", "25","36", "40", "51", "62"]

In the last example (input empty list) note the order of generation of the complete list of dominoes using modular arithmetic. 7 Doubles are generated first, then 7 dominoes with a difference of 1 (or 6) pips between each side, then 7 dominoes with a difference of 2 (or 5) pips, and finally 7 dominoes with a difference of 3 (or 4) pips.

Julia 0.6, 47 bytes
A->setdiff([[i,j]for i=0:6 for j=i:6],sort.(A))

Try it online!
(Corrected range start thanks to JayCe.)

48 bytes
A->[(i,j)for i=0:6 for j=i:6 if[i,j]∉sort.(A)]

Try it online!

I think the  zero dominoes seem to be missing from your 3rd TIO test case. For i=0:6 maybe ?

That's what I get from trying to post half asleep at 3AM! Yep, fixed now (hopefully), thanks.

Perl, 48 + 1 = 49 bytes
for$=(0..6){for$.($=..6){/$=$.|$.$=/||say$=.$.}}

Requires the -n flag, and the free -M5.010|-E:
$ perl -nE'for$=(0..6){for$.($=..6){/$=$.|$.$=/||say$=.$.}}' <<< '00 02 03 04 05 06 11 13 14 15 16 22 24 25 26 33 35 36 44 46 55 66'
01
12
23
34
45
56

Pretty boring answer overall, but here goes with an ungolfed version:
# '-n' auto reads first line into `$_`:
# $_ = <>;
foreach $a (0..6) {
  foreach $b ($a..6) {
    say $a . $b unless $_ =~ /$a$b|$b$a/;
  }
}

Python 2, 91 bytes
lambda A,S="0123456":sum([[i+j for j in S[int(i):]if(i+j in A)+(j+i in A)<1]for i in S],[])

Try it online!

JavaScript (SpiderMonkey), 69 bytes
s=>[for(n of d="0123456")for(o of d)if(n<o<!s.match(n+o+'|'+o+n))n+o]

Try it online!
optimized from Neil's

R, 111 bytes
function(s,p=paste0,L=lapply)setdiff(p(sequence(1:7)-1,rep(0:6,t=1:7)),L(L(strsplit(s,''),sort),p,collapse=''))

Try it online!
Not really proud of this, but R is not very "golfy" in splitting/concatenating strings...

05AB1E, 12 11 bytes
6Ýã€{JI€{KÙ

-1 byte thanks to @Emigna.
Try it online.
Explanation:
6Ý         # [0,1,2,3,4,5,6]
  ã        # Duplicate and take the cartesian product (pair up each)
   €{      # Sort each pair
     J     # Join them together to strings
I€{        # Sort each pair-string of the input
K          # Remove all pairs from the input from the cartesian list
Ù          # Only leave unique values

Mathematica, 49 bytes
Complement[Join@@Table[{x,y},{x,0,6},{y,0,6}],#]&

Input is list of list of integers.

Fails on the last test case; remember, these are unordered sets.

I would agree with @LegionMammal978; this answer appears to be invalid.

Java 8, 105 bytes
A void lambda accepting a mutable java.util.Set<String>.
s->{for(int i=0,a,b;i<49;)if(s.add(""+(a=i/7)+(b=i++%7))&(s.add(""+b+a)|a==b))System.out.print(" "+a+b);}

Try It Online
Ungolfed
s -> {
    for (int i = 0, a, b; i < 49;)
        if (
            s.add("" + (a = i / 7) + (b = i++ % 7))
            & (
                s.add("" + b + a)
                | a == b
            )
        )
            System.out.print(" " + a + b);
}

Acknowledgments

-1 byte thanks to Jonathan Frech

int i=0,a,b;while(i<49 can be for(int i=0,a,b;i<49;.

Jelly, 8 bytes
Ṣ€7ḶŒċ¤ḟ

Try it online!
Argument is a list of length-2 lists of integers. The footer transforms the input from the format in the test cases to the format this solution accepts.

J, 26, 24 bytes
-2 bytes thanks to FrownyFrog
(;(,.i.,])&.>i.7)-.\:~"1

(;(,.i.,])&.>i.7) calculates the full set (this part could be golfed further, I believe.  And please do if you see how...)
-. is "set minus"
/:~"1 orders each of the inputs

Try it online!
Original
Try it online!
((#~<:/"1)>,{;~i.7)-./:~"1

(;(,.i.,])&.>i.7) saves 2 (reverses the order)

@FrownyFrog thanks, updated.

Python 2, 89 86 bytes
Saved a few bytes by simplifying domino set generation.
lambda z,s="0123456":{x+y for x in s for y in s[int(x):]}-{(a+b,b+a)[a>b]for a,b in z}

Try it online!
Takes a list of strings like ["00", "10", "02] as an argument for the dominoes. Returns python set objects, which are unordered distinct lists.
Explanation
# anonymous function, s should always have its default value
lambda z,s="0123456":
                     # contents are a set
                     {                                  }
                          # iterate over characters in string
                          for x in s
                                     # for each x, iterate over x from index of current item forward
                                     for y in s[int(x):]
                     # add characters together for domino string
                     x+y
                                                         # contents are a set, return the difference between these two sets
                                                         -{                          }
                                                             # iterate over items in input list, split strings into two characters
                                                                         for a,b in z
                                                             # sort strings in input list (so that i.e. "10" => "01")
                                                             # essentially, "ab" if a<b, otherwise "ba"
                                                             (a+b,b+a)[a>b]

Haskell, 65 bytes
f x=[[a,b]|a<-"0123456",b<-[a..'6'],notElem[a,b]x&&notElem[b,a]x]

Usage example:
*Main> f ["00","02","03","04","05","06","11","13","14","15","16","22","24","25","26","33","35","36","44","46","55","66"]
["01","12","23","34","45","56"]

Iterate a in an outer loop over all digits from 0 to 6 and b in an inner loop over all digits from a to 6 and keep those ab where neither ab nor ba are found in the input string.

Seriously, 16 bytes
,`S`M7r;∙`εjS`M-

Takes input as a list of strings, outputs a list of strings
Try it online!
Explanation:
,`S`M7r;∙`εjS`M-
,`S`M             map: sort each input string
     7r;∙         cartesian product of range(0,7) ([0,1,2,3,4,5,6]) with itself
         `εjS`M   map: join on empty string, sort (results in all valid dominoes with some duplicates)
               -  set difference (all values present in valid dominoes set not present in input, with duplicates removed)

Actually, 13 bytes (non-competing)
♂S7r;∙`εjS`M-

This is identical to the Seriously answer (with the exception of implicit input and ♂S being a shorter way to short each input string).
Try it online!

You have duplicates in the output

@DigitalTrauma This is due to backwards-incompatible changes made since the time of posting.

racket
(define (missing-dominoes input)
  (filter
   (lambda (n)
     (not (member n (map
                     (lambda (n)
                       (let ((x (quotient n 10)) (y (remainder n 10)))
                         (if (<= x y) n (+ (* y 10) x))))
                     input))))
   (for*/list ([i (in-range 7)] [j (in-range i 7)])
     (+ (* 10 i) j))))

Nice to see people golfing in racket! This is a code-golf question so you probably ought to include your bytecount in your answer.  You could also definitely remove quite a bit of whitespace from this answer.

I would agree with @WW in that this answer does not seem to be sufficiently golfed to be valid.


text:
A little bool magic
Challenge
Given the following C# method:
private static bool Test(bool a, bool b)
{
    if (a && b) return false;
    if (a) if (b) return true;
    return false;
}

Supply the values a and b so that true is returned.
Winning condition
The first entry who can supply the correct arguments to make the given method evaluate to true wins.

Welcome to PPCG! All challenges here need an objective winning criterion such that a winner can be chosen if there are multiple submissions. It seems there might only be a single solution here, so this challenge might not be a good fit for PPCG. For future challenges let me recommend the sandbox where you can get feedback before the challenge goes live.

(That said, I am intrigued by this puzzle, it's just that normally there should be multiple possible solutions to a challenge for it to make sense around here.)

@MartinBüttner My bad sorry. But why can't there be only one solution? Its a puzzle and not a code-golf challenge.

Meta discussion is split on whether programming puzzles without additional win criteria are on topic, with conflicting answers being upvoted. I'd rather keep questions open when it's unsettled, so I'm voting to reopen. If you have opinions, please contribute them to the discussion.

Ah well, programming puzzles have a bit of a weird place in this community, despite being in the name (and it's been suggested several times to remove it there). The main problem is that only very few puzzles fit the spirit of the site. In any case, whether there is only one solution or not, this needs an objective winning criterion in case someone does find a second one.

@xnor Thanks for the reminder. I guess I'll reopen and let the community decide then.

@MartinBüttner Added a winning condition to my puzzle.

@MartinBüttner I don't know about this one. One can just execute this code 4 times and "brute force" the solution. I am generall open for this kind of challenge, but this one is way too trivial imo.

@DenkerAffe I don't think any of the four obvious parameter combinations work.

@DenkerAffe You can try the 4 common bool combinations but you will only end up with false

assuming there is a valid answer, this is an excellent question, regardless of whether it fits what we normally consider on topic.+1. I think one of the reasons we don't normally consider questions like this on topic is that every other question I've seen like this has been by a beginner, and the answer has been blindingly obvious.

@MartinBüttner Oh, my bad. I agree then, lets just see how the community responds to it.

Holy WOW this is a nice paradox, no idea how to solve it. :O

Is there any restriction on how much use of reflection is allowed?

@MartinBüttner You can use it of course - no restriction. Just don't change the method ;)

@MartinBüttner Just a note tho: My solution does not use reflection.

@Widi See that's why "first valid solution" might not be the best idea. You might get an uninteresting but working solution which just messes with some internals via reflection and then there's no incentive for anyone to go looking for a more interesting solution without reflection.

Are we strictly limited to C#, or can we implement this identically in another language and show a solution for that language?

@VoteToClose I think its a C# only problem.

static void Main(string[] args)
{
    bool a, b;
    unsafe
    {
        int* pa = (int*)&a;
        int* pb = (int*)&b;
        *pa = 1;
        *pb = 2;
    }

        Console.Write(Test(a, b));
}

This prints True for me with the C# implementation that comes with Visual Studio 2015. I actually don't know any C#, but I figured I'd try to write some C code and see if it worked. I was hoping that the compiler would assume that True is always represented as 1 and use a bitwise AND. In Debug mode, this is indeed the case (it worked with Release too). It uses a bitwise AND for the first condition and two comparisons to zero for the second:
            if (a && b) return false;
002C2E92  movzx       eax,byte ptr [ebp-3Ch]
002C2E96  movzx       edx,byte ptr [ebp-40h]
002C2E9A  and         eax,edx
002C2E9C  and         eax,0FFh
002C2EA1  mov         dword ptr [ebp-44h],eax
002C2EA4  cmp         dword ptr [ebp-44h],0
002C2EA8  je          002C2EB2
002C2EAA  xor         edx,edx
002C2EAC  mov         dword ptr [ebp-48h],edx
002C2EAF  nop
002C2EB0  jmp         002C2EE4
            if (a) if (b) return true;
002C2EB2  movzx       eax,byte ptr [ebp-3Ch]
002C2EB6  mov         dword ptr [ebp-4Ch],eax
002C2EB9  cmp         dword ptr [ebp-4Ch],0
002C2EBD  je          002C2EDC
002C2EBF  movzx       eax,byte ptr [ebp-40h]
002C2EC3  mov         dword ptr [ebp-50h],eax
002C2EC6  cmp         dword ptr [ebp-50h],0
002C2ECA  je          002C2EDC
002C2ECC  mov         eax,1
002C2ED1  and         eax,0FFh
002C2ED6  mov         dword ptr [ebp-48h],eax
002C2ED9  nop
002C2EDA  jmp         002C2EE4
            return false;
002C2EDC  xor         edx,edx
002C2EDE  mov         dword ptr [ebp-48h],edx
002C2EE1  nop
002C2EE2  jmp         002C2EE4
        }
002C2EE4  mov         eax,dword ptr [ebp-48h]
002C2EE7  lea         esp,[ebp-0Ch]
002C2EEA  pop         ebx
002C2EEB  pop         esi
002C2EEC  pop         edi
002C2EED  pop         ebp
002C2EEE  ret

Amazing! I was totally sure that it could not be done

I have tried the same thing but it doesn't seem to work in Mono under Linux.

This would be dependent not on the C# compiler (currently Roslyn from MS) but rather on the JIT compiler (currently RyuJIT from MS). Though the IL the C# compiler produces could also affect what JIT does.


text:
One-zero dividend
Challenge description
For every positive integer n there exists a number having the form of 111...10...000 that is divisible by n i.e. a decimal number that starts with all 1's and ends with all 0's. This is very easy to prove: if we take a set of n+1 different numbers in the form of 111...111 (all 1's), then at least two of them will give the same remainder after division by n (as per pigeonhole principle). The difference of these two numbers will be divisible by n and will have the desired form. Your aim is to write a program that finds this number.
Input description
A positive integer.
Output description
A number p in the form of 111...10...000, such that p ≡ 0 (mod n). If you find more than one - display any of them (doesn't need to be the smallest one).
Notes
Your program has to give the answer in a reasonable amount of time. Which means brute-forcing is not permited:
p = 0
while (p != 11..10.00 and p % n != 0)
    p++

Neither is this:
do
    p = random_int()
while (p != 11..10.00 and p % n != 0)

Iterating through the numbers in the form of 11..10..00 is allowed.
Your program doesn't need to handle an arbitrarily large input - the upper bound is whatever your language's upper bound is.
Sample outputs
2: 10
3: 1110
12: 11100
49: 1111111111111111111111111111111111111111110
102: 1111111111111111111111111111111111111111111111110

Can we have a reasonable upper bound to the possible output? (Something about less than 2.4 billion (approx. the max value of a signed integer) should be fine, as arrays or lists might be required for some implementations)

@MartinBüttner I think that the first satisfying output should be enough (reasonable timeframe constraint)

The last 0 is not necessary in the 49 test case.

@CatsAreFluffy I think all numbers need to contain at least 1 and at least one 0, otherwise 0 is a solution for any input. (Would be good to clarify this though.)

Just requiring one 1 should work.

Challenge description updated.
@MartinBüttner: It needs to start with 1, I think it's stated rather clearly in the description.

@CatsAreFluffy: It is, otherwise it wouldn't end with 0.

Surprisingly, I think this is actually a computationally hard problem for which there is no polynomial algorithm in the size (number of bits) of n. For a given number n (with no factors of 2,3,5) we need to find some k so 10^k-1 is a multiple of n. So, k is some multiple of the order of 10 in the multiplicative group modulo n. Generically, if n is a product of two primes, this order is phi(n), and finding this is equivalent to factoring n. I think that being asked for a multiple of this order isn't easier.

Uhh...why does 3 matter?

@CatsAreFluffy A number like 1111 is (10^4-1)/9, and this division takes out factors of 3.

Do we have to provide the smallest possible output or just one that works?

This could be a duplicate because I remember making this exact pigeonhole argument in a comment on another question...

About the computationally hard problem: Doesn't the 1^n0^n trick imply a quadratic-time algorithm? (x=searching, y=modulo)

Related. @feersum, is this the one you were thinking of?

@PeterTaylor Yep, that's it. I see it's a bit different in that the zeroes and ones may come in any order.

Mathematica, 29 bytes
⌊10^(9EulerPhi@#)/9⌋10^#&

Code by Martin Büttner.
On input \$n\$, this outputs the number with \$9\varphi(n)\$ ones followed by \$n\$ zeroes, where \$\varphi(\cdot)\$ is the Euler totient function. With a function phi, this could be expressed in Python as
lambda n:'1'*9*phi(n)+'0'*n

It would suffice to use the factorial \$n!\$ instead of \$\varphi(n)\$, but printing that many ones does not have a reasonable run-time.
Claim: \$9\varphi(n)\$ ones followed by \$n\$ zeroes is a multiple of \$n\$.
Proof: First, let's prove this for the case that \$n\$ is not a multiple of \$2, 3, \text{or } 5\$. We'll show the number with consisting of \$\varphi(n)\$ ones is a multiple of \$n\$.
The number made of \$k\$ ones equals \$\frac{10^k-1}9\$. Since \$n\$ is not a multiple of \$3\$, this is a multiple of \$n\$ as long as \$10^k-1\$ is a factor of \$n\$, or equivalently if \$10^k \equiv 1\mod n\$. Note that this formulation makes apparent that if \$k\$ works for the number of ones, then so does any multiple of \$k\$.
So, we're looking for \$k\$ to be a multiple of the order of \$k\$ in the multiplicative group modulo n. By Lagrange's Theorem, any such order is a divisor of the size of the group. Since the elements of the group are the number from \$1\$ to \$n\$ that are relatively prime to \$n\$, its size is the Euler totient function \$\varphi(n)\$. So, we've shown that \$10^{\varphi(n)} \equiv 1 \mod n\$, and so the number made of \$\varphi(n)\$ ones is a multiple of \$n\$.
Now, let's handle potential factors of \$3\$ in \$n\$. We know that \$10^{\varphi(n)}-1\$ is a multiple of \$n\$, but \$\frac{10^{\varphi(n)}-1}9\$ might not be. But, \$\frac{10^{9\varphi(n)}-1}9\$ is a multiple of \$9\$ because it consists of \$9\varphi(n)\$ ones, so the sum of its digits a multiple of \$9\$. And we've noted that multiplying the exponent \$k\$ by a constant preserves the divisibility.
Now, if \$n\$ has factors of \$2\$'s and \$5\$'s, we need to add zeroes to end of the output. It way more than suffices to use \$n\$ zeroes (in fact \$\log_2(n)\$ would do). So, if our input \$n\$ is split as \$n = 2^a \times 5^b \times m\$, it suffices to have \$9\varphi(m)\$ ones to be a multiple of \$n\$, multiplied by \$10^n\$ to be a multiple of \$2^a \times 5^b\$. And, since \$n\$ is a multiple of \$m\$, it suffices to use \$9\varphi(n)\$ ones. So, it works to have \$9\varphi(n)\$ ones followed by \$n\$ zeroes.

Just to make sure no one thinks this was posted without my permission: xnor came up with the method and proof all on his own, and I just supplied him with a Mathematica implementation, because it has a built-in EulerPhi function. There is nothing mind-blowing to the actual implementation, so I'd consider this fully his own work.

Python 2, 44 bytes
f=lambda n,j=1:j/9*j*(j/9*j%n<1)or f(n,j*10)

When j is a power of 10 such as 1000, the floor-division j/9 gives a number made of 1's like 111. So, j/9*j gives 1's followed by an equal number of 0's like 111000.
The function recursively tests numbers of this form, trying higher and higher powers of 10 until we find one that's a multiple of the desired number.

Oh, good point, we only need to check 1^n0^n...

@MartinBüttner If it's any easier, it also suffices to fix the number of 0's to be the input value. Don't know if it counts as efficient to print that many zeroes though.

Why does checking 1^n0^n work?

@Lynn Adding more zeroes can't hurt, and there's infinitely many possible numbers of ones, some number will have enough of both ones and zeroes.

Pyth, 11 bytes
.W%HQsjZ`TT

Test suite
Basically, it just puts a 1 in front and a 0 in back over and over again until the number is divisible by the input.
Explanation:
.W%HQsjZ`TT
                Implicit: Q = eval(input()), T = 10
.W              while loop:
  %HQ           while the current value mod Q is not zero
      jZ`T      Join the string "10" with the current value as the separator.
     s          Convert that to an integer.
          T     Starting value 10.

Haskell, 51 bytes
\k->[b|a<-[1..],b<-[div(10^a)9*10^a],b`mod`k<1]!!0

Using xnor’s approach. nimi saved a byte!

CJam, 28 25 19 bytes
Saved 6 bytes with xnor's observation that we only need to look at numbers of the form 1n0n.
ri:X,:)Asfe*{iX%!}=

Test it here.
Explanation
ri:X    e# Read input, convert to integer, store in X.
,:)     e# Get range [1 ... X].
As      e# Push "10".
fe*     e# For each N in the range, repeat the characters in "10" that many times,
        e# so we get ["10" "1100" "111000" ...].
{iX%!}= e# Select the first element from the list which is divided by X.

JavaScript (ES6), 65 bytes
Edit 2 bytes saved thx @Neil
It works within the limits of javascript numeric type, with 17 significant digits. (So quite limited)
a=>{for(n='';!(m=n+=1)[17];)for(;!(m+=0)[17];)if(!(m%a))return+m}

Less golfed
function (a) {
    for (n = ''; !(m = n += '1')[17]; )
        for (; !(m += '0')[17]; )
            if (!(m % a))
                 return +m;
}

Why not for(m=n;?

@Neil because I need at least one zero. Maybe I can find a shorter way ... (thx for the edit)

Oh, that wasn't clear in the question, but I see now that the sample outputs all have at least one zero. In that case you can still save a byte using for(m=n;!m[16];)if(!((m+=0)%a)).

@Neil or even 2 bytes. Thx

Husk, 11 10 bytes
-1 byte thanks to Razetime!
ḟ¦⁰modṘḋ2N

Try it online! Constructs the infinite list [10,1100,111000,...] and selects the first element which is a multiple of the argument.

Mathematica, 140 55 bytes
NestWhile["1"<>#<>"0"&,"1",FromDigits@#~Mod~x>0&/.x->#]

Many bytes removed thanks to xnor's 1^n0^n trick.
Minimal value, 140 156 bytes
This gives the smallest possible solution.
NestWhile["1"<>#&,ToString[10^(Length@NestWhileList[If[EvenQ@#,If[10~Mod~#>0,#/2,#/10],#/5]&,#,Divisors@#~ContainsAny~{2, 5}&],FromDigits@#~Mod~m>0&/.m->#]&

It calculates how many zeros are required then checks all possible 1 counts until it works.
It can output a number with no 0 but that can be fixed by adding a <>"0" right before the final &.

Haskell, 37 bytes
f n=[d|d<-"10",i<-[1..n*9],gcd n i<2]

This uses the fact that it works to have 9*phi(n) ones, where phi is the Euler totient function. Here, it's implemented using gcd and filtering, producing one digit for each value i that's relatively prime to it that is in the range 1 and 9*n. It also suffices to use this many zeroes.

Perl 5, 26 bytes
includes a byte for -n (-M5.01 is free)
($.="1$.0")%$_?redo:say$.

Explanation
$. starts off with value 1. We immediately concatenate it with 1 beforehand and 0 afterward, yielding 110, and reassign that to $. — that's what the $.="1$.0" does.
The assignment returns the assigned value so when we take it modulo the input number $_ we obtain 0 (false) if 110 is divisible by the input and nonzero (true) otherwise.

In the latter case, we redo, i.e. repeat the block (the -n switch makes the whole thing a loop block, and incidentally, assigns $_ to the input number). This concatenates another 1 and 0, yielding 11100, etc.
If 110, or 11100, or 1111000, or whatever we're up to, is divisible by the input, we stop and say (print) it.

Note that every number divides such a number (i.e. that has one more 1 than the numbers of 0s it has). After all, if it divides something with more 1s than 0s, you can append 0s and it'll still divide that. And if divides something with fewer 1s than 0s, say m 1s and n 0s with m < n, then it also divides the number with 2m 1s and n 0s.

Jelly, 11 bytes
⁵DxⱮḅ⁵ḍ@Ƈ⁸Ḣ

Try it online!
Ignoring runtime requirements, we can reduce this to 10 bytes using xnor's method, but with \$\varphi(n)\$ replaced with \$n!\$:
!,µ⁵Dx"µFḌ

Try it online!
How they work

⁵DxⱮḅ⁵ḍ@Ƈ⁸Ḣ - Main link. Takes n on the left
⁵D          - Yield [1, 0]
   Ɱ        - For each integer i in [1, 2, ..., n]:
  x         -   Repeat each element of [1, 0] i times
    ḅ⁵      - Convert each back into an integer
        Ƈ   - Keep those for which the following is true:
      ḍ@    -   Is divisible by
         ⁸  -   n
          Ḣ - Take the first value of those remaining

!,µ⁵Dx"µFḌ - Main link. Takes n on the left
!          - Yield n!
 ,         - Yield [n!, n]. Call this l
  µ        - Begin new link with l on the left
   ⁵D      - Yield [1, 0]
      "    - Zip [1, 0] with [n!, n] and do the following over each pair:
     x     -   Repeat
           - This yields [[1, 1, ..., 1], [0, 0, ..., 0]].
             The first element has n! 1s and the second n 0s
             Call this k
       µ   - Begin new link with k on the left
        F  - Flatten k
         Ḍ - Convert to integer

Sage, 33 bytes
lambda n:'1'*9*euler_phi(n)+'0'*n

This uses xnor's method to produce the output.
Try it online

05AB1E, 8 bytes
$Õ9*×Î×«

Port of @xnor's Mathematica answer, so make sure to upvote him!!
Try it online or verify all test cases.
Explanation:
$         # Push 1 and the input-integer
 Õ        # Pop the input, and get Euler's totient of this integer
  9*      # Multiply it by 9
    ×     # Repeat the 1 that many times as string
     Î    # Push 0 and the input-integer
      ×   # Repeat the 0 the input amount of times as string
       «  # Concatenate the strings of 1s and 0s together
          # (after which the result is output implicitly)

A more to-the-point iterative approach would be 11 bytes:
TS∞δ×øJ.ΔIÖ

Try it online or verify all test cases.
Explanation:
T             # Push 10
 S            # Convert it to a list of digits: [1,0]
  ∞           # Push an infinite positive list: [1,2,3,...]
   δ          # Apply double-vectorized on these two lists:
    ×         #  Repeat the 1 or 0 that many times as string
              # (we now have a pair of infinite lists: [[1,11,111,...],[0,00,000,...]])
      ø       # Zip/transpose; swapping rows/columns:
              #  [[1,0],[11,00],[111,000],...]
       J      # Join each inner pair together:
              #  [10,1100,111000,...]
        .Δ    # Find the first value in this list which is truthy for:
          IÖ  #  Check that it's divisible by the input-integer
              # (after which the result is output implicitly)

bc, 58 bytes
define f(n){for(x=1;m=10^x/9*10^x;++x)if(m%n==0)return m;}

Sample results
200: 111000
201: 111111111111111111111111111111111000000000000000000000000000000000
202: 11110000
203: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000
204: 111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000
205: 1111100000
206: 11111111111111111111111111111111110000000000000000000000000000000000
207: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
208: 111111000000
209: 111111111111111111000000000000000000
210: 111111000000
211: 111111111111111111111111111111000000000000000000000000000000
212: 11111111111110000000000000
213: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
214: 1111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000
215: 111111111111111111111000000000000000000000
216: 111111111111111111111111111000000000000000000000000000
217: 111111111111111111111111111111000000000000000000000000000000
218: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
219: 111111111111111111111111000000000000000000000000

dc, 27 bytes
Odsm[O*lmdO*sm+O*dln%0<f]sf

This defines a function f that expects its argument in the variable n.  To use it as a program, ?sn lfx p to read from stdin, call the function, and print the result to stdout.  Variable m and top of stack must be reset to 10 (by repeating Odsm) before f can be re-used.
Results:
200: 111000
201: 111111111111111111111111111111111000000000000000000000000000000000
202: 11110000
203: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000
204: 111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000
205: 1111100000
206: 11111111111111111111111111111111110000000000000000000000000000000000
207: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
208: 111111000000
209: 111111111111111111000000000000000000
210: 111111000000
211: 111111111111111111111111111111000000000000000000000000000000
212: 11111111111110000000000000
213: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
214: 1111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000
215: 111111111111111111111000000000000000000000
216: 111111111111111111111111111000000000000000000000000000
217: 111111111111111111111111111111000000000000000000000000000000
218: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
219: 111111111111111111111111000000000000000000000000


text:
Translate oOo CODE
Given an input of a program written in oOo
CODE, output the BF code that it
represents.
Here is a short description of how oOo CODE works:

First, all non-alphabetic characters are removed (everything not in the range
A-Za-z).
For example, take the program PROgRam reVERsES giVeN iNPut sEqUENcE (an
example given on the esolangs wiki page that does exactly what you'd
expect). After this first step, we now have
PROgRamreVERsESgiVeNiNPutsEqUENcE.
Next, divide all remaining characters into groups of 3. We now have
PRO,gRa,mre,VER,sES,giV,eNi,NPu,tsE,qUE,NcE. If there is a trailing group
of 1 or 2 characters, discard it.
Convert each group of 3 letters into a BF command based on the following
table:
ooo  >
ooO  <
oOo  [
oOO  ]
Ooo  -
OoO  +
OOo  .
OOO  ,

That is, if the first letter of a group is lowercase, the second is
uppercase, and the third is lowercase, it would translate to the command
[.
With our example, this finally becomes the BF program ,[>,]<[.<]+, which
does indeed reverse its input.

Since this is code-golf, the shortest code in bytes will win.
Test cases:
<empty string> -> <empty string>
A -> <empty string>
Ab -> <empty string>
Abc -> -
AbcD -> -
AbcDe -> -
AbcDef -> --
1A_b%c*D[]e\\\f! -> --
PROgRamreVERsESgiVeNiNPutsEqUENcE -> ,[>,]<[.<]+

I'm waiting for somebody with an answer in oOo ...

@Glorfindel: Happy to oblige.

oOo, 1569 1515 bytes
Had to be done. Try it here.
Golfed:
oooooooooOoOoooooooooooooooOoOooooooOOOoOoooooooOoOOoOOoOOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOoooOoOOoOOoOOoOOoOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooooooOoOoooOOooOooOoOOooOoOoOooooOooOooOooOooOooOooOooOooOooOooOOoOoooooooooooooooooooooooooooooooooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooOooOooOooOooOooOooOooOooOOoOooooooooooooOoOoooooooooooooooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooooooooooOoOoooOOooOooOooOooOoOOooOooOooOooOooOooOooOoOoooooOooooooooooooooooOoOOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOooOooOoOoooooOoooooOoooOOoooooOoooOOooOoOoooooooOoOOoOooOooOOoooOOooOOooooooOOooOoOooooOoOooooOooooOooooOooOOoooooOoooOOooOoOoooooooOoOooOooOOoooOOooOOoooOOooOOooooooOOooOoOooooOoOooooooooooooOoOOoOOoOOoOoOoooOOoOOoOOoOOoOoooOoooOOooOooOooOoOooooooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOooOoOooooOoOOoOooOooOOoooooOoooOOooOoOoOoooOOooOOooooooOOooOoOooooOoOooooOoooOOoooooOoooOOooOoOoooooooOoOOoOooOooOOoooOOooOOoooOOooOOoooOOOoOooooooooooooOOooOoOoooOOooOooOooOooOooOOooooOOooooOOoooOOoOOooooooooooooooooooooooooOoOooooooOOOoOO

Translated to Brainfuck (with linebreaks for clarity):
>>>+>>>>>+>>,[>>++++++++[<++++++++>-]<+<[->-[>]<<]<[->+>[->+<]>+>>+++++[<+++++>-
]<++<[->-[>]<<]<[->+>[->+<]>+>+++++++<[->-[>]<<]<[->+>[->+<]>+>>+++++[<+++++>-]<
++<[->-[>]<<]<[->>[-]<<]<[-<<<<<<<<<<<+>>>>>>>>>>>>>>[-]<<<<]]<[->>>[-]<<<<]]<[-
<<<<<<<<<+>>>>+>>>>>>>>[-]<<<<]]<[->>>[-]<<<<]<<<<<<<[>[>>>>>++++++[<+++++++>-]<
++<<<[>[>[<->-]<[>>++<<-]<->]<[>+>[>-<<->-]<[>>+<<-]<-]<->]<[>+>>>>++++[<++++>-]
<<<[>>>+++++[<++++++>-]<+<[>++<<->-]<[-]<->]<[>+>[<->-]<[>>++<<-]<-]<-]+>>>>.[-]
<<<<<-<-<-]]>>>>>>>>+>>,]

Ungolfed with explanation:
this progrAm Translates ooo codE tO brainfUCK cOde. i guesS sINcE ThE ExAMpLE
tEXt WAs SeLf-doCUmENtINg, I ShOUlD PrOBaBLy Make This SElf-DOcUmeNtInG too.

oh, I shoUld menTIon ThaT i WRotE tHe OriginAl BrainFuCk code EnTirElY By haNd.
If you waNt TO sEE tHE bRAiNfUck cODe, RUn THiS PrOGrAm wiTh itSElf AS iNPuT!

baSiCaLly, thiS proGram seTS up MemOrY As fOlLoWs: the fIrSt thrEe Bytes aRe
"ValId" FLags (V0, v1, V2), theN tHErE'S a BArRIeR (A 1) fOLlOweD bY tHree
"vaLue" bIts (b0, b1, b2). THe rEst Of THe aRrAy Is basiCaLly juSt ScratcH
sPacE. tO Save SpAce, i'm slIdINg THe POiNTeR fOrwaRD bY OnE In EAcH ItEratIon
uNTil THe POiNteR hItS the baRrieR, at whiCH poInt ThE ProGrAm Prints out tHe
ConvERteD chArACteR.

tHe ProgrAm eXteNsiVelY usEs tHe cLevEr "gReaTEr-Than" comparison operator
described by dheeraj ram aT
hTtp://sTAckOveRflOw.cOm/QUeSTioNs/6168584/BrAinfuck-comparE-2-nUmbeRS. i hAppEn
tO reAlLY lIKe tHiS iMplemEntAtiOn bEcaUse It iS boTh cOMpAct and nestablE,
wHich is critical for my bf code tO wOrk pROpeRly.

I seT up ThE ReQUisItE sTructure, then pErForm A BunCh oF neSteD cOMpaRisOns
ThaT loOk rOugHlY like tHis:

    if(in >= 65 /* capital a */) {
        if(In <= 90 /* CApITaL Z */) {
            vI = 1
            Bi = 1
        } ELsE {
            iF(in >= 97 /* lOWeRCaSE a */) {
                IF(iN <= 122 /* LoWErCAsE z */) {
                    vi = 1
                }
            }
        }
    }

At thE End OF tHEsE coMpaRisOnS, if the V (valid) Bit iS Set, the ProgRAm sTePs
the poiNtER rIghTwaRDs. if IT hiTS the barRIer, It Then gOeS into A big sEt of
nEstED condiTionALs tHaT test the AcCumUlaTEd vaLUe bITs, anD ConSTruct thE
CorReSpondInG character to pRiNT oUT. tHEn It ReseTS bACk TO tHE iNitiAl stATe.

fInaLly, It Reads anotheR iNPuT ChARaCTeR aNd goES bACk TO lOOpINg.

SO tHere You hAVe iT - An Ooo To BrainFuCK cOnvErtER writtEn in OOo (aNd
BrAinfUCk, bY ExtensiON!). siNcE i havE a Few moRe chARacterS to sPAre In This
progRaM, HeRe's A coUPle oF StrESs teST paTTernS:

0123456789ABcDefghijklmnopQRstUvWxyzABcdEfgHijKlmNopQRstuvWXyz!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
 ~}|{`_^]\[@?>=<;:/.-,+*)('&%$#"!zyXWvutSRqPOnmlkjihgfedcbazyxwvutsrqPoNmlkjihGFEdCBa9876543210

Thanks for the interesting challenge!

oh god... This is epic!  Good job.

... WOW. I am impressed. For the curious: http://goo.gl/vbh3h9 (the full Try it online link was too long for obvious reasons).

Golfed/optimized out a bunch of chars. New tryit link: http://goo.gl/ISjwLB

noo, i was so proud of mine but i was 10 minutes away from completing it when i had to leave for four hours :P

THIS IS THE BEST THING I HAVE EVER SEEN ON THIS SITE

@Texenox In that case, welcome to Programming Puzzles and Code Golf! I'm sure you'll find many more answers around that'll contend for that "best thing I have ever seen" spot in your mind :)

@Sp3000 I've been lurking this place for about two months. I've seen really great stuff but this has to be the best I have seen.

CJam, 36 35 bytes
l{el_eu-},'_f<0+3/W<2fb"><[]-+.,"f=

Test it here.
Explanation
l               e# Read input.
{el_eu-},       e# Discard all characters that don't change in a lower/upper case
                e# transformation, i.e. non-letters.
'_f<            e# Compare with '_' to determine case as 0 or 1.
0+              e# Append a zero.
3/              e# Split into chunks of 3.
W<              e# Discard last chunk.
2fb             e# Convert each chunk from base 2.
",.+-][<>"f=    e# Select the corresponding character for each chunk.

Append a value and discard last chunk: clever!

Ahh, that is really clever

JavaScript (ES6), 94 93 91 85 84 83 bytes
Saved 1 byte thanks to @dev-null
x=>x.replace(/[a-z]/gi,c=>(a+=c<'a'|0)[2]?b+="><[]-+.,"['0b'+a-(a="")]:0,a=b="")&&b

I've tried many variants of this, but this seems to be the shortest. Also works on empty input!
How it works
First, with x.replace(/[a-z]/gi,c=>, we find take each letter c in the input. We set a and b to "" at the other end of the function call, since the function ignores any parameters past the second. a will store a binary string for determining which character we are currently making, and b will store the result.
Now for the confusing part: first, with (a+=+(c<'a')), we append a 0 to a if c is uppercase; 1 otherwise. This expression returns the new value of a, so then we can check if it has reached three chars of length with by checking if the character at index 2 exists:[2]?. If not, we simply end the function with :0.
If a is now three chars in length, it is a binary number between 000 and 111. We can convert this to a decimal number by appending "0b" to the beginning, then forcing the engine to parse it as a number with '0b'+a-0.
However, we still need to reset a to the empty string. We can't just do '0b'+(a="")-0 because that would mean the string parsed is just 0b. Fortunately, when parsed as a number, the empty string becomes 0, so we can replace the 0 with (a="").
Now we have our number, and we can just append the character at that index in "><[]-+.," to b. After the replace is done, we use &&b to return it from the function. (Well, unless the result of .replace is empty, which only happens on empty input and returns the empty string anyway.)

Nice one byte save with: '0b'+a-0 vs +\0b${a}`and+("0b"+a)`

So, replace wins after all!

@Neil Yea sorry for leading you down the match trail ...

Latest version has problems with leading non-letters?

@Neil You're right. Fortunately, I managed to golf a byte off of the working version using a trick from the non-working one.

05AB1E, 35 32 bytes
Code:
á0«3÷\)vyS).uïJC",.+-][<>"Sr@?)\

Using a very clever trick from Martin Büttner, from this answer. Explanation:
á0«                               # Remove all non-alphabetic characters and append a zero
   3÷\                            # Split into pieces of 3 and discard the last one
      )v                          # Wrap everything into an array and map over it
        yS).uï                    # Is uppercase? Converts AbC to [1, 0, 1]
              JC                  # Join and convert from binary to int
                ",.+-][<>"        # Push this string
                          S       # Split the string
                           r@     # Reverse the stack and get the character from that index
                             ?    # Pop and print without a newline
                              )\  # Wrap everything into an array and pop

Try it online!
Uses CP-1252 encoding.

Retina, 79 75 71 70 bytes
Thanks to randomra for saving 1 byte.
i`[^a-z]

M!`...
m`^
;
+`(.*);(.)
$1$1$2;
T`l
.+
$.&
T`d`_><[]\-+.,
¶

Try it online!
Explanation
i`[^a-z]

We start by removing everything that's not a letter.
M!`...

This splits the string into chunks of three characters by returning all (non-overlapping) 3-character matches. This automatically discard any incomplete trailing chunk.
m`^
;

Prepend a ; to each line. We'll use this as a marker for the base-2 conversion. Speaking of which, we'll simply treat upper-case letters as 1 and lower-case letters as 0.
+`(.*);(.)
$1$1$2;

This does a funny base-2 to unary conversion. At each step we simply double the characters left of the ; and move the ; one to the right. Why does this work? Remember we'll be interpreting lower case as 0 and upper case as 1. Whenever we process a letter, we simply double the running total (on the left) so far - double lower-case letters are just 2*0=0, so they can be completely ignored and upper-case letters represent the binary number so far, so doubling them is what we want. Then we add the current letter to that running total which represents 0 or 1 correspondingly.
T`l

Remove all lower-case letters/zeroes.
.+
$.&

Match each line and replace it with the (decimal) number of characters in that line. Due to the ; this turns the unary number into its decimal equivalent + 1.
T`d`_><[]\-+.,

Transliteration which substitutes 1-8 with the corresponding command.
¶

Remove linefeeds.

That's a clever way to split into chunks of three chars. Have you used this before?

@ETHproductions I think I have but I'm not sure where. I might be thinking of http://codegolf.stackexchange.com/a/69518/8478

70 bytes and a bit less shorter with my newly added Retina ideas.

@randomra ah nice idea for the ;. I'll edit that in later.

MATL, 38 32 bytes
'><[]-+.,'jt3Y2m)3ZCtAZ)92<!XBQ)

Try it online!
'><[]-+.,'      % push string with BF commands
j               % read input as a string
t               % duplicate
3Y2             % predefined literal: string 'A...Za...z'
m               % true for elements of input string that are letters
)               % index into input string to keep only letters
3ZC             % 2D array whose columns are non-overlapping slices of length 3.
                % The last column is padded with zeros if needed
tA              % duplicate. True for columns that don't contain zeros
Z)              % keep those columns only. This removes padded column, if any
92<             % 1 for upper case letters, 0 for lower case letters in the 2D array
!               % transpose so each group of 3 is a row
XBQ             % convert each row from binary to decimal and add 1
)               % index into string containing the BF commands. Implicitly display

Japt, 37 36 bytes
Uo"%l" f'.³ £",><[]-+."gX®c ¤gJÃn2Ãq

Test it online!
How it works
Uo"%l" f'.³ £  ",><[]-+."gX®   c ¤  gJÃ n2Ã q
Uo"%l" f'.³ mX{",><[]-+."gXmZ{Zc s2 gJ} n2} q

Uo"%l"      // Get rid of all non-letter chars in U.
f'.³        // Take each set of three chars in U.
mX{      }  // Map each item X in this group to:
XmZ{     }  //  Map each letter Z in X to:
Zc s2 gJ    //   Take the char code of Z as a binary string, and take the first char.
            //   This maps each character to 1 if it's UC, or 0 if it's lc.
        n2  //  Interpret the result as a binary number.
",><[]-+."g //  Get the item at this index in this string.
q           // Concatenate the result and implicitly output.

JavaScript (ES6), 111 95 bytes
s=>s.match(/[A-Z]/gi).map(c=>+(c<'a')).join``.match(/.../g).map(g=>'><[]-+.,'['0b'+g|0]).join``

Simply removes non-letters, converts upper case letters into 1s and lower case into 0s, divides into groups of three, ignores a trailing group of 1 or 2, and decodes the groups.
Edit: Saved 16 bytes thanks to @dev-null, although the code no longer works when passed the empty string.

@dev-null Ugh, I had tried the match(/.../g).map().join approach but miscounted the number of bytes and though it didn't save me anything. Thanks for the tip on the first match though.

Pyth, 40 bytes
jkm@"><[]-+.,"id2f!%lT3cm?rId0Z1f!rIT2z3

Try it here!
Could save 2 bytes if I can output the result as list of characters instead of a string.
Explanation
Filters out all non-letters, converts uppercase to 1 and lowercase to 0, splits into chunks of 3, interprets every chunk as binary number and uses this as index into a string which contains all BF commands.

jkm@"><[]-+.,"id2f!%lT3cm?rId0Z1f!rIT2z3  # z = input

                                f     z   # filter input with T
                                 !        # logical not
                                  rIT2    # T == swapcase(T), true if T is not a letter
                        m                 # map filter result with d
                         ?rId0            # if d == toLower(d)
                              Z1          # 0 for lowercase, 1 for uppercase
                       c               3  # Split into chunks of 3, last element is shorter if needed
                 f                        # filter with T
                  !                       # logical not
                   %lT3                   # len(t) mod 3 -> keep only elements of length 3
  m                                       # map with d
              id2                         # Convert from binary to decimal
   @"><[]-+.,"                      # Get the resulting BF command
jk                                        # Join to a string

Jolf, 31 34 bytes
Try it here! Replace ► with \x10 and ♣ with \x05. Because I implemented the chop function wrong, I gain 3 bytes. :(
►ΜZeZcAAρi♣Epu1pl033d."><[]-+.,"ΙH
        ρi♣E                        remove all space in input
       A    pu1                     replace all uppercase letters with 1
      A        pl0                  replace all lowercase letters with 0
    Zc            3                 chop into groups of three
  Ze               3                keep groups of length three
 Μ                  d               map
                              ΙH   parse element as binary
                     ."><[]-=.,"    and return a member of that
►                                  join by nothing

Hoon, 212 bytes
=+([v=turn c=curr q=cold k=tape] |=(t/k `k`(v (v `(list k)`(need ((unit (list k)) p:(rose (murn t (c rush alf)) (star (stun [3 3] ;~(pose (q '0' low) (q '1' hig))))))) (c scan bin)) (c snag (rip 3 '><[]-+.,')))))

Ungolfed:
|=  t/tape
^-  tape
%+  turn
  %+  turn  ^-  (list tape)
  %-  need  %-  (unit (list tape))
    =+  t=(murn t (curr rush alf))
    p:(rose t (star (stun [3 3] ;~(pose (cold '0' low) (cold '1' hig)))))
  (curr scan bin)
(curr snag (rip 3 '><[]-+.,'))

use ++murn to get rid of all characters in the input that can't be parsed with "alf" (alphabet)
parse the list with a combinator that outputs each 3 characters at a time to a list, replacing lowercase with '0' and uppercase with '1'
Cast the result to (unit (list tape)) and forcibly unwrap it to get the furthest parsed result, to work with only multiple of threes without crashing
Map over the list, parsing each group as if it were binary
Use each number in the list as an index into the text '><[]-+.,', and cast the list back out to a tape.

Hoon doesn't have proper regular expressions, only a parser combinator library, so it's sadly pretty verbose. ++scan also crashes if the entire input stream isn't parsed, so I have to use ++rose, coerce it into a unit, and unwrap it for the "farthest parse" value. It also makes heavy use for currying and mapping over lists (++turn), so I alias the function names to one letter variables.
Hoon is the programming language for Urbit, a clean slate reimplementation project. It's purely functional, statically typed, vaguely lisp-like, and compiles to Nock. Nock is a combinator based VM that runs on top of a binary tree bignum memory model.
When you boot Urbit you are dropped into :dojo, the shell and Hoon repl. To run the snippet simply type:
%.  "PROgRam reVERsES giVeN iNPut sEqUENcE"

and then paste the standalone function on the next line.

Welcome to PPCG! You answer is fairly well explained, but could you link in an interpreter or a place to try it online?

I added a link to Urbit's github page, since building it is pretty much the only way. Is that sufficient?

Absolutely. :D Leaving instructions on how to use this in a full program as well would be wonderful.

Python 3, 91 bytes
b=1
for c in input():
 b=-~c.isalpha()*b+c.isupper()
 if b>7:print(end="><[]-+.,"[b-8]);b=1

Hmm... looks a bit long, especially the second line. b=[b,2*b+(c<'a')][c.isalpha()] is slightly worse though.

Using end like that is really smart. I've never seen that before.

Jelly, 27 bytes
=Œs¬Tịµ=Œu;0s3ṖḄ€ị“<[]-+.,>

Try it online! Note that backslashes need escaping in the input string for the second last test case.
Implicit input: string s (list of characters)

=Œs             Compare with swapcase
¬               Not - this gives 1 for letters, 0 otherwise
Tị              Take characters at truthy indices
µ               Start a new monadic chain

Input: string s' (list of letters)

=Œu             Compare with uppercase
;0              Append 0
s3              Split into chunks of length 3
Ṗ               Pop last chunk
Ḅ€              Apply convert-from-binary to each chunk
ị“<[]-+.,>      For each number, 1-based index cyclically into the string "<[]-+.,>"

Matlab, 98 bytes
function t(s);s=s(isletter(s));s=s(1:end-mod(end,3));r='><[]-+.,';r([4 2 1]*reshape(s<92,3,[])+1)

Clean
Trim
reshape into a 3xn Matrix m with UC = 1, lc =0
(4 2 1)*m+1 results in an index list
Index to the right chars

Vyxal, 154 bitsv2, 19.25 bytes
Ǎvæ3ẇ'L3=;vBkTṖ»AǑ»iiṅ

Try it Online!
Ǎ                      # remove non alphabeticals
 væ                    # get the case of each char (0 for lower, 1 for upper)
   3ẇ                  # wrapped into chunks of length 3
     'L3=;             # keep only those of length 3
          vB        i  # converted from binary and indexed into
            kTṖ»AǑ»i   # the 16560th permutation of the BF instruction set
                     ṅ # join by nothing

C++, 173 167 bytes
Full program, golfed (reads from standard input):
#include <cstdio>
main(){for(char*a="@[`{>-[.<+],",c,o=0,t=1;(c=getchar())>0;)if(c=c>*a&&c<a[1]?2:c>a[2]&&c<a[3]?1:0){o|=c>1?t:0;t*=2;if(t>4)putchar(a[o+4]),o=0,t=1;}}

Somewhat ungolfed:
#include <cstdio>
main(){
    for(char*a="@[`{>-[.<+],",c,o=0,t=1;(c=getchar())>0;)
        if(c=c>*a&&c<a[1]?2:c>a[2]&&c<a[3]?1:0){
            o|=c>1?t:0;
            t*=2;
            if(t>4)putchar(a[o+4]),o=0,t=1;
        }
}

Note that @A ... Z[ in ASCII, and likewise for `a ... z}.

148 bytes

Python 2, 112 bytes
''.join('><[]-+.,'[int('%d'*3%tuple(map(str.isupper,y)),2)]for y in zip(*[iter(filter(str.isalpha,input()))]*3))

Will try to golf it more.

Perl, 76 73 72 + 1 = 73 bytes
$a.=y+A-Z++dfor/[A-Z]/gi;print substr"><[]-+.,",oct"0b$_",1for$a=~/.../g

Requires the -n flag:
$ perl -n oOo.pl <<< 'PROgRamr{}\eVERsESgiVeNiNPutsEqUENcE'
,[>,]<[.<]+

Using the  trick with base-2 conversion.
How it works:
                          # '-n' auto read first line into `$_`
            for/[A-Z]/gi; # Iterate over all letters a-z
$a.=y/A-Z//d              # Count number of uppercase letters (1 or 0)

                                  for$a=~/.../g # Split $b into hunks of 3 characters. And
                                                # remove any potential trailing characters.
      substr"><[]-+.,",oct"0b$_",1              # `oct("0b$binary")` will convert binary
                                                # to decimal.
print

Ruby 117 114 113 111 86 79 Bytes
gets.tr(?^+m='a-zA-Z','').tr(m,?0*26+?1).scan(/.../){$><<"><[]-+.,"[$&.to_i 2]}

tr(?^+m='a-zA-Z','') sets m to 'a-zA-Z' and removes non-letters
.tr(m,?0*26+?1) converts lowercase to 0, uppercase to 1
.scan(/.../) chunk string into groups of 3 and discard last group if it has less than 3
{$><<"><[]-+.,"[$&.to_i 2]} convert each binary number to a character

Can't you use tr("a-zA-Z","01")? or even tr("A-Za-z",10)

@dev-null  "AAz".tr("a-zA-Z","01") gives 111

So much that can be done here. This is a start: gets.delete('^a-zA-Z').tr("a-z",?0).tr("^0",?1).scan(/.../){$><<"><[]-+.,"[$&.to_i 2]} (86 bytes). Changed the input from command line option to stdin; fixed the surrounding quotes in the output (but now it has no trailing newline)

@daniero thanks! made this a community answer. feel free to make changes

tr(^a-zA-Z','').tr('a-zA-Z',?0*26+?1) is shorter

...and it's even shorter if you define a variable as "a-zA-Z"

Julia, 107 bytes
s->"><[]-+.,"[map(j->parse(Int,j,2)+1,[map(i->i<'_'?'1':'0',m)for m=matchall(r"\w{3}",filter(isalpha,s))])]

This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.
Ungolfed:
function f(s)
    # Brainfuck commands
    bf = "><[]-+.,"

    # Filter out non-alphabetic characters from the input
    chars = filter(isalpha, s)

    # Get all non-overlapping groups of three characters
    groups = matchall(r"\w{3}", chars)

    # Construct binary strings by comparing to _
    binary = [map(i -> i < '_' ? '1' : '0', m) for m = groups]

    # Parse each binary string as an integer and add 1
    indices = map(j -> parse(Int, j, 2) + 1, binary)

    # Return the Brainfuck commands at the indices
    return bf[indices]
end

Lua, 120 Bytes
Big use of string.gsub() here, one more time could have allowed me to create a one character pointer on this function to gain some bytes. Also, it is my first lua program without any spaces! :D
This program takes its input via command-line argument and output a BrainFuck program, one command per line.
Edit: Saved 1 Byte thanks to @Oleg V. Volkov
arg[1]:gsub("[%A]",""):gsub("%l",0):gsub("%u",1):gsub("...",function(c)x=1+tonumber(c,2)print(("><[]-+.,"):sub(x,x))end)

Ungolf and explanations
arg[1]:gsub("[%A]","")    -- replace the non-letter character by an empty string
                          -- %A matches all the character not in %a (letters)
:gsub("%l",0)             -- replace lower case letters by 0s
:gsub("%u",1)             -- replace upper case letters by 1s
:gsub("...",function(c)   -- iterate over all groupe of 3 characters
  x=tonumber(c,2)+1       -- convert the 3-letter group from binary to decimal
  print(("><[]-+.,")      -- output the corresponding brainfuck command
             :sub(x,x))
end)

You can save one byte on inlining b and one more on saving string.gsub to shorter var and manually folding first arguments to it: g=("").gsub g(g(g(g(arg[1],"[%A]",""),"%l",0),"%u",1),"...",function(c)x=1+tonumber(c,2)print(("><[]-+.,"):sub(x,x))end)

...or maybe I misread byte count on folding. Inlining still works.

@OlegV.Volkov Saving to a shorter var costs, sadly, more, I tried the same thing ^^. And thanks for the inlining of b... I don't know why I saved it in a var...

Mathematica, 192 bytes
StringJoin[FromDigits[#,2]&/@Partition[ToCharacterCode@#-48,3]&[StringDelete[#,a_/;!LetterQ[a]]~StringReplace~{_?UpperCaseQ->"1",_?LowerCaseQ->"0"}]/.Thread[0~Range~7->Characters@"><[]-+.,"]]&

Anonymous function that takes the desired string as an argument. Steps in the (pretty straightforward) algorithm:

Clean the string
Replace UC->"1", lc->"0"
Turn the string into a binary list
Partition the list into threes and interpret each chunk as a base-2 number
Replace the numbers with their appropriate symbols and join back into a string.

Perl 6, 81 bytes
This can probably be done better, but this is my go at it
{m:g/:i<[a..z]>/;[~] ("><[]-+.,".comb[:2[$_]]for (+(91>$_.ord)for |$/).rotor(3))}

Usage
> my &f = {m:g/:i<[a..z]>/;[~] ("><[]-+.,".comb[:2[$_]]for (+(91>$_.ord)for |$/).rotor(3))}
-> ;; $_? is raw { #`(Block|149805328) ... }
> f("PROgRamreVERsESgiVeNiNPutsEqUENcE")
,[>,]<[.<]+

Ungolfed
sub oOo ($_) {
    m:g/:i<[a..z]>/;  # Match all letters and put them in $/

    my @digits = (
        for |$/ -> $c {           # For all $c in $/
            +(91>$c.ord)          # 1 if $c.ord < 91 else 0
        }
    );
    @digits.=rotor(3);            # Split the digits into chunks of 3

    my @chars = (
        for @digits -> @l {
            "><[]-+.,".comb[:2[@l]] # Take the character from "><[]-+.,"
                                    # at an index given by converting
                                    # @l (a list of 3 binary digits)
                                    # from base 2 to base 10
        }
    );
    @chars.join # Join the list of chars into a string and return
}

Japt v2.0a0 -P, 27 bytes
r\L ò3 l3 Ëmè\A Íg"><[]-+.,

Saved 3 bytes thanks to @Shaggy
Try it

29 bytes

26 bytes

Pyke, 31 bytes, noncompetitive
Pyke is older than the challenge, but I added some features to make it more competitive - chunk function. I used the same trick as @Martin Büttner used.
#~l{)\`Lm<0+3cFb2"><[]-+.,"@)st

Try it here!

TI-BASIC, 311 288 bytes
What, no TI-BASIC answers?  Time for me to fix that!
Ans→Str1:" →Str2:" →Str6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str4:For(S,1,length(Str1:sub(Str1,S,1:If inString(Str4+"abcdefghijklmnopqrstuvwxyz",Ans:Str2+Ans→Str2:End:sub(Str2,2,length(Str2)-1→Str2:For(B,1,.1+3⁻¹length(Str2:sub(Str2,3B-2,3→Str3:1+sum({4,2,1}seq(0≠inString(Str4,sub(Str3,X,1)),X,1,3→L₁(B:End:For(C,1,.1+dim(L₁:Str6+sub("><[]-+.,",L₁(C),1→Str6:End:sub(Str6,2,length(Str6)-1→Str6

Input is the oOo code in Ans.
Output is the translated BF code.
Examples:
"AbcDef
AbcDef
prgmCDGF18
--
"PROgRam reVERsES giVeN iNPut sEqUENcE
PROgRam reVERsES giVeN iNPut sEqUENcE
prgmCDGF18
.[>,]<[.<]+
"AbcDe
AbcDe
prgmCDGF18
-

Un-golfed:
(Newlines and comments added)
Ans→Str1                                                   ;store the input in "Str1"
" →Str2                                                    ;set "Str2" and "Str6" to a
" →Str6                                                    ; space character
                                                           ; (needed b/c TI-BASIC doesn't
                                                           ;  like concatenating empty
                                                           ;  strings)

"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str4                           ;store the uppercase alphabet
                                                           ; in "Str4"
For(S,1,length(Str1                                        ;loop over the input string
sub(Str1,S,1                                               ;get the current character
If inString(Str4+"abcdefghijklmnopqrstuvwxyz",Ans          ;if the character is in either
                                                           ; the uppercase or lowercase
                                                           ; alphabet
Str2+Ans→Str2                                              ;add it to "Str2", the code
                                                           ; string
End
sub(Str2,2,length(Str2)-1→Str2                             ;remove the space added earlier
For(B,1,.1+3⁻¹length(Str2                                  ;loop over each 3-char substring
                                                           ; and skip any extra chars
                                                           ; (.1 is added to force one
                                                           ;  loop)
sub(Str2,3B-2,3→Str3                                       ;store said substring in "Ans"
1+sum({4,2,1}seq(0≠inString(Str4,sub(Str3,X,1)),X,1,3→L₁(B ;convert to the respective
                                                           ; index in "><[]-+.,"
                                                           ; (1-indexed)
End
For(C,1,.1+dim(L₁                                          ;loop over each index
                                                           ; (.1 is added to force one
                                                           ;  loop)
Str6+sub("><[]-+.,",L₁(C),1→Str6                           ;add the char to the translation
                                                           ; string
End
sub(Str6,2,length(Str6)-1→Str6                             ;remove the added space and
                                                           ; store the result in "Str6"
                                                           ; and "Ans"
                                                           ;implicit print of "Ans"

Notes:

TI-BASIC is a tokenized language.  Character count does not equal byte count.

JavaScript, 148 bytes
function a(s){function b(c){return c.charCodeAt()&32}return (l=(s=s.replace(/[^a-z]/gi)).substr(3))?",.+-][<>"[b(s[0])*4+b(s[1])*2+b(s[2])]+a(l):""}

Thunno 2 J, 21 bytes
Ị³fæl3=;2ȷḋkŻ8ṗ«@ṅisi

Attempt This Online!
Port of emirps's Vyxal answer.
Explanation
Ị³fæl3=;2ȷḋkŻ8ṗ«@ṅisi  # Implicit input
Ị                      # Remove non-alphabets
 ³                     # Split into groups of length 3
  f                    # Case of each character in each group
   æ   ;               # Filtered by:
    l                  #  Length
     3=                #  Equals 3
         ȷ             # To each:
        2 ḋ            #  Convert from binary
           kŻ          # Push "[]<>-+.,"
             8ṗ        # All permutations
               «@ṅ     # Compressed integer 16560
                  i    # Index into permutations
                   si  # Index into the above
                       # Implicit output of joined list


text:
Find the haystack in the needles
In a twist on finding a needle in a haystack, you need to find the largest contiguous haystack containing exactly one needle. Note that you cannot connect cells on diagonals, only left/right/up/down.
Input
An array (or a number of user input lines, your pick) of 'N' (needles) and '#' (hay) characters. Input only contains those two characters, and must contain at least one of each. For example:
N#N#N
#NN##
###N#
N##N#

Output
The size of the largest possible valid haystack. For our example, we would output 11 (there are 11 pieces of hay, and one needle).
   #
#  ##
###N#
 ## #

This is code-golf, so shortest code wins.  Standard loophole restrictions apply.
Test Cases
Input on left, possible maximal haystack on right
Case 1: 4
N##    ##
NN#     #
#NN     N
#N#     #

Case 2: 7
###   ###
N#N    #
NNN    N
###   ###

Case 3: 10
N###N    ###
#N#N#   #N#
#N#N#   # #
N###N    ###

Case 4: 10
N#N#N
#N#N#   # # #
##N##   ##N##
#N#N#   # # #
N#N#N

Case 5: 1
NN#NN
NNNNN
#NNN#   #N
NN#NN

JavaScript (ES6), 152 bytes
s=>[...s].map((n,i)=>n>'M'&&(a=[...s],a[i]=r=1,a.map(_=>a.map((c,j)=>c=='#'&&a[j+1]|a[j-1]|a[j+l]|a[j-l]?a[j]=++r:0)),o=r>o?r:o),o=0,l=~s.search`
`)|o-1

Explanation
For each needle in the input, sets the needle to a part of the haystack (represented by setting it to a non-zero number) and continuously checks hay cells. If hay contains an adjacent part of the hay stack, also sets it part of the haystack and increments the size of the hay stack. Outputs the highest result.

var solution =

s=>
  [...s].map((n,i)=>n>'M'&&(          // for each needle in s at index i
      a=[...s],                       // a = array of each character in s
      a[i]=1,                         // set the starting needle to 1 (haystack)
      r=0,                            // r = haystack size starting from this needle
      a.map(_=>                       // loop to ensure the complete haystack is found
        a.map((c,j)=>                 // for each cell c at index j
          c=='#'&&                    // if the current cell is hay
          a[j+1]|a[j-1]|a[j+l]|a[j-l] // and any adjacent cells are part of the haystack
          ?a[j]=++r:0                 // add the current cell to the haystack, increment r
        )
      ),
      o=r>o?r:o                       // o = max of o and r
    ),
    o=0,                              // o = final output, initialise to 0
    l=~s.search`
`                                     // l = line length of s
  )
  |o                                  // return o
<textarea id="input" rows="6" cols="40">N#N#N
#N#N#
##N##
#N#N#
N#N#N</textarea>

<button onclick="result.textContent=solution(input.value)">Go</button>

Ruby, 207
->a{d=->b{0...b.size}
f=c=s=->y,x{(d[a]===y&&d[a[0]]===x&&!f[y][x]&&a[y][x]==c)?(c,f[y][x]=?#,1
1+s[y,x-1]+s[y,x+1]+s[y-1,x]+s[y+1,x]):0}
d[a].map{|y|d[y].map{|x|f,c=a.map{|b|b.map{p}},?N
s[y,x]}.max}.max-1}

This is an anonymous function that takes in the input as an array of arrays. Usage:
f=->a{......}

f["
N##
NN#
#NN
#N#
".strip.split.map(&:chars)] # => 4

The proc named s recursively finds the size of the haystack with needle at specific coordinates and is called on each needle in the haystack.


text:
What is the "Ant-Difficulty" of this string?

I think about if I was turned into an ant, I'd want my loved ones to
  know, so I thought of a plan- I'd gather twigs and leaves and write my
  name on the ground, Then I'd wait for my family and friends to crowd
  round But now I'm thinkin'- that when they saw it They'd think the
  human me wrote it and an ant was crawlin on it Then not realizing' the
  ant-me was really the real-me In a strange twist of fate I think
  they'd probably kill me.
--Thoughtful Guy, Rhett and Link

Your worst nightmare has come true. You have been turned into an ant. You have to write a message to your family to tell them this horrible news. But, gathering twigs and leaves is so old-school. Let's write it on a computer! If you climb up on your families "QWERTY" keyboard, you're just strong enough to push down the key you're standing on. However, it takes a lot of energy to jump from key to key, so you want to know how hard it will be to write out a message. For reference, here is the US standard for the QWERTY keyboard:

Your message will be entirely made up of letters and space so all punctuation and key-modifiers (shift, system keys, control, tab, enter, numbers, etc.) are invalid. Ignore case completely. You need to determine what the "Ant-Difficulty" of a given message is before you start typing it. The "Ant-Difficulty" is how many times you (as an ant) have to jump from one key to another key. Ant-Difficulty does not include the effort required to push a key down once you get to that key. Since you are a tiny creature, you want write a program or function that is as small as possible to determine the ant difficulty of a string.
Input and output can be in any reasonable format.
Clarifications
For the first row (QWERTYUIOP) you can only jump straight down. Q to A (or A to Q) is one jump, W to S is one jump, and so on up until O to L. From P, you have to first jump to O before you can go down a row.
Since the third row (ZXCVBNM) is slightly off-kilter, you can jump from second to third and to the side at the same time. So A only goes to Z, S goes to Z and X, D goes to X and C, etc. K only goes to M, and L goes to nothing on the third row. Everything on the third row except for Z goes to the spacebar.
This brings up a possible shortcut. To go from X to M, you could jump to C, then V, then B, then N, then M, which is 5 jumps, or you could jump to the spacebar, walk across it, then jump to M, which is 2 jumps. The same works on the second and third row. S to K can be S-D-F-G-H-J-K, which is 6 jumps, or S-X-Space-M-K, which is 4.
Move List:
Here is a list of all possible jumps, each counting as 1.
Q: AW
W: QSE
E: WDR
R: EFT
T: RGY
Y: THU
U: YJI
I: UKO
O: ILP
P: O
A: QWSZ
S: WADXZ
D: ESFXC
F: RDGCV
G: TFHVB
H: YGJBN
J: UHKNM
K: IJLM
L: KO
Z: AX
X: SDZC <SpaceBar>
C: DFXV <SpaceBar>
V: FGCB <SpaceBar>
B: GHVN <SpaceBar>
N: HJBM <SpaceBar>
M: JKN <SpaceBar>
<SpaceBar>: XCVBNM

Test I/O
Message  --> Difficulty
hello    --> 12 (H to E is G-F-D-E for 4, E to L is E-R-T-Y-U-I-O-L for 7,
                L is 0 since we're already on L, and L to O is 1)
world    --> 22 (W to O is W-S-X-Space-M-K-O for 6, O to R is O-I-U-Y-T-R for 5,
                R to L is R-T-Y-U-I-O-L for 6, and L to D is L-K-M-Space-C-D for 5)
ant      --> 7 (A-S-X-Space-N is 4, plus N-H-Y-T is 3)
ant-difficulty --> Undefined behavior. ('-' is not a valid character.)
CaSe     --> 6 (C-D-S-A is 3, A-S is 1, S-D-E is 2)
a fad    --> 10 (A-S-X-Space is 3, Space-C-F is 2, F-D-S-A is 3, A-S-D is 2.)

The shortest answer in bytes gets the checkmark.