text:
Making an acronym
Objective
Your goal is to make a program that converts an input to its acronym. Your input is guaranteed to have only letters and spaces. The input will have exactly one space between words. You must output the acronym of the input.
Rules

Your code cannot be case-sensitive(e.g. foo and Foo are the same)
Your code must ignore the following words and not put them in the acronym:
and or by of
You cannot assume that the words are all lowercase.
The output must be entirely capitalised, with no separation between characters.
A trailing newline is accepted but not necessary.
If your language has an acronym function builtin, you may not use it.

Examples
(inputs/outputs grouped)
United States of America
USA

Light Amplification by Stimulation of Emitted Radiation
LASER

united states of america
USA

Jordan Of the World
JTW

Scoring
This is a code-golf challenge so the shortest code wins.
Leaderboard

var QUESTION_ID=75448,OVERRIDE_USER=8478;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

I have added 2 test cases.

What should be the output for UPPER And lowercase TestCase?

Can we assume that all other words than and,or,by,of are in titlecase?

You may assume that they are in titlecase.

@Aplet123 Are you sure that's what you want? Because if that's the case, the challenge boils down to removing spaces and lower case letters. (E.g. 4 bytes in Retina: T\ l`)

I have made an edit to the rules.

Will there always be one space between the words or can it be more?

There will always be one space between the words.

Bit too late to change it, but you'd generally also expect words like "a", "an", "the", "for", "to", etc. to be removed.

How about every word at most three letters?

If every word was at most three letters, it would be unfair to many people that they have made their code so long.

This is setting aside the fact that USA is not an acronym, it's an abbreviation? NASA is an acronym because you say the word "nasa". If you spell out the letters, it isn't an acronym.

Can we assume the input will always have a non-empty output?

You may assume that the input will always have a non-empty output.

@MarkWright that's the odd case out

What about Unicode / ascii?

@corsiKa you're thinking of "alliteration", an abbreviation is something like "adverb" -> "adv.". if you're going to be pedantic, be correct ;)

It's a bit late for a comment for clarification, but a and an aren't mentioned in the list of words to be removed, though it's rather common to remove them from acronyms. Should they remain?

@undergroundmonorail I'm aware that this was over 7 years ago, but the definition of alliteration, according to Merriam Webster, is "the repetition of usually initial consonant sounds in two or more neighboring words or syllables (such as wild and woolly, threatening throngs)". If you're going to correct someone's pedantry, at least be correct yourself.

Pyth, 25 21 20 bytes
shM-crz1dc4."@YK½¼

Try it here!
Thanks to @Jakube for saving one byte!
Explanation

shM-crz1dc4."@YK½¼  # z = input

     rz1               # convert input to uppercase
    c   d              # split input on spaces
         c4."@YK½¼     # create a list of the words from a packed string which shall be ignored
   -                   # filter those words out
 hM                    # only take the first letter of all words
s                      # join them into one string

The packed string becomes ANDBYOROF

A little string packing trick: ."@YK½¼ saves one byte over "ANDORBYOF. It's basically @ANDBYOROF packed.

Dang, the non-ascii-chars got deleted. Just pack @ANDBYOROF and see what you get.

@Jakube Thanks! Tried to pack it before, but always ended up with the same length or longer.

Jelly, 21 20 bytes
,“°ɲịĊs°gɗ»ṣ€⁶Œuḟ/Ḣ€

Try it online!
(-1 thanks to @Dennis.)
,“°ɲịĊs°gɗ»              Pair input with the string "OR OF by AND"
           ṣ€⁶           Split both by spaces
              Œu         Uppercase
                ḟ/       Reduce filter (removing ignored words from input)
                  Ḣ€     Keep first letters of remaining words

Jelly's dictionary is a bit weird in that it has AND in uppercase yet by in lowercase...

Retina, 29 31 36 bytes
T`l`L
 |(AND|OR|BY|OF)\b|\B.

Intended newline at the end.
Thanks to Martin Büttner for saving 5 bytes
Try it online
T`l`L                  # Replace lowercase with uppercase
 |(AND|OR|BY|OF)\b|\B. # Regex match, it doesn't matter if we match 'AND' in SHAND
                       #   since the 'SH' will still become 'S' or am I missing something?
                       # Replace with nothing

I'm unfamiliar with retina. What does T`l`L do?

@Cyoce See update with explanation

vim, 46
gUU:s/ /\r/g<cr>:g/\vAND|OR|OF|BY/d<cr>:%s/.\zs.*\n<cr>

gUU                      make line uppercase
:s/ /\r/g<cr>            replace all spaces with newlines
:g/\vAND|OR|OF|BY/d<cr>  remove unwanted words
:%s/.\zs.*\n<cr>         remove all non-initial characters and newlines

I particularly like that last bit. The first . in the regex matches the first character of the line. Then we use \zs to start the "actually-being-replaced" part, effectively not replacing the initial character. .* matches the rest of the line, and \n matches the trailing newline. Since we don't specify a replace string, vim simply removes everything in the match, leaving only initials.

vim is a programming language

JavaScript (ES6), 56 bytes
Saved a byte thanks to @edc65.
s=>s.toUpperCase().replace(/\B.| |(AND|O[RF]|BY)\b/g,"")

Explanation
The code is self explanatory, I'll just explain the regex:
\B.          // Matches any character (`.`), that's not the start of a word
|            // Matches spaces
|(...)\b     // Matches all the words that should be ignored

It removed all of these matched characers and uppercases the word

putting .toUpperCase() before the regexp you could avoid the i flag

@edc65 smart idea, thanks!

Pretty sure the parens are not needed here

JavaScript, 61 64 66 63 bytes
a=>a.toUpperCase().replace(/(AND|O[FR]|BY|(\w)\w+)( |$)/g,"$2")

It uses a Regular Expression to find get words that aren't from the list: and, or, of, by, and captures the first letter. It then capitalizes the resulting string of letters.
EDIT: 64 Bytes - Fixed for words start with of,or,by,and
EDIT: 66 Bytes - Fixed to check all words including last word.
EDIT: 63 Bytes - Saved 3 Bytes thanks to @edc65 and @Cyoce!

Doesn't work for Foo Offline Bar

General consensus is you don't need to assign the function to a variable.

putting .toUpperCase() before the regexp you could avoid the i flag

CJam, 28 24 22 bytes
qeuS/"AOBONRYFD"4/z-:c

Try it online. Thanks to Sp3000 for pointing out a bug and suggesting a fix, and to Dennis for saving 4 6(!) bytes.
Explanation
qeuS/  e# Convert the input to uppercase and split on spaces
"AOBONRYFD"4/z  e# Push the array of short words. See more below
-      e# Remove each short word from the input words
:c     e# Cast the remaining words to characters, which is a
       e# shorter way of taking the first letter

Dennis suggested this trick for shortening the word list: Splitting AOBONRYFD into chunks of four, we get
AOBO
NRYF
D

Transposing columns into rows with the z operator, we get the proper words!

Julia, 72 63 61 55 bytes
s->join(matchall(r"\b(?!AND|OR|OF|BY)\S",uppercase(s)))

This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.
We convert the string to uppercase, select each match of the regular expression \b(?!AND|OR|OF|BY)\S as an array, and join it into a string.
Saved 8 bytes thanks to Dennis!

Perl, 32 bytes
say uc=~/\b(?!AND|OR|OF|BY)\S/g

+1 byte for the -n flag.
Algorithm stolen from @AlexA's Julia answer.

MATL, 34 27 bytes
1 byte fewer thanks to @AandN
KkYb'OF AND OR BY'YbX-c1Z)!

Try it online!
Xk                  % convert to uppercase
Yb                  % split by spaces. Gives a cell array of input words
'AND OR BY OF'      % ignored words separated by spaces
Yb                  % split by spaces. Gives a cell array of ignored words
X-                  % setdiff: remove ignored words (result is stable)
c                   % convert to 2D char array, padding words with spaces
1Z)                 % take first column
!                   % transpose into a row

Maybe this works with 33 bytes? XkYb{'OF' 'AND' 'OR' 'BY'}X-c1Z)!

JavaScript, 104 85 bytes
Saved 19 bytes thanks to @Aplet123.
Splits the string by spaces then checks if it is the words of, or, and, or by. If it is, it ignores it, otherwise it takes the first letter of it. It then joins the array and makes the string uppercase.
a=_=>_.split` `.map(v=>/\b(o(f|r)|and|by)\b/i.test(v)?"":v[0]).join("").toUpperCase()

Ungolfed:
function a(_) {
       _ = _.split` `; //Split on spaces
       _ = _.map(function(v){return new RegExp("\b(o(f|r)|and|by)\b","i").test(v)}); //Check if the banned words are in the result
       _ = _.join(""); //Join it into a string
       _ = _.toUpperCase(); //Convert it to uppercase
};

Why is there a backtick at the end? It causes an error and is not intended to be there. You should probably remove the backtick.

Also, you don't need var. We don't worry about polluting the global scope in code golf :P

It does not work. If you look at the examples the input
united states of america
it gives the output
usa
not
USA

Yeah, I noticed that. Stupid super long built-in function names.

You can set Z to
_.map(v=>/o(f|r)|and|by/.test(v)?"":v[0])
instead of "". You can remove your
_.forEach(p=>Z+=p[0].toUpperCase());
line and replace your
return Z
line with
return Z.join("").toUpperCase()

Here is a 78 byte version made from chaining code:
a=_=>_.split` `.map(v=>/o(f|r)|and|by/.test(v)?"":v[0]).join("").toUpperCase()
Note the space after the split` that didn't get displayed.

Oh my god those tenary operators are evil.

Fixed the bug with the following 85 byte code:
a=_=>_.split` `.map(v=>/\b(o(f|r)|and|by)\b/i.test(v)?"":v[0]).join("").toUpperCase()

Use [fr] instead of (f|r)? join``  instead of join("")? /^...$/ instead of /\b...\b/?

Also, if you move the toUpperCase to before the split then you can uppercase the regex and remove the i flag.

Ruby, 45 43 bytes
->s{s.upcase.scan(/\b(?!AND|OR|OF|BY)\S/)*''}

This is a lambda function that accepts a string and returns a string. To call it, assign it to a variable and do f.call(input).
It uses the same approach as my Julia answer, namely convert to uppercase, get matches of the regular expression \b(?!AND|OR|OF|BY)\S, and join into a string.
Try it here
Saved 2 bytes thanks to manatwork!

.join → *''. By the way, no need to assign it to anything to call it. Just pass it the arguments as subscript: ->s{s.upcase.scan(/\b(?!AND|OR|OF|BY)\S/)*''}['United States of America']

@manatwork Oh nice, thanks!

PHP, 92 bytes
First attempt at code golf.
foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".
Requires PHP 5.4 or above for short array syntax to work.

Just FYI, [tag:code-golf]s are scored in bytes unless otherwise noted, and you can use just a # at the beginning of the line to make a header.

There's a problem. Using $s requires register_globals, but that has been removed from PHP since 5.4, so your answer cannot work as you require 5.4 for short array syntax. You need to get the input string as an argument ($argv, a function argument or similar).

Python, 81 bytes
lambda s:''.join(c[0]for c in s.upper().split()if c not in'AND OF OR BY'.split())

76 bytes using set difference: lambda s:''.join(c[0]for c in s.upper().split()if{c}-{'AND','OF','OR','BY'})

Bash + GNU coreutils, 103 76 bytes
for i in ${@^^};do grep -qE '\b(AND|OR|BY|OF)\b'<<<$i||echo -n ${i:0:1};done

Run with
./codegolf.sh Light Amplification BY Stimulation of Emitted Radiationofo

either with single argument quoted or with multiple arguments.
(I distorted the last word to contain of).

60 bytes
Thanks to @manatwork.
for i in ${@^^};{ [[ $i = @(AND|OR|BY|OF) ]]||printf %c $i;}

Sorry, but that awk call looks horrible. What about replacing it with ${@^^}?

@manatwork, good point, didnot think of that...

Looks much better. Now please replace the grep call with [[ $i = @(AND|OR|BY|OF) ]]. ;) And with that you can also remove the “ + GNU coreutils” part from the post header.

One more thing: you could replace the echo with printf. Furthermore you can apply Digital Trauma's brace tip too. (More in Tips for golfing in Bash.) for i in ${@^^};{ [[ $i = @(AND|OR|BY|OF) ]]||printf %c $i;}

I was looking for the bash notation similar to grep's \b but couldnot find it... And I did not know that do...done can be replace by curly braces.

The word boundary is still \b, just needs to escape the \  with another one. But unfortunately it works only with compat31 shell option set (shopt -s compat31). By the way, the grep way can also be written shorter without \b: grep -qwE 'AND|OR|BY|OF'

Maybe I was thinking too complicated, as in the grep-step the input is line by line, so [[ $i =~ ^(AND|OR|BY|OF)$ ]] would have also worked, but is 2 bytes longer.

JavaScript, 80 72 55 53 bytes
Code

function a(t){t=t.toUpperCase();t=t.replace(/AND|OR|BY|OF|\B.| |/g,"");return t}

function a(t){return t.toUpperCase().replace(/AND|OR|BY|OF|\B.| |/g,"")}

I just read about arrow functions and realized I could shorten this up even more.

a=t=>t.toUpperCase().replace(/AND|OR|BY|OF|\B.| |/g,"")

According to this, you don't count the assignment in the length, so -2 bytes.
t=>t.toUpperCase().replace(/AND|OR|BY|OF|\B.| |/g,"")

This is my first golf, so it's not very good.

05AB1E, 33 32 28 bytes
Code:
‘€ƒ€—€‚€‹‘ð¡)Uuð¡)vXyQO>iy¬?

Uses CP-1252 encoding.

Haskell, 100 99 98 82 75 bytes
I am quite sure it can be shortened a lot more as I still suck at using $,. etc. so I keep using () insted=)
Thanks @nimi for your help magic!
import Data.Char
w=words
x=[h!!0|h<-w$toUpper<$>x,notElem h$w"OF BY OR AND"]

Example:
*Main> a "united states by america"
"USA"

Oh, that . composition operator looks quite intuitive. I am just never sure what is evaluated in what order.

chapter 6 of Learn you a Haskell for Great Good! has a good introduction to function application with $ and composition with ..

Switching back to non-pointfree and a list comprehension is even shorter: a x=[h!!0|h<-w$toUpper<$>x,notElem h$w"OF BY OR AND"].

Now this is definitely over my head, I'm going to have to learn quicker=)

Python, 103 96 bytes
This is my first attempt at code golf, and this could probably be golfed a lot more.
Thanks to DenkerAffe for saving seven characters.
lambda x:"".join([x[0]for y in x.split(" ") if y.lower() not in ['and','or','of','by']]).upper()

It takes the input, turns it into a list of words and takes their first letter if it's not one of the forbidden words, then turns everything to uppercase.

It was trying to execute the input. In Python 3 that doesn't happen. (I think it saves 2 bytes to switch to Python 3 (-4 for input vs raw_input, +2 for print("".join..) vs print"".join..) Also no space between a symbol and a keyword.

Or you just go with a lambda which gets the input as argument. This is always allowed here if the challenge doesn't forbid it explicitly.

@CatsAreFluffy It might help to switch to Python 3, but I highly prefer Python 2 over it because who likes parentheses anyways?

You can save the lower() when you uppercase the input first, before you do anything. Your filter list then becomes ['AND','OR',...]., but the rest would stay the same. You can also drop some whitespaces behind braces. x[0]for ... is completly valid in Python.

Remove spaces between symbols and keywords(it works)

PHP, 68 61 58 bytes
Uses ISO-8859-1 encoding.
for(;$w=$argv[++$x];)stripos(_AND_OR_BY_OF,$w)||print$w&ß;

Run like this (-d added for aesthetics only):
php -d error_reporting=30709 -r 'for(;$w=$argv[++$x];)stripos(_AND_OR_BY_OF,$w)||print$w&ß; echo"\n";' united states oF america

Ungolfed:
// Iterate over the CLI arguments (words).
for(;$w = $argv[++$x];)
    // Check if the word is one of the excluded words by substring index.
    // The check is case insensitive.
    stripos("_AND_OR_BY_OF", $w) ||
        // Print the word, converting to uppercase and getting only the
        // first char by using bitwise AND.
        print $w & "ß";

Saved 7 bytes by using bitwise AND instead of using ucwords.
Saved 3 bytes by using ISO-8859-1 encoding and using ß (binary 11011111) for binary AND instead of a negated space (binary 00100000).

R, 77 75 bytes
cat(substr(w<-toupper(scan(,'')),1,1)[!grepl('^(AND|OR|OF|BY)$',w)],sep='')

Try it online!
-1 byte thanks to Dominic van Essen changing the indexing.
Reads from stdin. Takes the words, converts them to uppercase, removes those that are excluded from acronyms, extracts the first character from each, and prints them to the stdout.

76 bytes...?

@DominicvanEssen very nice! And another byte down by setting w inline.

K (ngn/k), 34 bytes
{`c$-32+*'(" "\_x)^$`and`or`by`of}

Try it online!

_x lowercase the input
(" "\...) split input on spaces
(...)^$`and`or`by`of remove and/or/by/of
*' take the first character of each remaining word
`c$-32+ convert to uppercase

Mathematica, 132 117 bytes
ToUpperCase[First/@Characters@DeleteCases[StringDelete[StringSplit@#,"of"|"and"|"or"|"by",IgnoreCase->True],""]<>""]&

15 bytes saved thanks to @CatsAreFluffy.

1arg StringSplit defaults to splitting on whitespace (-5bytes)

Also you can replace the word list with "of"|"and"|"or"|"by". Also {"a","b","c"}<>""==StringJoin[{"a","b","c"}]. One last thing: Characters automatically maps over lists.

The leaderboard would prefer that you put a comma after Mathematica. Also you're welcome :)

PowerShell, 81 Bytes
(-join($args[0].Split(" ")|?{$_-notmatch"^(and|or|by|of)$"}|%{$_[0]})).ToUpper()

Explanation
Split on the spaces creating an array. Drop the offending members. Pull the first character and join together. Use ToUpper() on the resulting string.

Realized that would match Anderson and drop it. Added 4 bytes

C#, 134 bytes
Golfed
class P{static void Main(string[] a){foreach (var s in a){if(!"AND OR BY OF".Contains(s.ToUpper())){Console.Write(s.ToUpper()[0]);}}}}

Readable
class P
{
    static void Main(string[] a)
    {
        foreach (var s in a)
        {
            if (!"AND OR BY OF".Contains(s.ToUpper()))
            {
                Console.Write(s.ToUpper()[0]);
            }
        }
    }
}

Execute from command line
75448.exe Light Amplification by Stimulation of Emitted Radiation

LASER

75448.exe united states of america

USA

Lua, 122 Bytes
I would have love to use a pattern to get rid of the banned words, but sadly, lua isn't made to match groups of characters... So I had to use a for loop instead, which is much more expensive.
s=arg[1]for k,v in next,{"of","and","by","or"}do
s=s:gsub(v,"")end
print(s:gsub("(%a)%a+",string.upper):gsub("%s","").."")

Ungolfed
s=arg[1]                               -- initialise s with the argument
for k,v in next,{"of","and","by","or"} -- iterate over the array of banned words
do
    s=s:gsub(v,"")                     -- replace the occurences of v by
end                                    --   an empty string
print(s:gsub("(%a)%a+",                -- replace words (separated by spaces)
              string.upper)            -- by their first letter capitalised
         :gsub("%s","")                -- replace spaces with empty strings
                       .."")           -- concatenate to prevent the number of
                                       -- substitutions to be shown

Hey! I also made a Lua submission, here: http://codegolf.stackexchange.com/a/75616/33183.

Factor, 175 bytes
I learned a lot by writing this.
USING: strings ascii sets splitting kernel sequences math.ranges ;
>lower " " split [ { "and" "or" "by" "of" } in? not ] filter [ first dup [a,b] >string ] map "" join >upper

As a word:
USING: strings ascii sets splitting kernel sequences math.ranges ;

: >initialism ( str -- str )
  >lower " " split                            ! string.lower.split(" ")
  [ { "and" "or" "by" "of" } in? not ] filter ! word in { } ?
  [ first dup [a,b] >string ]          map    ! word[0]
  "" join >upper ;                            ! "".join.upper

Unit tests:
USING: tools.test mk-initialism ;
IN: mk-initialism.tests

{ "LASER" } [ "Light Amplification by Stimulation of Emitted Radiation" >initialism ] unit-test
{ "USA"   } [ "United States OF Americaof" >initialism ]                              unit-test
{ "USA"   } [ "united states and america" >initialism ]                               unit-test
{ "JTW"   } [ "Jordan Of the World" >initialism ]                                     unit-test

Pass!

Lua, 113 112 93 bytes
arg[1]:upper():gsub("%w+",function(w)io.write(("AND OR BY OF"):find(w)and""or w:sub(0,1))end)

Wow, totally forgot the existence of %w! That's a great one!

Katenkyo: Well, this would also work with %a; %a matches letters, and %w matches letters and numbers. The main thing is using a custom function in gsub.

Yeah, I see that it is easier to remove AND OR BY OF when selecting words... I used no custom function because they cost a lot, so I though gsub("(%a)%a+",string.upper) after removing them would have been better

Husk, 19 18 bytes
m←¤-w¨BYΘRΘF⁴ND¨ma

Try it online!
-1 byte from Dominic Van Essen.

18 bytes by using an uppercase string of words to avoid (and searching for a permutation that compresses well...)

Zsh, 46 45 44 bytes
for i;printf ${${${i:u}:#(AND|OR|BY|OF)}[1]}

Try it online!
-1 thanks to @roblogic
Explanation:
for i;printf ${${${i:u}:#(AND|OR|BY|OF)}[1]}
for i;                                         # for each word in the input
                 ${i  }                        # take that word
                    :u                         # capitalised
                         (AND|OR|BY|OF)        # if it matches one of these words
               ${      :#              }       # replace it with an empty string
             ${                         [1]}   # take the first character
      printf                                   # and print with no newline

Very nice. -1 byte using ${i:u} instead of ${(U)i}

Stax, 16 12 bytes
î♣}ïû┴N=a,╥Ç

Run and debug it

C (gcc), 149 bytes
#define x*strcmp(c,
F(char*s){char*d,*c=s;while(*s)*s++|=32;for(s=c;c;c=!d?*s=0:d+1)d=index(c,32),d?*d=0:0,1 x"and")x"or")x"by")x"of")?*s++=*c^32:0;}

Try it online!
Very naive approach. Will try to optimize it further. My first priority was to create a working example in C as there was no C submission yet.
Edit: optimized it by replacing initial conversion to upper case with conversion to lower case (easier as space is no longer an exception). I replaced strcmp with a define and replaced a while loop with a for. I did some further small optimizations and am now out of ideas.
Thanks to ceiling cat for bringing it down even more!

@ceilingcat Thanks! I was able to bring it down to 149 by adding a comma to your define!

Vyxal sr, 20 16 bytes
-4 thanks to @Underslash.
⇧⌈«X⟩qḊ8ɖ⇩«⇧⌈Fvh

Try it Online!
⇧⌈«X⟩qḊ8ɖ⇩«⇧⌈Fvh    # Full program
⇧                   # Convert (implicit) input converted to uppercase...
 ⌈                  # Split on spaces
  «X⟩qḊ8ɖ⇩«⇧⌈       # Create the list ['OR', 'BY', 'OF', 'AND']
             F      # and remove those from the input.
              vh    # Replace each word with its first letter
                    # `s` flag: Concatenate the letters and print

you can compress the string and uppercase it, yielding 16 bytes

@Underslash Thanks!

IPOS - non competing, 27 bytes
uS`"AND|OR|BY|OF"ER`%S!h%S-

This works in the current version (v0.2) of the interpreter.
Example run

python IPOS.py -i "United States of America" uS`\"AND|OR|BY|OF\"ER`%S!h%S-
USA

The backslashes there are only for escaping of the quotes and are not needed for the program.
Explanation

u                  # Make the input uppercase
S                  # Push a space to the stack
`"AND|OR|BY|OF"ER` # Push a command to the stack, that replaces matches of the regex
                   # with an empty string
%                  # Split the uppercased input string on spaces, apply the command and
                   # join back on spaces. This removes the required words from the input.
S                  # Push a space to the stack
!h                 # Push a command that only selects the first character of a string
%                  # Split on spaces, apply the command and join back on spaces
S-                 # Remove the remaining spaces (forgot to make this usuable
                   # with regexes, would have saved me some bytes here :( )

bash / GNU coreutils, 60 bytes
sed -e's/\b'{and,o[rf],by}'\W*//Ig' -re's/(\w)\S* ?/\u\1/g'

Pylongolf2, 14 bytes (UTF-8)
c| l1╨3♀~

Pylongolf2 has many non-ASCII characters that count as 2 bytes.
c| l1╨3♀~
c         read input
 |        split by space (note the space after |)
   l1     substring(0, 1)
     ╨3   convert to uppercase
       ♀~ pop the array into the stack and print it.

05AB1E, 19 bytes
lð¡“€ƒ€—€‹€‚“#K€нJu

Try it online!
A 21 byte version:
lð¡“€ƒ€—€‹€‚“#Kvy0èuJ

Try it online!

Pip, 43 bytes
a:UCq^sFi,#a{`(OR|OF|AND|BY)`~=a@i?xOa@i@0}

definitely golfable, but I'm still learning regex
explanation:
a:UCq^s                                     input toUpper, split on " "
       Fi,#a{                             } iterate over a
             `(OR|OF|AND|BY)`~=a@i?xOa@i@0  if not exact match, output first char of this word

Try it online!

C# .NET, 144 bytes
class P{static void Main(string[]a){foreach(var c in a[0].ToUpper().Split(' '))if(c!="OR"&c!="AND"&c!="BY"&c!="OF")System.Console.Write(c[0]);}}

Try Online

05AB1E, 18 bytes
lð¡“€ƒ€—€‹€‚“#K€нu

Try it online!
lð¡“€ƒ€—€‹€‚“#K€нu  # full program
                 u  # convert...
                н   # first character of...
               €    # each element of...
                    # implicit input...
l                   # in lowercase...
  ¡                 # split by...
 ð                  # spaces...
              K     # without any of the elements of...
   “€ƒ€—€‹€‚“       # "and or by of"...
             #      # split by spaces...
                 u  # to uppercase
                    # implicit output

Scala, 68 bytes
_.toUpperCase.replaceAll("\\b(AND|OR|BY|OF) ?|(?<=\\b\\w)\\w+ ?","")

Try it online!
Not the most creative answer ever.
Without regex, 75 bytes
_.toUpperCase split " "filterNot Set("AND","OR","OF","BY")map(_(0))mkString

Scastie

Factor, 47 bytes
[ >upper R/ AND|OF|OR|BY|\B.| |/ ""re-replace ]

Try it online!

Thunno 2, 16 bytes
RO“œẆḶuıdƓ“ROṗ€h

Try it online!
Explanation
RO“œẆḶuıdƓ“ROṗ€h  # Implicit input
RO                # Uppercase and split on spaces
  “œẆḶuıdƓ“       # Compressed string "and or by of"
           RO     # Uppercase and split on spaces
             ṗ    # Remove these words
              €h  # First character of each
                  # Implicit output

Pip, 26 bytes
@_M_N"OROFBYAND"CH4FNUCa^s

Takes the string as a command-line argument. Attempt This Online!
A version that takes each word as a separate command-line argument would be 24 bytes (replace a^s at the end with g). This might meet the spec, since the invocation would look something like:
pip.py acronym.pip United states of America

Try It Online!
Explanation
@_M_N"OROFBYAND"CH4FNUCa^s
                       a   ; Command-line argument
                     UC    ; Uppercase
                        ^s ; Split on spaces
                   FN      ; Filter, keeping elements for which this function is falsey:
     "OROFBYAND"           ;   Take that string
                CH4        ;   Chop it into 4 pieces: ["OR";"OF";"BY";"AND"]
   _N                      ;   Is the argument in that list?
  M                        ; Map this function to each remaining string:
@_                         ;   Get the first character
                           ; Join and autoprint (implicit)


text:
Happy Rounded Pi Day
To celebrate Rounded Pi Day, you must take advantage of today's date to make a program that takes in a circle's diameter and outputs its circumference by multiplying the diameter by 3.1416, where 3.1416 must be obtained using today's date.
Input 3
Output 9.4248
etc.

Does not take the date as input. You do not have to use all components of the date but the digits of pi must come from formatting a Date object or using a date object to obtain it. The answers so far look good.
Not sure what else to specify. All the answers so far meet what I was expecting.
My constraint was that you must use components of the date to come up with Pi. You can of course use the components, multiply by 0 then add 3.1416, but that's boring and wastes precious chars!
Shortest code wins!

What's so special about 14/3/16?

define using today's date. I could get the date as a number, divide by itself and multiply by a predefined constant for pi

Should we support a point? I mean, should the code be able to calculate for 0 diameter?

@manatwork We can assume that the arg is an integer or floating point number > 0.

@Neil in the US, we format it MM/DD/YY, so today is 3/14 today. The OP is presumably in the US themself.

I think the challenge would be more clear if the actual task was something like "multiply the input by MM.DDYY".

@Neil: Because 3/14/16 and 31/4/16 are not valid actual dates in D/M/Y format.  There aren't 14 months, and April only has 30 days.  I personally think we should wait until 6/28/32 (M/D/Y) or maybe 6/2/83 (D/M/Y), but that's a whole other holy war.

@DarrelHoffman You're a Tau man I see.

@DarrelHoffman So close with that 31/4/16...

Is a floating point number valid? I.E. Input of 3 yields 9.424800000000001

Sadly, its only PI day in the US cultural area. Europeans, with their silly lexigraphcially-sensible date ordering, don't get to have yearly PI days. Spare a sad thought for them, as you're eating your pi(e) today.

@T.E.D. But Europeans get Pi Approximation Day, July 22!

@MikeKellogg - So on "Pi Approximation Day", do they eat Chicago-style pizza? :-)

What counts as obtained using today's date? For example, can I obtain 16 as 2016 % 20?

Really should state that "today's date" is in M/D/Y format, as half the world formats date in other ways.

US date ordering makes a lot more sense than any other system. The terms of possibilities go up, [1-12]/[1-30ish]/[00-99]. Therefore the magnitudes are all increasing.

Hey everyone! Today is actually 2016-03-14.

@WillSherwood That's a strange thing to sort by.  Now, redefining the length of a month so that pattern occurs when sorting by size of an increment might be sensible.

@T.E.D. Silly? I find european format more intuitive

@rpax "lexigraphcially-sensible", he was probably was being sarcastic

I feel stupid for how long it took me to realize why no one was using brainf*ck

@WillSherwood the ISO 8601 international standard YYYY-MM-DD makes the most sense. No one can read it wrongly and it will always sort correctly by chronological order. The US way makes the least sense. Why should magnitudes increasing? Sorting and reading is what people care

@DarrelHoffman some people prefer 22/7 as Pi day

@LưuVĩnhPhúc the date 22/7 doesn't exist because there are only 12 months in a year though

@WillSherwood it exists in most of the world except those who write 3/14/16 (well, a few other countries who write 16/14/3, too)

@WillSherwood -_-

But this year's Pi day was more accurate than last year's.

Why isn't Pi Day 22/7 i.e. 22nd of July? Wouldn't that be more appropriate?

05AB1E, 16 13 bytes
žfžežg¦¦J*4°/

Try it online.
Unfortunately a bug with floats makes this a byte longer :/
Thanks to Adnan for golfing off 3 bytes.
Explanation
žfžežg¦¦J*4°/
žfžežg         push month day year
      ¦¦       slice off the first two chars from the year (2016 -> 16)
        J      join them together into a number
         *     multiply by input
          4°/  divide by 1e4

¦¦ instead of 2000- is three bytes shorter ;)

+1 žfžežg sounds like a nice Czech word :)

In UTF-8, this totals 19 bytes.

@OldBunny2800 05AB1E uses CP1252 for encoding.

Bug with floats?

@CatsAreFluffy I should be able to do žf'.žežg¦¦J* (which is a byte shorter), but strings weren't auto-coercing to floats properly.

C, 32 bytes
#define f(d)d*time(0)/464083315.

If losing a little more accuracy is fine, I can get it down to about 29 bytes being still accurate to 4 digits past the decimal (as of the time of this posting):
#define f(d)d*time(0)/46408e4

#include<time.h>?

Also, where's the executable code? this is just something for the preprocessor to copy/paste; a snippet. We like runnable implementations here.

@tac most C compilers do not require you to #include standard library headers.  Including them manually is almost always a good idea, but omitting them makes code golfing in C a lot easier.

@tac the answer behaves mostly the same as a function.  Several answers on here are standalone functions as well.  I don't see the point in providing a sample main function to demonstrate how to call this single argument macro.

@tac I think the standard [code-golf] rules is that unless forbidden functions are ok.

I don't think this is valid; the number being multiplied by is never exactly 3.1416. The question says "multiplying the diameter by 3.1416, where 3.1416 must be obtained using today's date.", not "multiplying the diameter by an approximation to pi obtained using today's date." However, it's unfair to downvote when the question is closed.

@lirtosiast I understand where you are coming from, but I feel I stayed on the legal side of the grey line.  Quoting the current spec, You do not have to use all components of the date but the digits of pi must come from formatting a Date object or using a date object to obtain it.

AppleScript, 122 120 bytes
set a to current date
(display dialog""default answer"")'s text returned*(month of a+day of a*.01+year of a*1e-4 mod.01)

Variable a
Variable a is a date object. I call all of my date information off of it.
Month, day, and year
The month, day, and year calls actually return an object that normally returns a string. To properly use it as a number, I have surrounded it on both sides with mathematical operations to automatically cast it to a number.
1e-4
1e-4 is a byte shorter than .0001.
mod.01
. acts as a separator to the AppleScript autocorrect. By using this, I can use modulo and still keep it a byte for myself.
No return statement/log
The last value calculated automatically is returned by the program. I output the number calculated via the return box.
And here's a gif of it running!

Forget Java, this has got to be the most verbose language

@Downgoat I guess that it's supposed to be "readable like English" or something... we use it a bit at one of my jobs and I really dislike whenever I have to make changes to such scripts.

@ChrisCirefice Yeah, no - this language has some annoying pieces to it. i.e. volume system volume.

Mathematica + coreutils, 20 bytes
<<"!date +%m.%d%y"#&

Luckily, Mathematica interprets the output of an external command as an expression. In this case the output is a valid float, so that multiplication with the function argument # is implied.

That's a combination I didn't know existed.

Lua, 30 27 Bytes
print(...*os.date"%m.%d%y")

Multiply the first command-line argument by the current date in format mm.ddyy, which is actually 03.1416.

Bash + bc, 25 20 bytes
date +%m.%d%y\*$1|bc

Thanks to manatwork for saving five bytes.
Usage:
$ ./pi-round.sh 3
9.4248

That here-string notation is so long: date +%m.%d%y\*$1|bc

@manatwork you are correct! I was playing around with the same myself but couldn't figure out how to combine it. Thanks!

PowerShell v2+, 46 28 25 bytes
$args[0]*(Date -F "M.dy")

Pretty straightforward. Takes input $args[0] and multiplies it by the date formatted as M.dy (the Get- is implied). Note that this may take a long time to run on v2 as it iterates possible substitutions for Date (e.g., checking your %PATH% environment variable, etc.) before settling on Get-Date.

Can you cut the space after -f?

@briantist Sadly, not here. We're abusing PowerShell's pattern recognition, since the actual flag is -Format. With flags like this, you just need to be unambiguous (for example, if you had -Debug and -Delimiter as potential options, you would need at least three letters to differentiate). Removing the space means PowerShell tries to parse the flag -F"M.dy" but can't find an argument that matches, and so throws an error.

ahhh I see it now. That's what I get for reading this on a train after a long day. I was interpreting it as the -f operator. Makes total sense now.

R 3.2.4, 55 51 47 bytes
edit I realized I could use scan thanks @FryAmTheEggMan. Reduced 4 bytes thanks to @MickyT.
scan()*as.numeric(format(Sys.Date(),'%m.%d%y'))

First attempt at a golf. Happy pi day!

Welcome to PPCG :) I'm no R programmer, but you don't need to supply a named function, just an expression that evaluates to a function. So I'm pretty sure you can drop the f=.

You can go even further and do scan()*as.numeric(format(Sys.Date(),'%m.%d%y'))

as.double instead of as.numeric saves an additional byte

Pyth, 19 bytes
*Qvs[.d4\..d5>2`.d3

Try it here!
Only works at 2016-03-14 of course.
Explanation

*Qvs[.d4\..d5>2`.d3   # Q = input

     .d4              # current month
        \.            # dot between month and day
          .d5         # current day of the month
             >2`.d3   # last 2 digits of the year
   s[                 # concat everything into a string
  v                   # eval -> convert to float
*Q                    # multiply with input to get the circumference

GNU Awk, 23 characters
$0*=strftime("%m.%d%y")

Sample run:
bash-4.3$ awk '$0*=strftime("%m.%d%y")' <<< 3
9.4248

PHP, 45 26 25 24 bytes
Uses Windows-1252 encoding
<?=$argv[1]*date(~‘Ñ•†);

Run like this:
echo '<?=$argv[1]*date(~‘Ñ•†);' | php -- 3

Saved 19 bytes by using date() instead of DateTime::format
Saved a byte by using the echo tag
Saved a byte by using ISO-8859 encoding and negating the format string, so no need for double quotes. Might mess up your terminal a bit when running it from CLI, but works.

If you assume register_globals to true, you can use $n via /?n=3 in the url.

@Martijn That requires PHP 4.1 or setting it using the php.ini file. aross said before that wants to steer away from such method.

JavaScript, 41 39 characters
This uses a proprietary Firefox-only method.
d=>new Date().toLocaleFormat`%m.%d%y`*d

Thanks to:

Ismael Miguel for the template string suggestion (-2 characters).

Sample run (Firefox Web Console):
> (d=>new Date().toLocaleFormat`%m.%d%y`*d)(3)
9.4248

Note: this will fail in Firebug Console. Seems that Firebug performs some expansion on the template string, transforming `%m.%d%y` into `%__fb_scopedVars(m).d%y` before passing it to the code.

-2 bytes: d=>new Date().toLocaleFormat`%m.%d%y`*d

Oh. [facepalm] No idea why, I usually forget that trick. Although I use the template strings regularly.

I know. I really don't get either. What I'm trying to get is a way to remove that new from there.

I tried it on Firefox and it worked fine. I copy-pasted from the console. Since I've replaced ('...') with 2 backticks, that's 2 bytes.

Python 2, 58 chars
import time
print float(time.strftime("%m.%d%y"))*input()

Try it!
Explanation:
import time                                   # Import time time module
print                                         # Print the following
      float(                                  # Cast to float
            time.strftime("%m.%d%y"))         # Format the time as MM.DDYY
                                     *input() # Multiply by input

Ruby, 40 bytes
->n{n*Time.new.strftime('%m.%d%y').to_f}

Mathematica, 54
.0001FromDigits[Now@{"Month","Day","YearShort"},100]#&

SpecBAS, 39 bytes
1 INPUT n: ?n*VAL DATE$(TIME,"mm.ddyy")

Nothing out of the ordinary. Formats date as a string then multiplies the input by the VAL (value) of that string.

Interpreter / compiler link?

https://sites.google.com/site/pauldunn/

I've edited the link into your answer

Vitsy + coreutils, 19 bytes
'y%d%.m%+ etad',W*N

Explanation:
'y%d%.m%+ etad',W*N
'y%d%.m%+ etad'       Push 'date +%m.%d%y' to the stack.
               ,      Execute as shell.
                W     Grab input from STDIN and eval it.
                 *    Multiply the top two items
                  N   Output as a number.

Cannot be run in safe mode, as this uses the Runtime's exec method.

Google Sheets, 13 bytes
Bytes are calculated with one byte per character, zero bytes per cell except for the designated input cell, two bytes. The equals sign to start a formula is not counted. (I don't know if this is standard, please correct me if I am wrong.)
Run snippet to see the code.

table {
  empty-cells: show;
}
table,
th,
td {
  border: 1px solid black;
}

    1
    2
    3

    A
    <input>
    3.1416
    =A1*A2

This works because you can define your own date formats in Google Sheets. I made it so that it is <month>.<day><year>.

You might want to ask on meta about this scoring system. ;P

Will do when I have time (maybe tonight in Maryland)

Python 3, 74 54 bytes
using the time module instead of datetime like Loovjo's Answer
import time
lambda n:n*float(time.strftime('%m.%d%y'))

previous solution
from datetime import*
lambda n:n*float(datetime.now().strftime('%m.%d%y'))

@Zenadix The meta consensus is that unnamed functions are OK.

Pyke, 16 15 bytes, ASCII encoding
C867wä%J"bT4^/*

Explanation:
C867            - b,c,d = year, day, month
    wä          - a = base_96("ä") - 100
      %         - a = a%b
       J"       - a = "".join([a,c,d])
         b      - b = base(a, 10)
          T4^   - a = 10^4
             /  - a = a/b
              * - imp_print(a*eval_or_not(input))

or 11 bytes (non-competitive), (adds string singles, 2 digit year, string sumables)
C856\.R3sb*

Explanation:
C856        - a,b,c = 2d_year, day, month
    \.      - d = "."
      R3    - a,b,c = b,c,a
        s   - a = sum(a,b,c)
         b  - a = base(a, 10)
          * - imp_print(a*eval_or_not(input))

I'm guessing this is a different Pyke than http://pyke.sourceforge.net/ ? Can you post a link to the language spec?

https://github.com/muddyfish/PYKE/tree/master

Just wondering, what encoding does Pyke use? If it's UTF-8, this is 16 bytes.

@OldBunny2800 It doesn't matter; in this case it uses good old ascii as all code points are below 255. According to http://meta.codegolf.stackexchange.com/a/5879/32686, the answer can define it's own encoding at no cost

Oracle 11g, 50 49 bytes
SELECT &n*to_char(sysdate,'MM.DDYY')FROM dual;

one less byte, thanks to @MickyT

you can drop the space before the FROM

APL, 19 bytes
⎕×0.01⊥⌽⍎2⌽8↑2↓⍕⎕TS

⎕TS is 2016 3 14 12 34 56 789 i.e. March 14rd, 2016 right before 12:35 pm
⍕ make into string, i.e. '2016 3 14 12 34 56 789'
8↑2↓ drop first two ('20') then take next eight ('16 3 14 ')
2⌽ rotate two characters, giving ' 3 14 16'
⍎ make into numbers (3 14 16)
⌽ reverse the list, giving 16 14 3
0.01⊥ evaluate in base ¹⁄₁₀₀, = 16 × 0.01² + 15 × 0.01¹ + 3 × 0.01⁰ = 0.0016 + 0.15 + 3 = 3.1416
⎕× multiply with input
or
⎕×1E¯4⊥⌽⍎2⌽7↑2↓⍕⎕TS

⎕TS is 2016 3 14 12 34 56 789, i.e. March 14rd, 2016 right before 12:35 pm
⍕ make into string, i.e. '2016 3 14 12 34 56 789'
7↑2↓ drop first two ('20') then take next seven ('16 3 14')
2⌽ rotate two characters, giving ' 3 1416'
⍎ make into numbers (3 1416)
⌽ reverse the list, giving 1416 3
1E¯4⊥ evaluate in base ¹⁄₁₀₀₀₀, = 1416 × 0.01¹ + 3 × 0.01⁰ = 0.1416 + 3 = 3.1416
⎕× multiply with input

How does this work?

@OldBunny2800 Clear?

Yes, thank you, but in UTF-8 this is 38 bytes.

@OldBunny2800 http://meta.codegolf.stackexchange.com/questions/5878/what-character-encodings-may-a-submission-use

What encoding is APL in?

@OldBunny2800 APL uses its own code page -- each of these characters are one byte. (This was before ASCII mind you...)

JavaScript ES6, 68 66 bytes
Saved 2 bytes thanks to dev-null!
x=>x*((a=new Date).getMonth()+1+"."+a.getDate()+(a.getYear()-100))

Anonymous function. Some uses:
f(1)    == 3.1416
f(5)    == 15.708
f(f(2)) == 19.73930112

You should try using with

Tcl/Tk, 58 bytes
puts [expr {[gets stdin]*[clock f [clock se] -f %N.%d%g]}]

(That's a complete program. If you want to cheat and remove the explicit puts statement then it's only 51 bytes -- you'd have to start tclsh and type/paste the following in directly, though:)
expr {[gets stdin]*[clock f [clock se] -f %N.%d%g]}

MATL, 17 bytes
Z'2$'mm.ddyy'XOU*

Try it online!
Z'              % get current date and time as float
2$'mm.ddyy'XO   % format as a string with custom format
U               % convert to number
*               % multiply by implicit input

Java 114 bytes
public double p(double d){
  return (d*Double.parseDouble(new SimpleDateFormat("MM.ddyy").format(new Date())));
}

96 bytes: float p(float d){return d*Float.parseFloat(new SimpleDateFormat("MM.ddyy").format(new Date()));}

Racket, 112 characters
(define d(seconds->date(current-seconds)))(*(read)(+(date-month d)(*(date-day d).01)(*(-(date-year d)2e3)1e-4)))

Reads the number from input in standard reader syntax.

TI-84 Basic, 30 bytes
Works on TI-83/84 calculators; E is the scientific notation token and ~ is the negative token.
Prompt D:getDate:D(Ans(2)+E~4Ans(1)-.2+.01Ans(3

Test Case
D=?3
          9.4248

R 48 bytes
d*as.double(format(Sys.Date(),format="%m.%d%y"))

TI-BASIC, 16 13 9 bytes
Xround(π,1+min(getDate

We round π to a number of decimal places equal to the minimum of {month,day,year}, and then multiply it by the input.
This is a function that takes input through X. Store it to one of the Y-variables, for example Y1, and then call like Y1([number]) on the homescreen.

There seems to be some disagreement that taking input via Ans is allowed.

How is this only 13 bytes? Not counting Input A, I count 22 characters.

@OldBunny2800 TI-BASIC is token based, each atom is represented as one or two bytes.

@OldBunny2800 The code page is here.

VBScript, 88 bytes
D=Date
MsgBox(WScript.Arguments(0)*(Month(D)+CDbl("."+CStr(Day(D))+CStr(Year(D)-2000))))

I can probably save some bytes by using an input box instead. Call it like argument_name arg.

Doesn't VBScript implicitly convert to String?

@DDPWNAGE I don't think it does.

Mouse-2002, 45 bytes
&MONTH 10000*&DOM 100*+&YEAR 2000-+0.0001*?*!

Sample use:
> &MONTH 10000*&DOM 100*+&YEAR 2000-+0.0001*?*!
5
15.708

Explanation:

We're going to take the current month, day and year and turn them to a decimal.
First, we need to add 3 * 10000, 14 * 100 and 2016 - 2000, to get one number we can work with.
Next, we'll need to multiply this integer (31416) by 0.0001 to get 3.1416.
Then, we'll ask for a number as input ?, multiply by 3.1416 and print the result.

Groovy, 41 characters
{it*(new Date().format('M.dyy')as float)}

Sample run:
groovy:000> ({it*(new Date().format('M.dyy')as float)})(3)
===> 9.424799680709839

Julia, 40 bytes
d->(float)(strftime("%m.%d%y",time()))*d

Sample run:
julia> (d->(float)(strftime("%m.%d%y",time()))*d)(3)
9.4248

jq, 36 bytes
(now|strftime("%m.%d%y")|tonumber)*.

Sample run:
bash-4.3$ jq '(now|strftime("%m.%d%y")|tonumber)*.' 3
9.4248

On-line test

FORTH,  64 bytes
: p time&date 100 mod -rot 100 * + 100 * + 4 roll * 10000 / . ;

The result is rounded to the nearest integer.
Usage:  10 p prints 31

Factor, 120 151 80 84 76 bytes
Holy cats, I love this language.
now "%m.%d" strftime now "%Y" strftime 2 tail append [ string>number ] bi@ *

Point-free, so expects the number on the stack:
(scratchpad) : roundpi ( n -- i ) now "%m.%d" strftime now "%Y" strftime 2 tail append [ string>number ] bi@ * ;
(scratchpad) 3 roundpi print
9.454800000000001

Translation of: Mouse.

source: Stack Exchange

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

sort: votes


text:
There's an ant on my Rubik's Cube
A standard, solved, 3×3×3 Rubik's Cube has 6 differently colored faces, where each face is a 3×3 grid of squares of one color. The white face is opposite the yellow, the red opposite orange, the blue opposite green, and when white points upward, red is to the left of blue:

Imagine an ant sits on the center square of the white face, facing the red face. You can give him 3 commands:

Forward (^) - take a step in the direction he's facing to the next grid square, stepping over an edge of the cube if necessary.
Right (>) - rotate to the right (clockwise) by 90°, staying in the same grid square.
Left (<) - rotate to the left (counter-clockwise) by 90°, staying in the same grid square.

Given an arbitrary list of commands, find the colors of the squares that the ant visits (not including the white starting square).

For example, the command sequence ^^>^^<^^^ has a path that looks
  like this:

The colors of the grid squares visited in order, not counting the
  starting square, are white red red green green green yellow,
  or just wrrgggy.

Write a program or function that takes in a string of the command characters <^> and prints or returns a string of the characters wyrobg (white, yellow, red orange, blue, green) that corresponds to the ant's path over the cube.
The shortest code in bytes wins. Tiebreaker is earlier answer.
Notes

The cube is in midair and the ant has effective pulvilli, so he can traverse the whole of the cube.
The cube always remains in its solved state.
A square's color is only recorded upon movement into the square, not rotation. The starting white square should not be recorded.
A single optional trailing newline may be present in the input and/or output.

Test Cases
input : output
[empty string] : [empty string]
^ : w
< : [empty string]
> : [empty string]
><><<<>> : [empty string]
>^ : w
<<^> : w
^<^<^<^< : wwww
^^ : wr
<^^ : wb
>><<<<^^ : wo
<^^^<^^^^<>^>^^>^ : wbbboooggyo
^^^^^^^^^^^^^^ : wrrryyyooowwwr
<<<^<^>^<^<^<^>^^^^<^>>>>>^^<^>^^<^>^>^>^>< : wwgrwgggoooobbbbyrby
^^>^^<^^^ : wrrgggy

What is it with ants on cubes?

@matt yes, thats normal for most challenges

@MartinBüttner Ants have six legs, cubes have six sides.  I dunno...

This is not a starter golfing challenge..... I'm losing my mind coming up with a coordinate system that is not hard coded.

@DigitalTrauma This challenge is screaming for a Hexagony answer :-)

I am so close with the worst PowerShell code you have ever seen.

I really want to be better at geometry so I can traverse a sphere in radians and project that result onto a cube.  I feel like that's the easiest solution.

.... This is basically traversing a regular 54-hedron

@NotthatCharles: There is no regular 54-hedron. Different faces border different numbers of sides.

Perl, 156 143 134 128 127 125 120 119 117 113 109 bytes
Includes +1 for -p
Run with the control string on STDIN, e.g.
perl -p rubic.pl <<< "^^>^^<^^^"

rubic.pl:
@1=wryobg=~/./g;s##$n=w&$&;$y+=$x-=$y+=$x,@1[0,4,2,5,3,1]=@1while--$n%9;@{$n&&--$y%3}[3,0..2]=@1;$1[$n+9]#eg

Explanation
Older version:
@f=gboyrw=~/./g;s##$n=w&$&;$y+=$x-=$y+=$x,@f=@f[2,4,1,3,0,5]while--$n%9;@f=@f[0,$y=1,5,2..4]if$n&&$y--<0;$f[$n+8]#eg

The challenge of this question is to find a coordinate system that makes it easy to track the position and direction of the ant and to still easily get the face identity.
The system I chose was to put standard (x,y) coordinates on the face the ant is on such that the ant is always facing in the negative y direction with the center of the face being (0,0). So:
rotate right: (x',y') <- (-y,  x)
rotate left:  (x',y') <- ( y, -x)  alternatve: 3 right rotations
Step forward:   y' <- y-1

If y was already -1 the ant will leave the current face and step onto the next one. In the new coordinate system there x keeps its value, but y' becomes 1.
This gives an easy coordinate system within a face. I also need something for the faces themselves. There I use an array consisting of
The face to right of the ant            g in the initial position
The face to the left of of the ant      b
The face behind the ant                 o
The face opposite to the ant            y
The face before the ant                 r
The face the ant is on                  w

So the initial array is (g,b,o,y,r,w). Moving to the next face corresponds to rotating the last 4 elements, so moving from white to red makes this (g,b,w,o,y,r). Turning right is a permutation of the first 5 elements giving (o,r,b,y,g,w). Turning left is a simular permutation but can also be done by turning right 3 times, so applying this permutation 3 times. And not turning at all can also be done by applying the permutation 8 times. In fact turning right can also be done by applying the permutation 5 times.
Knowing this the program is rather simple:
@f=gboyrw=~/./g                 Set up the initial face orientation
s## ... #eg                     Process each control string character
                                {this is equivalent to s#.#...#eg because
                                the empty regex repeats the last
                                succesful regex)
$n=w&$&                         Calculate n, the number of right
                                rotations+1 modulo 9.
                                This abuses a coincidence of the control
                                characters:
                                 "<" & "w" = "4" -> 3 right rotations
                                 ">" & "w" = "6" -> 5 right rotations
                                 "^" & "w" = "V" = 0 but that is 9 mod 9
                                 so leads to 8 right rtations

$y+=$x-=$y+=$x,                 This is the same as ($x,$y)=(-$y,$x), so
                                a right rotation of the face coordinates
@f=@f[2,4,1,3,0,5]              Right rotation of the face array
   while --$n%9                 Rotate right n-1 times. After this n=0
                                If this was a step then n was effectively 0.
                                So rotate right 8 times leaving n=-9

    ... if $n                   If a step...
               $y--             ... decrease y ...
             &&$y--<0           ... but if y was already negative ...
@f=@f[0,$y=1,5,2..4]            ... change face and set y to 1

$f[$n+8]                        return the last element (current face)
                                if this was a step, otherwise empty

So for that last statement rotations lead to the empty string and steps forward lead to the current face. Therefore $_ gets replaced by the faces visited on each step.

If I understand what's going on here, that @1 bit is an amazing abuse of what looks like a horrific language feature.

@NotthatCharles Yes, it's exactly as evil as it looks. In serious perl programs the first thing you do is turn off that feature using use strict. Thanks for the modulo 3 by the way.

Brachylog, 287 bytes
:1:2222:"w":"y":["r":"b":"o":"g"]{h""|[L:I:N:A:B:[C:D:E:F]]hhM("^",(NhI,CwX,EY,B:D:A:FZ;AwX,BY,[C:D:E:F]Z),NhJ,(I1,2313O;I2,(Nh2,N$($(O;Nh1,2222O;Nbh1,3223O;3322O);3322N,2332O;3223N,2233O;2233N,3132O;2332N,3231O);IJ,AX,BY,(M"<",[C:D:E:F]$(Z,N$(O;M">",[C:D:E:F]$)Z,N$)O)),Lb:J:O:X:Y:Z:1&}

Expects a string containing the moves as Input, and no Output, e.g. brachylog_main("^^>^^<^^^",_). will write wrrgggy to STDOUT.
Explanation
§ There are 3 types of tiles we can be on: centers (noted 1), edges (2) and corners (3)
§ When we are on a tile, we can denote adjacent tiles in order: front, left, back, right
§ Similarly, we can denote the adjacent colors depending on the current one of the face
§
§ We start on the center (1) of face white ("w"). The adjacent tiles are 4 edges (2222)
§ The adjacent colors of white are red, blue, orange and green ("r":"b":"o":"g")
§ Yellow is opposite of white ("y")

§ We pass those initial conditions in an array, with the sequence of moves as first
§ element, as input to subpredicate 1

:1:2222:"w":"y":["r":"b":"o":"g"]{...}

§ SUB-PREDICATE 1

h""  § If the sequence of moves is empty, terminate the recursion
|    § Else...

§ Here are the variables' names of the input (which correspond to what's described in
§ the first few paragraphs)
[L:I:N:A:B:[C:D:E:F]]

§ If the move is "^"...
hhM("^",

   § The only way we change from one face to another is if the tile we end up on is of the
   § same type as the tile we started from
   (NhI,      § If this is the case
    CwX,      § Then write the color of the face we're facing, this face will now be the
              § current color
    EY,       § The third color in the list is now the opposite color
    B:D:A:FZ  § The opposite color is now the one we face, the color behind us (the third
              § in the list) is the one we were on, and the other 2 don't change

    § If the tiles are not the same type, then we don't change color
    ;
    AwX,         § Write the current color, this will remain the color
    BY,          § Opposite color stays the same
    [C:D:E:F]Z), § Other colors stay in the same order since we moved forward
    NhJ,              § The new tile type is the one we were facing
       (I1,2313O;     § If we were on the center, then the adjacent tiles are 2313
       I2,            § Else if we were on an edge
         (Nh2,N$($(O; § then if we were facing an edge (changed face), then the new types
                      § of tiles are a double circular permutation of the previous types
         Nh1,2222O;   § Else if we were facing a center, then the new tiles are 2222
         Nbh1,3223O;  § Else (corners) if the tile to our left is the center, then 3223
         3322O)       § Else 3322

       ;              § Else if we were on a corner
       3322N,2332O;   § then one of those 4 possibilities applies
       3223N,2233O;
       2233N,3132O;
       2332N,3231O)

§ Else if the move is NOT "^"
;
IJ,AX,BY,         § We stay on the same type of tile, same color, same opposite color
(M"<",            § if the move is "turn left"
    [C:D:E:F]$(Z, § Then we circular permute the adjacent colors to the left
    N$(O          § we also circular permute the adjacent tiles to the left
;M">",            § Else if the move is "turn right"
    [C:D:E:F]$)Z, § Then we do the same but with right circular permutations
    N$)O)
),
Lb:J:O:X:Y:Z:1&   § Recursively call sub-predicate 1 with the new input, and the next move

Equivalent SWI-Prolog code
If you don't want to bother with Brachylog's compiler, you can run this solution in SWI-Prolog using the following code (this is what gets generated by Brachylog's compiler):
:- style_check(-singleton).

:- use_module(library(clpfd)).

brachylog_main(Input,Output) :-
    1=1,
    brachylog_subpred_1([Input,1,2222,"w","y",["r","b","o","g"]],V0).

brachylog_subpred_1(Input,Output) :-
    1=1,
    brachylog_head(Input, "").

brachylog_subpred_1(Input,Output) :-
    1=1,
    [L,I,N,A,B,[C,D,E,F]] = Input,
    brachylog_head([L,I,N,A,B,[C,D,E,F]], V0),
    brachylog_head(V0, M),
    ( 1=1,
    "^" = M,
    ( 1=1,
    brachylog_head(N, I),
    brachylog_write(C, X),
    Y = E,
    Z = [B,D,A,F]
    ;
    1=1,
    brachylog_write(A, X),
    Y = B,
    Z = [C,D,E,F]
    ),
    brachylog_head(N, J),
    ( 1=1,
    I = 1,
    O = 2313
    ;
    1=1,
    I = 2,
    ( 1=1,
    brachylog_head(N, 2),
    brachylog_math_circular_permutation_left(N, V1),
    brachylog_math_circular_permutation_left(V1, O)
    ;
    1=1,
    brachylog_head(N, 1),
    O = 2222
    ;
    1=1,
    brachylog_behead(N, V2),
    brachylog_head(V2, 1),
    O = 3223
    ;
    1=1,
    O = 3322
    )
    ;
    1=1,
    N = 3322,
    O = 2332
    ;
    1=1,
    N = 3223,
    O = 2233
    ;
    1=1,
    N = 2233,
    O = 3132
    ;
    1=1,
    N = 2332,
    O = 3231
    )
    ;
    1=1,
    J = I,
    X = A,
    Y = B,
    ( 1=1,
    "<" = M,
    brachylog_math_circular_permutation_left([C,D,E,F], Z),
    brachylog_math_circular_permutation_left(N, O)
    ;
    1=1,
    ">" = M,
    brachylog_math_circular_permutation_right([C,D,E,F], Z),
    brachylog_math_circular_permutation_right(N, O)
    )
    ),
    brachylog_behead(L, V3),
    brachylog_call_predicate([V3,J,O,X,Y,Z,1], V4).

brachylog_behead(X,Y) :-
    string(X),!,
    sub_string(X, 1, _, 0, Y)
    ;
    number(X),!,
    number_codes(X,[_|T]),
    catch(number_codes(Y,T),_,Y=[])
    ;
    atom(X),!,
    atom_codes(X,[_|T]),
    atom_codes(Y,T)
    ;
    X = [_|Y].

brachylog_math_circular_permutation_left(X,Y) :-
    string(X),!,
    string_codes(X,C),
    C = [H|T],
    append(T,[H],D),
    string_codes(Y,D)
    ;
    number(X),!,
    number_codes(X,C),
    C = [H|T],
    append(T,[H],D),
    number_codes(Y,D)
    ;
    atom(X),!,
    atom_codes(X,C),
    C = [H|T],
    append(T,[H],D),
    atom_codes(Y,D)
    ;
    X = [H|T],!,
    append(T,[H],Y).

brachylog_math_circular_permutation_right(X,Y) :-
    string(X),!,
    string_codes(X,C),
    append(T,[H],C),
    D = [H|T],
    string_codes(Y,D)
    ;
    number(X),!,
    number_codes(X,C),
    append(T,[H],C),
    D = [H|T],
    number_codes(Y,D)
    ;
    atom(X),!,
    atom_codes(X,C),
    append(T,[H],C),
    D = [H|T],
    atom_codes(Y,D)
    ;
    append(T,[H],X),
    Y = [H|T].

brachylog_call_predicate(X,Y) :-
    reverse(X,R),
    R = [N|RArgs],
    number(N),
    reverse(RArgs, Args),
    (
    N = 0,!,
    Name = brachylog_main
    ;
    atom_concat(brachylog_subpred_,N,Name)
    ),
    (
    Args = [UniqueArg],!,
    call(Name,UniqueArg,Y)
    ;
    call(Name,Args,Y)
    ).

brachylog_write(X,Y) :-
    X = [List,Format],
    is_list(List),
    string(Format),!,
    format(Format,List),
    flush_output,
    Y = List
    ;
    write(X),
    flush_output,
    Y = X.

brachylog_head(X,Y) :-
    string(X),!,
    sub_string(X, 0, 1, _, Y)
    ;
    number(X),!,
    number_codes(X,[A|_]),
    number_codes(Y,[A])
    ;
    atom(X),!,
    atom_codes(X,[A|_]),
    atom_codes(Y,[A])
    ;
    X = [Y|_].

PowerShell, 882 bytes
Usage
Save the code in a script and call it like this from the command line. Assuming working directory is the current directory.
.\WalkingAntcg.ps1 "^^>^^<^^^"

Code
$o=[char[]]"grbowy";[int]$c=4;[int]$global:x=1;[int]$global:y=1;[int]$f=1;[int]$n=5;
$u={$c=$args[0];$1="341504251435240503210123".Substring($c*4,4);$2=$1*2-match".$($args[1]).";$3=$Matches[0];"$3";"012345"-replace([char[]]"$1$c"-join"|")}
function t{param($o,$x,$y)if($o){switch($y){0{switch($x){0{$x=2}1{$y=1;$x=2}2{$y=2}}}1{switch($x){0{$y=0;$x=1}2{$y=2;$x=1}}}2{switch($x){0{$x=0;$y=0}1{$x=0;$y=1}2{$x=0}}}}}else{switch($y){0{switch($x){0{$y=2}1{$x=0;$y=1}2{$x=0}}}1{switch($x){0{$y=2;$x=1}2{$y=0;$x=1}}}2{switch($x){0{$x=2}1{$x=2;$y=1}2{$y=0;$x=2}}}}}$global:x=$x;$global:y=$y}
([char[]]$args[0]|%{switch($_){'^'{$global:y++;if($global:y-eq3){$global:y=0;$c="$f";$f="$n";$z=&$u $c $f;$f,$n="$($z[0][1])","$($z[1])"}$o[$c]}
"<"{$z=&$u $c $f;$f,$n="$($z[0][0])","$($z[1])";t 0 $global:x $global:y}
">"{$z=&$u $c $f;$f,$n="$($z[0][2])","$($z[1])";t 1 $global:x $global:y}}})-join""

Less golfed code with explanation
# Recorded order of cube colours and their indexes
# Green=0,Red=1,Blue=2,Orange=3,White=4,Yellow=5
$o=[char[]]"grbowy"
[int]$c=4   # Ant is currently on this colour
[int]$global:x=1   # X coordinate on this face
[int]$global:y=1   # Y coordinate on this face
[int]$f=1   # Colour that the Ant is facing
[int]$n=5   # Colour beyond that the ant is facing.
# If the ant moves of this cube to the next this value becomes the one he is facing.
# It is also the only colour not neighboring this current colour.

# Anonymous function that will return the colour facing left and right
$u = {
# Cube relationships relative to position. Groups of 4 colours that are important given the order...
# Green=0-3,Red=4-7,Blue=8-11,Orange=12-15,White=16-19,Yellow=20-23
# Get the colours surrounding the current colour we are on and the surrounding ones
# String version: "owrygwbyrwoybwgygrbogrbo"
$c=$args[0]
#  "341504251435240501230123"
$1="341504251435240503210123".Substring($c*4,4)
# double the string so that we can get the characters before and after the facing colour reliably
# Assign the output to surpress a boolean. $2 is not used. Shorter than a cast
$2=$1*2-match".$($args[1]).";$3=$Matches[0]
# Return two values. First is the colours to the left,current and right as a string.
# Second is the colour beyond the one we are facing. If we were to move forward two blocks
# we would end up on this colour
"$3";"012345"-replace([char[]]"$1$c"-join"|")
}

# function that will transpose the ants position based on right/left rotation.
# Using current x and y determines what the tranposed values are and return them.
function t{
    param($o,$x,$y)
    # X = $1; Y = $2
    # Left 0 Right 1
    if($o){
        # Right Transpose
        # All values are hard coded to rotate to their new positions
        switch($y){
            0{switch($x){0{$x=2}1{$y=1;$x=2}2{$y=2}}}
            # 1,1 is in the center and nothing changes
            1{switch($x){0{$y=0;$x=1}2{$y=2;$x=1}}}
            2{switch($x){0{$x=0;$y=0}1{$x=0;$y=1}2{$x=0}}}
        }
    }else{
        # Left Transpose
        # All values are hard coded to rotate to their new positions
        switch($y){
            0{switch($x){0{$y=2}1{$x=0;$y=1}2{$x=0}}}
            # 1,1 is in the center and nothing changes
            1{switch($x){0{$y=2;$x=1}2{$y=0;$x=1}}}
            2{switch($x){0{$x=2}1{$x=2;$y=1}2{$y=0;$x=2}}}
        }

    }
    # Update global variables with the ones from this function
    $global:x=$x
    $global:y=$y
}

# Process each character passed by standard input
([char[]]$args[0]|%{
    switch($_){
        # Moving Forward
        '^'{
        $global:y++
        if($global:y-eq3){
            # We have walked of the colour onto the next one. Update coordinates to the next colour
            $global:y=0
            $c="$f"
            $f="$n"
            # Get the new neighboring colour indexes
            $z=&$u $c $f
            $f,$n="$($z[0][1])","$($z[1])"
        }
        # Output the colour we have just moved to.
        $o[$c]
        }
        # Turn Left
        "<"{$z=&$u $c $f;$f,$n="$($z[0][0])","$($z[1])"
        # Transpose the ants location by passing current location to the transposition function.
        t 0 $global:x $global:y
        }
        # Turn Right
        ">"{$z=&$u $c $f;$f,$n="$($z[0][2])","$($z[1])"
        # Transpose the ants location by passing current location to the transposition function.
        t 1 $global:x $global:y
        }
    }
}) -join ""
# Line above converts the output to a single string.

Using a lot of single letter variables used to records the ant current state (colour,position and orientation). The ant is always facing up. When a rotate instruction is read the cube is transposed in that direction. Hardcoded transposition matrices used to determine new position based on current position.
Code satisfies all examples in question.

This can be golfed more but it works now so I need to try and remove some of the repetition now.

Tcl/Tk, 422 bytes
rename split S
array se {} [S wyywroorgbbg {}]
proc R a {foreach x [lassign $a y] {lappend b $x}
lappend b $y}
proc < {V H} {set ::H $V
set ::V [lreverse [R $H]]}
proc > {V H} [string map {V H H V} [info b <]]
proc ^ {V H} {
lassign $V x
lassign [set ::V [R $V]] y
set ::H [string map "$x $y $::($x) $::($y)" $::H]
puts -nonewline $y}
set V [S wwrrryyyooow {}]
set H [S wwgggyyybbbw {}]
foreach p [S {*}$argv {}] {$p $V $H}

Alas, I can't get it any smaller. Non-obfuscated version:
array set opposites [split wyywroorgbbg {}]

proc lrotate xs {
  foreach x [lassign $xs y] {
    lappend ys $x
  }
  lappend ys $y
}

proc < {V H} {
  set ::H $V
  set ::V [lreverse [lrotate $H]]
}

proc > {V H} {
  set ::H [lreverse [lrotate $V]]
  set ::V $H
}

proc ^ {V H} {
  lassign $V x
  lassign [set ::V [lrotate $V]] y
  set ::H [string map [list $x $y $::opposites($x) $::opposites($y)] $::H]
  puts -nonewline $y
}

set V [split wwrrryyyooow {}]
set H [split wwgggyyybbbw {}]
foreach p [split {*}$argv {}] {$p $V $H}
puts {}

It works by maintaining a list of horizontal and vertical cell colors. ^ < and > are all commands that properly permute the lists. The current cell is the first in each list.

Ruby, 132
m=?w
g="bgoyr"
x=z=1
gets.bytes{|c|(m,g[2,3]=g[4],m+g[2,2]if(x+=1)%3<1
$><<m)if 93<c.upto(64){x,z,g=2-z,x,g[4]+g[2]+g[0]+g[3]+g[1]}}

This position system is sadly very similar to other answers out there.  x and z track your position on the current face with +x being the direction of travel.  Forward is always x+=1, and the bounds of each face are divisible by 3 (we don't care the number, just its modulus with 3).
m is the current face (this saves some bytes)
g is arranged [left, right, behind, opposite, front] so that we don't need to change g[0..1] on ^
< is done simply by doing > three times.

Java, 619 605 534 517 485 bytes
Well, here goes nothing...
At least it beat powershell!
-14 bytes thanks to @KevinCruijssen
And over 6 years later, -71 bytes (wow!) thanks to @ceilingcat . Try It Online!
And less than a year after that, @ceilingcat saved another 17 bytes. Try It Online!
OK @ceilingcat saved another 32 bytes, marking this as community wiki so they can make further edits. Try It Online!
String t(String f){int h[]={0,0,1},p[]={0,2,0},n[],i,s,r;String o="";for(int c:f.toCharArray()){r=r(p);n=h;if(c==94){for(s=i=3;i-->0;)if(h[i]==p[i]&p[i]!=0){s=i;n[1]=r<1?-1:r>4?1:n[1];i=2-r;if(i*i==1)n[0]=i;if(++i*i==1)n[2]=-i;i=0;}for(int a:n)p[++i]+=a;if(s<3)h[s]=0;o+="wgrboy".toCharArray()[r(p)];}i=r==3|r==5?2:r>0&r<3?1:0;r=h[s=r>-1&r<2?2:r>2&r<5?1:0];c-=61;if(c*c==1){h[s]=r==0?h[i]*c:0;h[i]=-r*c;}}return o;}int r(int[]p){return-1>p[0]?1:p[0]>1?3:p[1]>1?0:p[1]<-1?5:p[2]>1?2:4;}

Explanation:
Unlike some of the other answers, which used used a 2-d coordinate system, I used a 3-d system to keep track of where the ant was.
The direction was also kept in a 3-d fashion to facilitate switching sides and movement.
Each face had one of the coordinates, x, y, or z, be set to 2 (or -2 for the opposite face) to signify which face it was.
Switching faces was accomplished by checking if the ant was about to go off (position and heading have a value that is same, but not 0), make sure it would "fall off" diagonally onto the next, and change the heading to be non-diagonal. This was surprisingly easy.
Turning was more difficult. Making sure it would always go the same direction required an extra if-else statement inside the check for each character, costing me many bytes. In addition, the "up" and "right" axes had to be hard-coded in for each side.
Original ungolfed code
(Unchanged from previous edits for clarity in method)
private static String[] sides="w,g,r,b,o,y".split(",");
public static String traverse(String commands)
{
  int[] heading = {0,0,1};
  int[] pos = {0,2,0};
  int[] newheading;
  int i;
  int saved;
  String out = "";
  for(char command:commands.toCharArray())
  {
     if(command=='^')
     {
        newheading=heading;
        saved=3;
        for(i=0;i<3;i++)
        {
           if(heading[i]==pos[i]&pos[i]!=0)
           {
              saved=determineSide(pos);
              if(saved==0)newheading[1]=-1;
              if(saved==1)newheading[0]=1;
              if(saved==2)newheading[2]=-1;
              if(saved==3)newheading[0]=-1;
              if(saved==4)newheading[2]=1;
              if(saved==5)newheading[1]=1;
              saved=i;
              break;
           }
        }
        i=0;
        for(int c:newheading)
        {
           pos[i++]+=c;
        }
        if(saved<3)heading[saved]=0;
        out+=sides[determineSide(pos)];
     }
     newheading=getPlane(determineSide(pos));
     if(command=='>')
     {
        saved=heading[newheading[0]];
        if(saved==0)
        {
           heading[newheading[0]]=heading[newheading[1]];
           heading[newheading[1]]=0;
        }
        else
        {
           heading[newheading[1]]=-saved;
           heading[newheading[0]]=0;
        }
     }
     if(command=='<')
     {
        saved=heading[newheading[0]];
        if(saved==0)
        {
           heading[newheading[0]]=-heading[newheading[1]];
           heading[newheading[1]]=0;
        }
        else
        {
           heading[newheading[1]]=saved;
           heading[newheading[0]]=0;
        }
     }
  }
  return out;
}
public static int determineSide(int[] pos)
{
  return pos[0]==2?3:pos[0]==-2?1:pos[1]==2?0:pos[1]==-2?5:pos[2]==2?2:4;
}
public static int[] getPlane(int side)
{
  int[] out=new int[2];
  out[0]=side==0|side==1?2:side==3|side==4?1:0;
  out[1]=side==3|side==5?2:side==1|side==2?1:0;
  //side==0?{2,0}:side==1?{2,1}:side==2?{0,1}:side==3?{1,2}:side==4?{1,0}:{0,2};
  return out;
}

That hurts.... I vow to try and out golf this now! :)

I know this was posted over a year ago, but there are some small things to golf: d[]={"w","g","r","b","o","y"} -> "w,g,r,b,o,y".split(",") (-1 byte); 2x '^' -> 94 (-2 bytes); 3x ==0 -> <1 (-3 bytes); 2x ==1 -> <2 (-2 bytes); etc for ==2, ==3, ==4, ==5.

@KevinCruijssen Thank you for the tips!

@ceilingcat oh wow thanks!! have no idea how you found this but this is a good golf, clever uses of assignments as expressions

all_licenses: 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/


text:
Print the difference in the Thue-Morse sequence
Note, when I say "negate", I mean replace all ones with zeroes (i.e. a bitwise negation)
The Thue-Morse sequence goes like 01101001
The way you generate it is:
Start by taking 0.
Negate what is left and append it to the end.
So, take 0. Negate it and add that to the end - 01
Then take that and negate it and add that to the end - 0110
And so on.
Another interesting property of this is that distance between zeros creates an "irrational" and non-repeating string.
So:
0110100110010110
|__|_||__||_|__|
 2  1 0 2 01 2          <------------Print this!

Can you write a program that, when input n, will output the first n digits of the string to printed?
This is code golf, so shortest number of bytes wins!

Not requiring a specific base for the output seems loopholey. The Thue-Morse sequence itself is the desired output, in unary and with 0 as separator.

https://oeis.org/A036577

Jelly, 9 bytes
;¬$‘¡TI’ḣ

Try it online!
How it works
;¬$‘¡TI’ḣ  Main link. Argument: n

  $        Create a monadic chain that does the following to argument A (list).
 ¬         Negate all items of A.
;          Concatenate A with the result.
   ‘¡      Execute that chain n + 1 times, with initial argument n.
     T     Get all indices of truthy elements (n or 1).
      I    Compute the differences of successive, truthy indices.
       ’   Subtract 1 from each difference.
        ḣ  Keep the first n results.

Python 3 2, 104 92 88 84 bytes
This is a pretty rudimentary solution based on building a ternary Thue-Morse sequence from scratch. This sequence is identical to the one being asked, though someone else will have to write a more thorough explanation of why that is. At any rate, this sequence is only a trivial modification of this one, A036580.
Edit: Changed the for loop into a list comprehension, changed from a function to a program, and changed the whole thing to Python 2. Thanks to Dennis for golfing help.
n=input()
s="2"
while len(s)<n:s="".join(`[1,20,210][int(i)]`for i in s)
print s[:n]

Mathematica, 79 68 70 bytes
(Differences[Join@@Position[Nest[#~Join~(1-#)&,{0},#+2],0]]-1)[[;;#]]&

Fails for n<3.

Julia, 56 50 bytes
n->(m=1;[m=[m;1-m]for _=0:n];diff(find(m))[1:n]-1)

This is an anonymous function that accepts an integer and returns an integer array. To call it, assign it to a variable.
We generate the bit-swapped Thue-Morse sequence by starting with an integer m = 1, then we append 1-m to m as an array n+1 times, where n is the input. This generates more terms than we need. We then locate the ones using find(m), get the difference between consecutive values using diff, and subtract 1 elementwise. Taking the first n terms of the resulting array gives us what we want.
Saved 6 bytes and fixed an issue thanks to Dennis!

MATL, 14 11 bytes
Q:qB!Xs2\dQ

Try it online!
As pointed out by @TimmyD in his answer, the desired sequence is given by the consecutive differences of A001969. The latter can in turn be obtained as the Thue-Morse sequence plus 2*n. Therefore the desired sequence is given by the (consecutive differences of the Thue-Morse sequence) plus one.
On the other hand, the Thue-Morse sequence can be obtained as the number of ones in the binary representation of n, starting from n=0.
Q:q    % take input n implicitly and generate row vector [0,1,...,n]
B!     % 2D array where columns are the binary representations of those numbers
Xs     % sum of each column. Gives a row vector of n+1 elements
2\     % parity of each sum
d      % consecutive differences. Gives a row vector of n elements
Q      % increase by 1. Display implicitly

May I request parenthesization in (consecutive differences of the Thue-Morse sequence) plus 1?

@CatsAreFluffy You are totally right. Done

PowerShell, 102 bytes
filter x($a){2*$a+([convert]::toString($a,2)-replace0).Length%2}
0..($args[0]-1)|%{(x($_+1))-(x $_)-1}

A little bit of a different way of computing. PowerShell doesn't have an easy way to "get all indices in this array where the value at that index equals such-and-such", so we need to get slightly creative.
Here we're using A001969, the "numbers with an even number of 1s in their binary expansion", which completely coincidentally gives the indices of the 0s in the Thue-Morse sequence. ;-)
The filter calculates that number. For example, x 4 would give 9. We then simply loop from 0 to our input $args[0], subtracting 1 because we're zero-indexed, and each iteration of the loop print out the difference between the next number and the current number. Output is added onto the pipeline and implicitly output with newlines.
Example
PS C:\Tools\Scripts\golfing> .\print-the-difference-in-the-thue-morse.ps1 6
2
1
0
2
0
1

The relation with A001969 is a great finding!

Haskell, 42 bytes
l=2:(([[0..2],[0,2],[1]]!!)=<<l)
(`take`l)

Usage example: (`take`l) 7 -> [2,1,0,2,0,1,2].
It's an implementation of a036585_list from A036585 shifted down to 0, 1 and 2. Golfing: concat (map f l) is f =<< l and f 0=[0,1,2]; f 1=[0,2]; f 2=[1] is ([[0..2],[0,2],[1]]!!).
Note: l is the infinite sequence. It takes 10 bytes or about 25% to implement the take-first-n-elements feature.

05AB1E, 14 13 bytes
Code:
ÎFDSÈJJ}¥1+¹£

Explanation:
Î              # Push 0 and input
 F     }       # Do the following n times
  DS           # Duplicate and split
    È          # Check if even
     JJ        # Join the list then join the stack
        ¥1+    # Compute the differences and add 1
           ¹£  # Return the [0:input] element

Try it online!

Python, 69 bytes
t=lambda n:n and n%2^t(n/2)
lambda n:[1+t(i+1)-t(i)for i in range(n)]

The ith term of this sequence is 1+t(i+1)-t(i), where t is the Thue-Morse function. The code implements it recursively, which is shorter than
t=lambda n:bin(n).count('1')%2

CJam (19 bytes)
1ri){2b:^}%2ew::-f-

Online demo
This uses the approach of incrementing the successive differences between elements of the Thue-Morse sequence.

My shortest approach using rewriting rules is 21 bytes:
ri_2a{{_*5*)3b~}%}@*<

(Warning: slow). This encodes the rewriting rules
0  ->  1
1  ->  20
2  ->  210

as
x -> (5*x*x + 1) in base 3

JavaScript (ES6), 73 67 bytes
f=(n,s="2")=>s[n]?s.slice(0,n):f(n,s.replace(/./g,c=>[1,20,210][c]))

Port of @Sherlock9's answer.
edit: Saved 6 bytes thanks to @WashingtonGuedes.

Would !s[n] work in place of s.length<n ? Or maybe just s[n] with ?: inverted?

Perl, 45 + 2 = 47 bytes
$_=2;s/./(1,20,210)[$&]/ge until/.{@F}/;say$&

Requires the -p and -a flag:
$ perl -pa morse-seq.pl <<< 22
2102012101202102012021

Port of @Sherlock9 answer
Saved 9 bytes thanks to Ton

The -a option gives you a free copy of the input, so $_=2;s/./(1,20,210)[$&]/ge until/.{@F}/;$_=$&

@TonHospel Thats perfect, can't believe I didn't think of that :-) And I can save the -p with -E: say$& at the end if we assume that Perl > v5.18

Mathematica, 58 bytes
Differences[Nest[Join[#,1-#]&,{0},#]~Position~0][[;;#]]-1&

How do I know you didn't take my solution and golf it?

@catsarefluffy I did adapt your idea to generate the sequence (golfing it by cutting the infix operator), but felt that the method used here of transforming that into the intended output was very different and more suited to a new answer than a suggested edit.

@catsarefluffy I've just seen your edit. the last I'd seen it was in its original form when I did this. I'll remove this answer but you'll just have to trust me that it was independent :)

1;;# can be replaced with simply ;;#.

Actually I got the output transform from TimmyD's answer. (Specifically, the first paragraph made me remember about Position.)

Mathematica, 65 bytes
SubstitutionSystem[{"0"->"012","1"->"02","2"->"1"},"0",#][[;;#]]&

Beats my other answer, but doesn't beat the extra-spicygolfed version.
Now normally I stick my code in quotes, then pull it out because Mathematica loves adding spaces to your code (which do nothing) but it never messes with strings, but that doesn't work for code that itself has quotes...
Whatever, I'm just using the magic builtin for this. Output is a string.

We now have 4 Mathematica answers: My original, the nonverbal one (it's 5 if the symbolonly one counts), the extra-golfed one, and my magic builtin.

Mathematica (almost nonverbal), 107 110 bytes
({0}//.{n__/;+n<2#}:>{n,{n}/.x_:>(1-x)/._[x__]:>x}//.{a___,0,s:1...,0,b___}:>{a,+s/.(0->o),0,b}/.o->0)[[;;#]]&

The sequence is generated by repeatedly applying a replacement rule. Another rule transforms it to the desired output. If enough people are interested, I'll explain in detail.
non-alphanumeric version
({$'-$'}//.{$__/;+$/#
<($'-$')!+($'-$')!}:>
{$,{$}/.$$_:>(($'-$')
!-$$)/.{$$__}:>$$}//.
{$___,$'-$',$$:($'-$'
)!...,$'-$',$$$___}:>
{$,+$$/.($'-$'->$$$$)
,$'-$',$$$}/.$$$$->$'
-$')[[;;#]]

as suggested by CatsAreFluffy.

I think it's safe to assume that people are sufficiently interested in an explanation for just about any answer. Speaking only for myself, I don't upvote submissions without explanations (unless the approach is obvious).

And if you turn all letters into sequences of $ and replace 0 with x-x (where x is an unused sequence of $) (and use (x-x)! for 1 (ditto)), we be alphanumeric-free.

Bytesave: Use {x__} instead of _[x__]

I'm actually pretty sure that Mathematica is Turing-complete on symbols only or $[_]:=-/; (both by counter machine emulation)

Ruby, 57 bytes
A port of xnor's Python answer. The changes mostly lie in the ternary statement in t in place of the and due to 0 being truthy in Ruby, and using (1..n).map and 1+t[i]-t[i-1] to save bytes vs. importing the list comprehension directly.
t=->n{n<1?n:n%2^t[n/2]}
->n{(1..n).map{|i|1+t[i]-t[i-1]}}

0 is truthy? How does that work??

@CatsAreFluffy In my experience, poorly


text:
Translate Java methods to fields
So, recently, I found myself reformatting my code for Vitsy to using anonymous class instances for commands rather than the normal method approach. For those who don't know, anonymous class instance syntax looks something like this:
...
private abstract static class SomeClass {
    public abstract void someMethod();
}

public final SomeClass someField = new Command() {
    public void someMethod() {
        // Some implementation
    }
};
...

So what's your job, I hear you asking? Well, it's quite simple.
The Challenge
Given a class name, its inner method, and string of zero to many conventional methods, turn them into anonymous class instances, retaining the program instructions therein. For formatting purposes, I have labelled the input and output below for what must be considered (anything in <> needs to be retained in the output).
Conventional method syntax
<visibility modifier> void <method name>(){<implementation>}

Resulting instance declaration
<visibility modifier> final <class name> <method name>=new <class name>(){public void <inner method name>(){<implementation>}};

The Rules

You may not use any builtins for this challenge (if there are builtins for this, the lang creators have done a bad and they should feel bad).
You must retain the method name, the visibility modifier (public, private, (nothing), protected) and the implementation.
Do not worry about proper tabs/formatting. As long as it is Java compile-able, you're fine.
You may assume that all code inside of <implementation> is valid.
You may assume that there is nothing but methods in the string given.
Do not translate any methods that are not void.
Do not translate any methods with a parameter.
Input may be in any convenient format for your language.

Examples
>>> toAnonymousClass("ClassName", "innerMethod", "public void method1(){}")
public final ClassName method1=new ClassName(){public void innerMethod(){}};

>>> toAnonymousClass("ClassName2", "secondInnerMethod", "private void method2(){return;}protected int method3(){return 4;/*guaranteed to be random*/}")
private final ClassName2 method2=new ClassName2(){public void secondInnerMethod(){return;}};protected int method3(){return 4;/*guaranteed to be random*/}

Note here that the void method is translated with the visibility modifier (private) retained, but the int method is not translated as it has a different return type (int).
>>> toAnonymousClass("Clazz", "inMethod", "void method4(int param){}")
void method4(int param){}

method4 is not translated, as it accepts a parameter (int param).
>>> toAnonymousClass("Moar", "again", "void method5(){}")
final Moar method5=new Moar(){public void again(){}};

Another example of visibility modifier retainment - if it has no modifier, have no modifier on the output.
Finally, the big test case:
>>> toAnonymousClass("Hi", "rand", "private void method2(){return;}protected int method3(){return 4;/*guaranteed to be random*/}public void method1(){}void method4(int param){}void method5(){}")
private final Hi method2=new Hi(){public void rand(){return;}};protected int method3(){return 4;/*guaranteed to be random*/}public final Hi method1=new Hi(){public void rand(){}};void method4(int param){}final Hi method5=new Hi(){public void rand(){}};

Can the methods in input and anonymous class instances in output be separated by newlines?

@daavko Yes - "Do not worry about proper tabs/formatting. As long as it is Java compile-able, you're fine."

One more test case to consider. Regex-based approaches would probably work for the other examples but fail in the general case: void foo(){String s = ""'}\}";}int bar(){return 42;}"

Retina, 95 bytes
Byte count assumes ISO 8859-1 encoding.

+`^((.+)¶(.+)¶(.+¶)*)(\w+ )?(void )(\w+)(..{.*})
$1$5final $2 $7=new $2(){public $6$3$8};
\w+¶

The code contains a trailing newline.
Takes input separated by newlines. Class name on the first line, inner method name on the second line, methods on following lines.
For example:

Hi
rand
private void method2(){return;}
protected int method3(){return 4;/*guaranteed to be random*/}
public void method1(){}
void method4(int param){}
void method5(){}

Try it online!


text:
Convert a pawn promotion from algebraic to ICCF numeric notation
Input
A single string, which contains no whitespace, as a command-line argument.
Output
If the string is not a valid algebraic notation pawn promotion, produce no output and exit. If the string is a valid pawn promotion, convert it to ICCF numeric notation and print the result, followed by a newline.
A valid algebraic notation pawn promotion consists of:

A letter from a to h indicating the pawn's departure column (known as a "file" in chess);
Optionally, "x" followed by the file of the pawn's arrival square if it has captured a piece in promoting;
"1" or "8" depending on which side promoted; and
"=" followed by one of "Q", "R", "B", "N" to indicate the chosen piece;
Optionally, "+" to indicate the move was a check or "#" to indicate the move was a checkmate.

An valid ICCF numeric notation pawn promotion consists of:

Two digits indicating the coordinates of the square from which the pawn departed (the files are numbered and not lettered as in algebraic notation);
One digit indicating the file on which the pawn arrived, in case it has captured a piece while promoting (this does not officially comply with the standard, but I prefer keeping all moves as 4 digits for simplicity); and
One digit to indicate the chosen piece: 1 for queen, 2 for rook, 3 for bishop, 4 for knight.

Examples
e1=Q   => 5251
cxd8=B => 3743
axh8=R => no output (a-pawns cannot capture on h-file)
h8=N+  => 8784

Could we have some test cases?

@Doorknob Added.

Can we exit with an error if the input is invalid? Does # for checkmate need to be supported?

@Doorknob No, you must produce no output and exit without errors. # does need to be supported.

Why the input restriction?

JavaScript (ES6), 166 bytes
s=>(g=n=>parseInt(m[n][0],19)-9,m=s.match(/^([a-h]x)?([a-h][18]=[QRBN])[+#]?$/))?m[1]&&g(2)+~g(0)&&g(0)+~g(2)?'':''+g(0)+(m[2][1]-1|2)+g(2)+" QRBN".search(m[2][3]):''

The validation makes this horribly long. Without validation, it's only 108 bytes:
s=>s.replace(/(.x)?(..=.).*/,([a],_,[c,d,,f])=>g(a)+(d-1|2)+g(c)+" QRBN".search(f),g=f=>parseInt(f,19)-9+'')


text:
Connect the letters
Inspired by this little game.
Challenge
Given as input the initial position of a grid (always 5x5), like this:
-ABCD
-A---
---C-
---BD
--E-E

You need to connect the letters (same letters all together), removing all empty - spaces. The letters will be always A,B,C,D and E.
Every pair of letters must be connected by a single unbranched line that can bend at right angles (using the very same letter to depict the line).
The input is guaranteed to have each starting letter exactly 2 times and it will always have all starting letters A-E.
The input can be read from stdin, or one only string as arg to some function, or even an array/matriz/list of chars, the most convinient way to your coding-language.
Since this is code-golf shortest code in bytes wins!

Example
There is not only one solution to each problem, but the rules apply to all (no empty space and no separated letters). And the input is guaranteed to have at least one correct output.
Let's start connecting the letters A:
AABCD
AA---
AA-C-
AA-BD
AAE-E

Now, connecting the letters B:
AABCD
AAB--
AABC-
AABBD
AAE-E

Now, connecting the letters C:
AABCD
AABC-
AABC-
AABBD
AAE-E

Now, connecting the letters D:
AABCD
AABCD
AABCD
AABBD
AAE-E

And, finally the letters E:
AABCD
AABCD
AABCD
AABBD
AAEEE

Another Samples
input:
E--E-
BB-C-
AD---
---C-
AD---

output:
EEEEE
BBECE
ADECE
ADECE
ADEEE

input:
A----
---B-
-C-C-
-D-D-
BE-EA

output:
AAAAA
BBBBA
BCCCA
BDDDA
BEEEA

@Sp3000 not a dup, as this challenge has a guarantee of correct input.

Is the input guaranteed to have each starting letter exactly 2 times ? Will it always have all starting letters A-E ?

@TonHospel. Yes, it will always have 2 occurrences of the five letters in ABCDE

@NathanMerrill that seems like a fairly minor difference. I can't imagine that the check for solvability will would take up the majority of the code.

@MartinBüttner in my challenge, the check for solvability is the challenge, no connecting needed.  While the two challenges will have similarities, they feel drastically different in my mind.

@NathanMerrill hm, that's a good point. Still, I'm not sure there is any way to sind your challenge except trying to find a specific solution.

Who knows?  Perhaps there's some property we don't know that allows for quick checking.  Regardless, even if two challenges have similar code paths, the fact that they have different outputs makes them different challenges.

A favorite technique of mine for some questions like this is to use random numbers to fill in positions to avoid backtracking and stop if I hit a solution. That only works if a solution is guaranteed, otherwise the program can run forever (if a solution is guaranteed you can often write the code so that long runtimes get exponentially more unlikely for longer times). For this technique the questions are very different

Perl, 130 128 127 bytes
Includes +4 for -n0 (program does not work from the commandline so - and space are counted too)
Call with the input on STDIN:
perl -n0 connectletters.pl
E--E-
BB-C-
AD---
---C-
AD---

Teminate with ^D or ^Z or whatever closes STDIN on your system
connectletters.pl:
/-/?map{$_="$`$_$'";s%\pL%$_="$`0$'";1while do{s/[$&-](.{5}|)0|0(.{5}|)[$&-]/0$+0/s};/$&/||$&%eg;!/1/&&do$0}A..E:exit!print

Python3, 445 bytes
E=enumerate
def S(d,b):l=d.pop(T:=[*{*d}-{'-'}][0]);return[(T,*l[0],*({*l}-{l[0]}),{**d},eval(str(b)))]
def f(b):
 d={}
 for x,r in E(b):
  for y,v in E(r):d[v]=d.get(v,[])+[(x,y)]
 q=S(d,b)
 while q:
  C,x,y,e,d,b=q.pop(0)
  for X,Y in[(0,1),(0,-1),(1,0),(-1,0)]:
   if(T:=(x+X,y+Y))in d['-']:B=eval(str(b));B[T[0]][T[1]]=C;q+=[(C,*T,e,{**d,'-':{*d['-']}-{T}},B)]
   elif T==e:
    if len(d)==1 and not d['-']:return b
    if len(d)>1:q+=S(d,b)

Try it online!