text:
Swap the Alphabet
In this challenge, you will be "reversing" the alphabet or swapping a-z with z-a. This is commonly known as the Atbash cypher.
Because this transformation makes the output look like some foreign language, your code will need to be as short as possible.

Examples
abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba

Programming Puzzles & Code Golf
Kiltiznnrmt Kfaaovh & Xlwv Tlou

Hello, World!
Svool, Dliow!

Specification

The input may contain multiple lines, and will be ASCII-only
No additional whitespace should be added to the output
Case must be preserved

Leaderboard

var QUESTION_ID=68504,OVERRIDE_USER=40695;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

This is code-golf so shortest code in bytes wins

+1 for the justification "Because this transformation makes the output look like some foreign language, your code will need to be as short as possible."

Some Trivia: this is Atbash, a known cipher as old as the bible.

"Because this transformation makes the output look like some foreign language, your code will need to be as short as possible."
What kind of logic is that??
Because your description raises about as much question marks as if it was written in some foreign language your answer to this question should be in intelligible natural language and some verbosity is appreciated.

Kiltiznnrmt Kfaaovh & Xlwv Tlou should be the new site for "Programming Trivials & Code Bowling"...

Why don't you allow additional whitespace? That makes it impossible in some languages that always have a trailing newline. I can't see it adding anything to the challenge.

The specifications do not say whether we keep the capitalisation or not

Pyth, 8 bytes
XXzG)rG1

@xnor suggested this simpler approach on @FryAmTheEggman's Pyth answer, then I translated it to Pyth.
This uses the handy behavior of X (translate) when given only two arguments: it translates from the second argument to the reversed second argument. We do this first with the lowercase alphabet (G), and then with uppercased G.

C, 59 bytes
Sorry for bringing up C again, but I was a bit disappointed to see only C functions here. I was under the impression OP was looking for a usable product.
main(c){while(~(c=getchar()))putchar(isalpha(c)?c+4^31:c);}

Compiled on Ubuntu 14.04 with a simple:
cc swalpha.c

The resulting executable reads any number of lines from stdin, and writes the result to stdout.
Thanks to so many of the other posters for the XOR trick.

This was the most extreme compact program that does something remarkably amazing like this!  @Ruud Helderman  this was extremely well done!

JavaScript (ES6), 69 67 bytes
x=>x.replace(/[A-Z]/gi,c=>String.fromCharCode(c.charCodeAt()+4^31))

Uses the same strategy as my Japt answer:
x=>x.replace(/[A-Z]/gi,C=>   // Replace each letter C with
 String.fromCharCode(        //  the character with char code
  C.charCodeAt()+4^31))      //   the char code of C, plus 4, with the last 5 bits flipped.

Curse your incredibly long property names, JS...

+1 for mentioning JS's excruciatingly long property names. My favorite is still the infamous document.getElementById

@Cyoce Try document.getElementsByClassName or, on Firefox and Chrome, document.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

This seems to only be 66 bytes not 67

@Doᴡɴɢᴏᴀᴛ You're right about that, thanks!

It looks like you are missing a closing bracket on the end of the golfed code.

@starbeamrainbowlabs Thanks! I wondered why I had miscounted...

If the challenge didn't require case sensitivity, it could be at least 14 bytes shorter :p

CJam, 17 bytes
I wanted to help GamrCorps golf his CJam solution, but the result ended up so different that I decided to make a separate answer.
q'[,_el^_W%32f^er

Try it online.
Explanation
q     e# Read all input.
'[,   e# Get a character range from the null byte up to and including "Z".
_el   e# Duplicate and convert to lowercase.
^     e# Symmetric set difference. Due to the lowercase operation only letters will not
      e# appear in both sets, and so we get a string with all uppercase letters followed
      e# by all lowercase letters, i.e "ABC...XYZabc...xyz".
_W%   e# Duplicate and reverse. Gives: "zyx...cbaZYX...CBA".
32f^  e# Take each character XOR 32 which swaps the case, so now we have:
      e#                               "ZYX...CBAzyx...cba"
er    e# Transliterate: substitute each character in the first string with the correspoding
      e# character in the second string.

Well, I'm glad you were trying to help! That is the solution that I was trying to make, I just couldn't figure out the XOR. Nice Job!

SE's syntax highlighting hates esolangs.

@Cyoce They probably don't have time; given how many languages are on this site. That said, CJam is probably one of the easier ones, as it's not self-modifying and has a pretty clear structure. I'd like to see them try to add syntax-highlighting to a self-modifying language like ///.

@Challenger5 afaik, the syntax highlighting just uses Google's prettify, do support for various esolangs would have to be added there.

Retina, 17 14 13 bytes
Code:
\T`w`_dZ-Az-a

Explanation:
\             # This suppresses the trailing linefeed
 T            # Switches to transliterate mode
  `w          # w is short for _0-9A-Za-z
    `_d       # d is short for 0-9
       Z-Az-a # Z-Az-a

This does some magic stuff and completes the task.
Try it here.

Lucky you that I recently added \. Unlucky you that I didn't get around to adding character classes for letters and reversed character classes yet.

@MartinBüttner Very lucky indeed, that almost invalidated my answer :)

For reference, as of Retina 0.7.2 you could do \T\lL`RlRL`.

Pyth, 10 9
uXGr;H)2z

Thanks to Jakube for saving a byte with the new feature of ;!
Test Suite
A quick explanation: reduce starting with the input over the numbers 0 and 1. The operation to be performed is translate the lower case alphabet with either r...0 or r...1 which are the lower and upper functions from python, respectively, applied to it, and then reversed.

9 bytes due to a new feature (not even a day old): uXGr;H)2z

Can you add an explanation?

Can't you use X with the alphabet and then with the capitalized alphabet?

@xnor XXzG)rG1? That seems to work.

Or, maybe do X on the lowercase and uppercase alphabets concatenated, then swap case? That's probably longer, actually.

I'll post as CW.

@xnor your second idea seems to give me 10: rXzsrBG1)2

Julia, 74 61 47 bytes
s->replace(s,r"[a-z]"i,t->Char(31$Int(t[1])-4))

This is a lambda function that accepts a string and returns a string. To call it, assign it to a variable.
We match each letter using a regular expression and replace each letter with the ASCII character corresponding to 31 XOR the ASCII code for the letter, minus 4.

Wow, this is very elegant. I get a deprecation warning for $ so you might want to update that to ⊻. Didn't know that you can use a function in replace.

Japt, 23 22 bytes
Ur"[A-Za-z]"_c +4^31 d

Try it online!
How it works
Ur"[A-Za-z]"_  // Take the input and replace each letter with:
 c +4          //  Take its char code and add 4. This results in
               //  the string      "ABC...XYZabc...xyz"
               //  becoming        "EFG...\]^efg...|}~".
 ^31           //  XOR the result by 31. This flips its last five 5 bits.
               //  We now have     "ZYX...CBAzyx...cba".
 d             //  Convert back from a char code.
               // Implicit: output last expression

Nice idea (which I borrowed...) to use XOR for this

C, 150 129 Bytes
void rev(char*s){int i,t;for(i=0;i<strlen(s);i++){t=s[i]+25;t=t<116?180-t:244-t;isalpha(s[i])?printf("%c",t):printf("%c",s[i]);}}

This function just converts char to int and adds the appropriate offset to the int before printing. I know it's not the shortest but I didn't see a C implementation.
Example usage
#include<stdio.h>
#include<string.h>
#include<ctype.h>

void rev(char*s){int i,temp;for(i=0;i<strlen(s);i++){temp=s[i]+25;temp=temp<116?180-temp:244-temp;isalpha(s[i])?printf("%c",temp):printf("%c",s[i]);}}

int main(){
   char *s = "hello, there";
   rev(s);
   return 0;
}

UPDATE: shortened a variable name.

Welcome to Programming Puzzles and Code Golf Stack Exchange! This is a very good approach. It could be golfed more by making all variables (including temp) exactly one character long.

Ahh you are right! I will regolf this one

If you need any help using some comment features like replying (@username), chat, notifications or anything else, feel free to just ask. (Anyone.)

Okay will do! Thanks @wizzwizz4

Do you think you could have a go at my challenge? Analyse your Chair

@edc65 No need. The code would work without that (Assuming no extra compiler flags)

Yes it will work without the headers you just get a compiler warning @edc65 I figured since it compiles and runs it wouldn't be considered cheating but in real world use you should always include the headers.

I will be sure to give your challenge a go sometime tonight. I have an idea for it. @wizzwizz4

107 bytes: i,t;r(char*s){for(;i<strlen(s);i++){t=s[i]+25;t=t<116?180-t:244-t;isalpha(s[i])?putchar(t):putchar(s[i]);}}

Oh yeah putchar that is a good call! Thanks @CoolGuy

R, 69 61 bytes
Thanks to @Giuseppe for shaving off some extra bytes:
function(s)cat(chartr("a-zA-Z",intToUtf8(c(122:97,90:65)),s))

Previous version:
function(s)cat(chartr("a-zA-Z",rawToChar(as.raw(c(122:97,90:65))),s))

This is an anonymous function. Usage:
> f=function(s)cat(chartr("a-zA-Z",rawToChar(as.raw(c(122:97,90:65))),s))
> f("Hello, World!")
Svool, Dliow!
> f("Programming Puzzles & Code Golf")
Kiltiznnrmt Kfaaovh & Xlwv Tlou
> f("This is
+ a multiline
+ example.")
Gsrh rh
z nfogrormv
vcznkov.

intToUtf8(c(122:97,90:65)) instead of the raw conversions, and you can get rid of the cat as well. I'm making it a bit of a habit to come golf 1+ year old answers of yours...

C, 64
A void function that modify the string in place.
t(char*p){for(int c;c=*p;)*p++=c>64&c<91|c>96&c<123?(c^31)-4:c;}

Test: ideone

c;t(char*p){for(;c=*p;)*p++=c>64&c<91|c>96&c<123?(c^31)-4:c;}

@CoolGuy right, but I don't like the global inside a function... it's just me

Isn't this 64 bytes?

@Doᴡɴɢᴏᴀᴛ yes it is .. thanks ..

Python, 61 bytes
lambda x:''.join([c,chr(ord(c)+4^31)][c.isalpha()]for c in x)

An anonymous function. On letters, does the reversing operation on the bit representation by adding 4, then flipping the last five bits, similar to ETHproductions' Javascript answer.

Just wrote the exact same thing haha

Ruby, 40 bytes
New solution: Stole that bit flipping magic from some of the other posts here:
->s{s.gsub(/[a-z]/i){($&.ord+4^31).chr}}

Ruby, 55 46 bytes
->s{s.tr'a-zA-Z',[*?A..?Z,*?a..?z].reverse*''}

9 bytes off thanks to @manatwork

test run:
->s{s.gsub(/[a-z]/i){($&.ord+4^31).chr}}["Kiltiznnrmt Kfaaovh & Xlwv Tlou"]
=> "Programming Puzzles & Code Golf"

CJam, 21 bytes
q'[,65>__el_@+W%@@+er

Not an optimal solution... yet... Try it online
Its hard to explain without grouping things, so here is a general explanation: gets input, pushes uppercase alphabet twice and lowercase twice, rotates things around, combines uppercase and lowercase strings, reverses one, and uses transliteration (similar to the Retina answer).

Does this output a trailing newline?

@LegionMammal978 It shouldn't unless aditsu changed how the stack is outputted.

@LegionMammal978 I doesn't.

Jolf, 15 bytes
~Ai+plpu+_pl_pu
~A              I don't know what to call this, besides "dictionary replace"
  i              the input
   +plpu         previous dictionary: lower + upper alphabet
        +_p1_pu  new dictionary: reversed lower + reversed upper

Test suite, or try it with your own input

The word for this is "transliteration," FYI.

Seriously, 31 bytes
úúû+╗úRúûR+╝,`;╜íuWD╛E(X0WX`Mεj

Hex Dump:
a3a3962bbba352a396522bbc2c603bbda1755744be452858305758604dee6a

Try It Online
Expl:
úúû+╗                             Put UPPERCASElowercase in reg0
     úRúûR+╝                      Put ESACREPPUesacrewol in reg1
            ,                     Fetch input.
             `             `Mεj   Map over the characters in string as list, joining result
              ;╜íu                Find 1-index of character in UPPERCASElowercase
                  W     0WX       If it is positive (present):
                   D              Convert back to 0-index
                    ╛E            Look it up in ESACREPPUesacrewol
                      (X          Delete the original character.
                                  (Else just leave the original character unchanged.)

I just realized the spec say no additional whitespace, but there is no way to suppress trailing newlines in Seriously output, so there is no Seriously solution.

What does ESACREPPUesacrewol mean?

@Doᴡɴɢᴏᴀᴛ UPPERCASE reversed LOWERCASE reversed

the reversed uppercase alphabet prepended to the reversed lowercase alphabet

 2, 12 chars / 26 bytes (non-competitive)
ïĪ(ᶐ+ᶛ,ᶐᴙ+ᶛᴙ

Try it here (Firefox only).
Added transliterate function after the challenge was posted.
Explanation
ïĪ(ᶐ+ᶛ,ᶐᴙ+ᶛᴙ // implicit: ï=input
ïĪ(           // transliterate ï...
   ᶐ+ᶛ,       // from uppercase+lowercase alphabet...
       ᶐᴙ+ᶛᴙ  // ... to reversed uppercase+reversed lowercase alphabet
              // implicit output

I thought  2 was going to be called  ∞?

No, I decided to save that for a complementary (but different) language for .

IIRC There is a blackboard bold 2.

@ՊՓԼՃՐՊՃՈԲՍԼ Call it ESMax (in doublestruck).

C (function), 50
f(char*s){for(;*s;s++)*s=isalpha(*s)?*s+4^31:*s;}

This builds on all three previous C answers, so credit to @Ruud, @Danwakeem and @edc65.
This function modifies a char array in place.
My understanding is function entries are allowed unless explicitly banned in the question.
Try it online.

05AB1E, 5 bytes
žnžo‡

Uses CP-1252 character set.
Try it online!
Explanation:
žn    - Push [A-Za-z]
  žo  - Push [Z-Az-a]
    ‡ - Transliterate.

Why is this noncompeting?

PostgreSQL, 118 125 bytes
SELECT s,TRANSLATE(s,t||UPPER(t),REVERSE(t)||REVERSE(UPPER(t)))
FROM(SELECT text'Programming Puzzles & Code Golf's,text'abcdefghijklmnopqrstuvwxyz't)r

SqlFiddleDemo
Output:
╔══════════════════════════════════╦═════════════════════════════════╗
║                s                 ║            translate            ║
╠══════════════════════════════════╬═════════════════════════════════╣
║ Programming Puzzles & Code Golf  ║ Kiltiznnrmt Kfaaovh & Xlwv Tlou ║
╚══════════════════════════════════╩═════════════════════════════════╝

Input: SELECT text'...'s

EDIT:
Input as table:
SELECT s,TRANSLATE(s,t||UPPER(t),REVERSE(t)||REVERSE(UPPER(t)))
FROM i,(SELECT text'abcdefghijklmnopqrstuvwxyz't)r
GROUP BY s,t

SqlFiddleDemo
Output:
╔══════════════════════════════════╦═════════════════════════════════╗
║                s                 ║            translate            ║
╠══════════════════════════════════╬═════════════════════════════════╣
║ Hello, World!                    ║ Svool, Dliow!                   ║
║ Programming Puzzles & Code Golf  ║ Kiltiznnrmt Kfaaovh & Xlwv Tlou ║
║ abcdefghijklmnopqrstuvwxyz       ║ zyxwvutsrqponmlkjihgfedcba      ║
╚══════════════════════════════════╩═════════════════════════════════╝

Hey lad2025, I think this is shorter than 118, but I am no expert in the counting rules

Python 3, 195 169 168 166 bytes
Thanks to @TrangOul for -2 bytes!
How didn't I see that I could have golfed that down before?
x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:
x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
    if i in b
    else a[y.index(i)]
    if i in a
    else i
    for i in input()
))

Try it on Ideone!

You can save 2 bytes by removing the outermost [] from join.

@TrangOul really? It's a list comprehension so I thought it needs to be a list or else you get generator object <genexpr> at..., but I will test it

@TrangOul Nevermind, I learned something, thanks!

Any iterable [containing str values] can be passed to join() function.

Unix shell + tr + printf, 35 bytes
tr A-Za-z `printf %s {Z..A} {z..a}`

Here you are, a canonical answer in tr. I thought how could a question to transliterate the alphabet go without a canonical answer to transliterate the alphabet?
tr by itself does not even do a "Hello, World!" and as such isn't a programming language, so I marked the answer as noncompeting[1].
[1]: Edit: Actually, Unix shell is the language and tr is the standard library. Thanks to Downgoat and Digital Trauma for helping me spot this out.

I think its fine to claim shell or bash as a language, and common utilities (tr is in coreutils) as the standard library.  See countless of my answers ;-)

But it doesn't work: tr: range-endpoints of 'Z-A' are in reverse collating sequence order.   I think you have to do something like tr A-Za-z $(printf %s {Z..A} {z..a}) (and replace $( ) with backticks)

@DigitalTrauma but not everyone has printf on their system.

I think you'd have quite a hard time finding a Unix system that doesn't have printf - after all, its specified by Posix.  Also its a builtin in bash which is pretty ubiquitous these days.  Regardless, having something pre-installed on everyone's system is not a prerequisite for [tag:code-golf] -  not everyone has CJam on their system either ;-)

The space between } and { is required - otherwise the expansion becomes something like Zz Zy Zx ... Za Yz ... Aa

Haskell, 119 104 bytes
Saved 15 bytes thanks to @nimi.
c=fromEnum;s=toEnum;f[]="";f(x:y)|64<c x&&c x<91=s(155-c x):f y|96<c x&&c x<123=s(219-c x):f y|0<1=x:f y

Usage:
f "abcdefghijklmnopqrstuvwxyz"
"zyxwvutsrqponmlkjihgfedcba"

f "Programming Puzzles & Code Golf"
"Kiltiznnrmt Kfaaovh & Xlwv Tlou"

f "Hello, World!"
"Svool, Dliow!"

Explanation
let c=fromEnum;s=toEnum;--wrap names for later use, fromEnum gets ascii code from char, toEnum gets char from ascii code
f[]=[];                 --feed empty list (of chars in this case), get empty list
f(x:y)                  --feed a list, separate the first element and...
|64<c x&&c x<91=        --if its an uppercase char (using ascii code range)...
s(c x*(-1)+155)         --  inverse its ascii code value, move it to the range of uppercase and get the new char
                        --  (like rotating half turn a ruler by the side and then sliding it to the space it previously occupied)
:f y                    --  feed the rest of the list and stick the new char in front of the result
|96<c x&&c x<123=       --if its a lowercase char (using ascii code range)...
s(c x*(-1)+219)         --  inverse its ascii code value, move it to the range of lowercase and get the new char
:f y                    --  feed the rest of the list and stick the new char in front of the result
|True=x:f y             --otherwise feed the rest of the list and stick the char in front of the result

I'm new to Haskell... to functional programming... and to the site, and i know there are (a lot of) better answers to this question, but bear with me.

Some golfing tips: a) no need to use let. Start directly with c=fromEnum. Use (155-c x) and (219-c x). c) Truecan be replaced by 1<2. -- The code fails to load for me with the "ambigious type variable" error for functions c and s (ghci 7.10.2), but this can easily be fixed with f[]="" instead of f[]=[].

Thanks!, i was actually wondering if it was valid without "let", since it doesnt run directly on GHC.

Perl 6, 28 bytes
{S:g/\w/{chr $/.ord+4+^31}/}

Usage:
# give it a lexical name
my &swap = { … }

say swap 'Programming Puzzles & Code Golf';
# Kiltiznnrmt Kfaaovh & Xlwv Tlou

say swap ('a'..'z').join
# zyxwvutsrqponmlkjihgfedcba

When I run this it says: Warning: Use of "ord" without parentheses is ambiguous at (eval 8)[/System/Library/Perl/5.18/perl5db.pl:732] line 2. I know nothing about perl so am I doing something wrong? How would I run this?

@Doᴡɴɢᴏᴀᴛ If you notice it says this is written in Perl 6 You can go to #perl6 on freenode and type m: my &swap = {S:g/\w/{chr $/.ord+4+^31}/}; say swap ('a'..'z').join

Ah okay, apparently I can't read :P

@Doᴡɴɢᴏᴀᴛ I added a note that you can test it on #perl6 on freenode

Java, 136 bytes
void x(String i){for(char c:i.toCharArray()){if(Character.isLetter(c))c=c<91?(char)(90-(c-65)):(char)(122-(c-97));System.out.print(c);}}

Example usage:
class Test {
  static void x(String i){for(char c:i.toCharArray()){if(Character.isLetter(c))c=c<91?(char)(90-(c-65)):(char)(122-(c-97));System.out.print(c);}}
  public static void main(String[] args) {
    x("Programming Puzzles & Code Golf");
    // produces "Kiltiznnrmt Kfaaovh & Xlwv Tlou"
  }
}

Probably the worst commonly-used language in terms of byte size.

Java's is a meme here actually

I know this has been posted about 1.5 year ago, but you can golf quite a few things like this: void x(String i){for(Character c:i.toCharArray())System.out.print(c.isLetter(c)?(char)(c<91?90-(c-65):122-(c-97)):c);} (118 bytes)

Or even shorter: void y(String i){for(int c:i.getBytes())System.out.print((char)(c>65&c<91|c>96&c<123?c<91?90-(c-65):122-(c-97):c));} (116 bytes)

@KevinCruijssen You can also rearrange the calculations to negate the need for parentheses by making 90-(c-65) into -c+65+90  and 122-(c-97) into -c+97+122, which saves a byte each.

Python 3, 164 159 bytes
def f(t,a="abcdefghijklmnopqrstuvwxyz",b=""):
 for c in t:u=64<ord(c)<91;c=c.lower();c=a[::-1][a.index(c)] if c in a else c;b+=c.upper() if u else c
 return b

PHP, 73 bytes
<?=strtr($argv[1],($b=strtolower($a=join(range(A,Z)))).$a,strrev($a.$b));

do this need any comments?

Perl 5, 28 25 bytes
24 bytes of code + 1 for -p
s/\pL/chr(4+ord$&^31)/ge

Try it online!

PowerShell, 65 bytes
-join($args|% t*y|%{[char]($_,(($_-bxor31)-4))[$_-match'[a-z]']})

Try it online!

Husk, 22 bytes
σ…'A'Z…'Z'Aσ…'a'z…'z'a

Try it online!

C, 112 98 bytes
i;main(){char x[99];gets(x);for(;x[i];i++)if(isalpha(x[i]))x[i]=(x[i]>90?219:155)-x[i];puts(x);}

I know that gets() is deprecated and unsafe, but scanf() doesn't accept whitespace and I need to include stdio.h if I want to fgets (since stdin is defined in stdio.h). I assume this program wouldn't work if the user tried to enter a string more than 99 characters.
EDIT: Changing printf("%s",x) to puts(x) saves 7 bytes and changing i<strlen(x) to x[i] saves another 7 bytes.

I find it interesting that I can't replace i;main(){char x[99]; with i,x[99];main{ (This changes the type to an int, which seems to cause the program to output garbled text). Can anyone explain this?

Vyxal, 5 bytes
kBklĿ

Try it Online!
Explanation:
kB     # Constant 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
  kl   # Constant 'ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba'
    Ŀ  # Transliterate a(b -> c)
       # Implicit output

MATL, 21 28 bytes
Uses version 6.0.0, which is earlier than this challenge. The code runs in Octave.
jttk2Y2mXK)o31Z~4-cK(

Example
>> matl
 > jttk2Y2mXK)o31Z~4-cK(
 >
> Hello, World!
Svool, Dliow!

Explanation
j             % input string
t             % duplicate
tk            % duplicate and convert to lowercase
2Y2           % string 'abc...xyz'
m             % "ismember" function: produces logical index of letter positions
XK            % copy to clipboard K
)             % index into string to get its letters
o31Z~4-       % bitwise XOR with 31 and subtract 4
c             % convert to char
K             % paste logical index from clipboard K
(             % put back modified letters into original string

Old approach, 28 bytes
j1Y2!tkh"t@2#m@0v27b-)wXK)K(

Perl 6, 40 39 bytes
Since everyone else is doing anonymous functions:
my &f=*.trans(/\w/=>{chr $/.ord+4+^31})

(Thanks @b2gills for the tip)
Uses the same bit flipping voodoo as some of the other posts.
I wasn't sure whether to include the variable/function declaration in the byte count, so I did just in case. Without it this solution is only 34 bytes.
Usage:
> f "zyxwvutsrqponmlkjihgfedcba"
abcdefghijklmnopqrstuvwxyz
> f "Kiltiznnrmt Kfaaovh & Xlwv Tlou"
Programming Puzzles & Code Golf
> f "Svool, Dliow!"
Hello, World!

You can use *.trans(…) to make it shorter.

Brachylog, 66 bytes
_|hH(:64>:91<,77-H+78=X;H:96>:123<,109-H+110=X;HX),[X]:"~c"w,?b:0&

The lack of built-ins really hurts here, so we have to resort to good old ASCII codes computations.
The predicate brachylog_main expects a character codes string as input and no output, e.g. brachylog_main(`Hello, World!`,_).
Explanation
_                                                                  § If the input is empty,
                                                                   § return true
                                                                   §
 |                                                                 § Else
                                                                   §
  hH(                                            ),[X]:"~c"w       § Print variable X which
                                                                   § depends on the head of
                                                                   § the input as a char code
                                                                   §
                                                            ,?b:0& § Recursive call on the
                                                                   § tail of the input
                                                                   §
     :64>:91<,77-H+78=X                                            § If H is capital, X =
                                                                   § 77 - H + 78
                       ;                                           § Else if H is non-cap, X=
                        H:96>:123<,109-H+110=X                     § 109 - H + 110
                                              ;                    § Else (not a letter)
                                               HX                  § H = X

MATLAB, 61 bytes
@(x)[abs(-x+ismember(x,65:90)*155+ismember(x,97:122)*219),'']

I tried f=@ismember, and making the range a=65:90 a variable and do 32+a in the second ismember-call. All this shortened the code, but would result in a program and thus require both disp and input.
This gives:
ans('Hello, World!')
ans =
Svool, Dliow!

ans('Programming Puzzles & Code Golf')
ans =
Kiltiznnrmt Kfaaovh & Xlwv Tlou

Python 2, 104 bytes
Pretty simple using str.translate and string.maketrans.
from string import*
u=ascii_uppercase
l=u.lower()
f=lambda x:x.translate(maketrans(u+l,u[::-1]+l[::-1]))

Try it online
This last line would also work, since string is imported:
f=lambda x:translate(x,maketrans(u+l,u[::-1]+l[::-1]))

Oracle SQL 11.2, 105 bytes
SELECT TRANSLATE(:1,a||UPPER(a),REVERSE(UPPER(a)||a))FROM(SELECT'abcdefghijklmnopqrstuvwxyz'a FROM DUAL);

Factor, 92 bytes
[ [ 65 90 [a,b] dup >lower 2dup [ reverse ] bi@ append -rot append zip >hashtable at ] map ]

An anonymous function. Making it case insensitive is... expensive.

PHP, 69 bytes
while(""<$c=$argv[1][$i++])echo ctype_alpha($c)?chr(ord($c)+4^31):$c;

mapping stolen from ETHproductions

05AB1E, 5 bytes
žižk‡

Try it online!
       # Push input.
 ži    # Push [a-zA-Z]
   žk  # Push [z-aZ-A]
     ‡ # Transliterate a#(b -> c)

Implicit input... you can remove the I.

Racket 332 bytes
(let p((l(map char->integer(string->list s)))(ol'())(g(λ(n a b)(and(> n a)(< n b))))(t first)(c cons))
(cond[(empty? l)(list->string(map integer->char(reverse ol)))][(and(not(g(t l)96 123))(not(g(t l)64 91)))(p(rest l)(c(t l)ol)g t c)]
[(>(t l)95)(p(rest l)(c(- 122(-(t l)97))ol)g t c)][else(p(rest l)(c(- 90(-(t l)65))ol)g t c)]))

Ungolfed:
(define(f s)
  (let p ((l (map char->integer (string->list s)))
             (ol '())
             (g (λ (n a b) (and (> n a) (< n b))))
             (t first)
             (c cons))
    (cond
      [(empty? l)
       (list->string (map integer->char (reverse ol)))]
      [(and(not (g (t l) 96 123)) (not(g(t l) 64 91)))
       (p (rest l) (c (t l) ol) g t c)]
      [(> (t l) 95)
       (p (rest l) (c (- 122 (- (t l) 97)) ol) g t c)]
      [else
       (p (rest l) (c (- 90 (- (t l) 65)) ol) g t c)]
      )))

Testing:
(f "abcdefghijklmnopqrstuvwxyz")
(f "Programming Puzzles & Code Golf")
(f "Hello, World!")

Output:
"zyxwvutsrqponmlkjihgfedcba"
"Kiltiznnrmt Kfaaovh & Xlwv Tlou"
"Svool, Dliow!"

C#, 234 Bytes
Golfed:
string A(string s){string a="abcdefghijklmnopqrstuvwxyz",z=string.Concat(a.Reverse()),o="";s.ToList().ForEach(c=>o+=!z.Contains(char.ToLower(c))?c:char.IsLower(c)?z[a.IndexOf(c)]:char.ToUpper(z[a.IndexOf(char.ToLower(c))]));return o;}

Ungolfed:
public string A(string s)
{
  string a = "abcdefghijklmnopqrstuvwxyz",
    z = string.Concat(a.Reverse()), o = "";
  s.ToList().ForEach(c => o += !z.Contains(char.ToLower(c)) ? c :
  char.IsLower(c) ? z[a.IndexOf(c)] :
  char.ToUpper(z[a.IndexOf(char.ToLower(c))]));
  return o;
}

Testing:
Console.WriteLine(new Atbash().A("Programming Puzzles & Code Golf"));
Kiltiznnrmt Kfaaovh & Xlwv Tlou

Console.WriteLine(new Atbash().A("Hello, World!"));
Svool, Dliow!

Jelly, 11 bytes
ØAµ,Uµ;Œsðy

Try it online!

Common Lisp, 110 bytes
(lambda(s)(map-into s(lambda(x)(if(alpha-char-p x)(code-char(-(if(upper-case-p x)155 219)(char-code x)))x))s))

Try it online!
Very straightforward solution.

Wolfram Language (Mathematica), 114 bytes
(a=Alphabet[];b=Capitalize/@a;r:=Reverse;u=AssociationThread[a~Join~b->r@a~Join~r@b];StringJoin[Characters@#/.u])&

Try it online!

K (ngn/k), 32 bytes
{x^'![t,_t;(|t),|_t:`c$65+!26]x}

Try it online!
Builds a dictionary mapping the letters to their "reverses", filling any non-letter character with what was in the input.

t:`c$65+!26 build a list of the letters from "A" through "Z", storing in t
![t,_t;(|t),|_t:...] build a dictionary mapping the letters to their reverses
x^'![...]x index into that dictionary with the input. non-letter characters in the input get replaced with " "'s, so replace those spaces with whatever was in the input

k4, 24 bytes
{x^![|,/|l;,/l:.Q`a`A]x}

Similar to the above, but benefits from using the built-in lists of characters; .Q.A for uppercase letters, and .Q.a for the lower case ones.

CJam, 33 bytes
q['a{_)}25*]_eu+['z{_(}25*]_eu+er

Explanation:
q                   e# Read all input an put string to the stack
[                   e# Start array (char)
    'a              e# Put 'a' char to the stack
    {               e# Begin of code block
        _           e# Duplicate top element on the stack
        )           e# Increment the duplicate
    }               e# End of code block
    25*             e# Repeat code block 25 times
]                   e# End array
_                   e# Duplicate array
eu                  e# Uppercase the duplicate
+                   e# And join arrays
['z{_(}25*]_eu+     e# Repeat the same thing back from Z
er                  e# Replace A-z with z-A in the input

Python 3, 141 bytes
Similar to @cat, but uses a dict to map letters and uses a simpler comprehension for the print:
a=__import__('string').ascii_letters;l,u=a[:26],a[26:];m=dict(zip(a,l[::-1]+u[::-1]));print(''.join(m[c] if c in a else c for c in input()))

Ungolfed:
a = __import__('string').ascii_letters; # import alphabet
l, u = a[:26],a[26:];                   # separate lower/uppercase
m = dict(zip(a, l[::-1] + u[::-1]));    # create map a-z+A-Z -> z-a+Z-A
print(''.join(m[c] if c in a else c     # if input char in map, map it
                   for c in input()))   # otherwise leave it alone

JavaScript ES6, 96 bytes
var R=i=>i.replace(/[A-z]/g,s=>String.fromCharCode(155-s.charCodeAt(0)+(/[a-z]/.test(s)?64:0)))

Not as good as the other JavaScript answer, but I thought I'd try myself.

Your A-z regex matches [\]^_\``, none of which should be modified. You'll probably want A-Za-z`.

REXX, 88 bytes
b=xrange(a,z)
a=lower(b)
do forever
  parse pull n
  say translate(n,reverse(b||a),a||b)
end

JavaScript, 57 bytes
s=>{var k;for(var a=s.length-1;a>0;a--){k+=s[a]}return k}

Does it work? How? s[s.length] === undefined

Mathematica 89 Bytes
StringReplace[#,Thread[#~Join~#3@#->#2@#~Join~#2@#3@#]&[Alphabet[],Reverse,ToUpperCase]]&

48 Bytes of this is just long function names

Lua, 116 bytes
t={}for i=65,90 do a=('').char(i)b=a.char(155-i)t[a],t[a:lower()]=b,b:lower()end print((io.read"*all"):gsub("%a",t))`

Python3
This is my first post on Code Golf; but I think I understood your question successfully;
This python3 code replaces abc -> xyz (as you specified above)
def ASUB(m,A,B):o = m.maketrans(A,B);r = m.translate(o);return(r);
ASUB(m="Programming Puzzles & Code Golf",
     A="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
     B="zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA")
#'Svool, Dliow!'
#'Kiltiznnrmt Kfaaovh & Xlwv Tlou'

the output of the both messages (Hello, World! and the other one) is in # comments
EDIT: Thanks for clarifying caird coinheringaahing!
Improved:
def A(m):o=m.maketrans("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA");return m.translate(o);

Welcome to the site! This is a nice first answer, but there are a couple of issues. First, we require answers to code golf challenges to attempt to golf as much as possible, which, for Python, includes 1 letter variable names, and removing unnecessary whitespace. Secondly, as this calls for 1 input (m), your function shouldn't take A and B as parameters, rather you should include the full strings in your answer. Here is a version of your answer that's slightly more golfed (156 bytes), and follows the site rules on functions

Oh, thanks so much for the  kind and clear, as swell as detailed explanation! and the other version! I can't  thank you enough! Should I edit or remove my post because of these issues?  Thanks again!

This is a perfectly valid answer, just needs a little bit of improvement, which is exactly what SE's edit feature is for!

Jelly, 8 bytes
ØẠŒsU,Ɗy

Try it online!
How it works
ØẠŒsU,Ɗy - Main link. Takes S on the left
ØẠ       - Yield "ABC...XYZabc...xyz"
      Ɗ  - Last three links as a monad f("ABC...XYZabc...xyz"):
  Œs     -   Swapcase
    U    -   Reverse
     ,   -   Pair
       y - Translate S by this mapping


text:
Growing Quine Sequence
You are to write a sequence of 10 programs p1 p2 ... p10 that satisfy the following properties:

pK prints pK+1 for K from 1 to 9
p10 prints p10
When the first K programs are concatenated, the resulting program p1...pK prints p1...pK.
Each program pK must be larger in byte size than the previous program pK-1.
All programs must be in the same language.
Built-in quining functions (e.g. Q in many languages) are allowed.

Your score is the sum of the byte counts of the 10 programs. Since there are only ten programs, you must make your codes as short as possible. Good luck.

"Each program pK must be larger in byte size than the previous program pK-1" - huh, why this strange requirement?

@nicael Because it's a growing quine sequence.

Why does p10 print itself and not p11? That makes the problem a bit harder.

@SuperJedi224 Because simply there is no p11.

This challenge would have been a lot more interesting if built-in quining functions had been forbidden.

@Dennis Perhaps, but if I was sure that a solution indeed existed without quining functions, I would have banned them. Further, before I had clarified whether or not there use was allowed, an answer already used them. Since this is not a conventional quine challenge, it is not natural to assume that quining functions would be prohibited.

@CᴏɴᴏʀO'Bʀɪᴇɴ What should happen if a null byte is contained in the source, since printing a null byte \x00 results in nothing being printed for that char? Is that acceptable as long as none of the programs contains only null bytes (or is that also acceptable)? Or must a program also "grow" by more than just a null byte?

Seriously, 245 bytes:
All ten programs concatenated:
Q9ucQc8<WX#dXεj0WX.Q9ucQc8<WX#dXεj0WX.
Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

Q9ucQc8<WX#dXεj0WX.

There are invisible characters that become visible when executed, a strange property of byte 7F. The trailing newlines on each program are significant. In fact, Seriously automatically appends newlines to its output whether you want it to or not. This just counts the number of newlines in the output, and as soon as that number exceeds 8, it deletes the last character of output. As such, p1..pK will print p1..pK for all K>4.
Q                                  Push source code.
 9uc                               Push \n
    Qc                             Push the number of times it appears in source code.
      8<                           Check if it appears more than 8 times.
        WX     0WX                 If so, run the included code.
          #dX                      Convert string to list, dequeue and discard a newline.
             εj                    Join list back into string.
                  .                Print and halt. (Invisible byte here.)

Interesting! It is indeed possible.

can i haz explanation leik wat each char duz

It should be noted that this uses the quining built-in Q which pushes the source code of the program.

(And further noted that the total length would be somewhere in the vicinity of 150 bytes longer without said built-in.)

Built-in quining functions are allowed for this challenge.

Javascript ES6, 1935 bytes
Ten programs:
a=_=>{t=`a=${a};a()`;setTimeout(_=>alert(t.length>200?t:";".repeat(82)+'a=_=>{/*  */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\\s)+g,"$0$1"):u)};a();'))};a()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*  */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*   */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*    */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*     */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*      */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*       */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*        */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*         */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;a=_=>{/*          */u=";".repeat(82)+"a="+a+";a();";this.t?t+=u:alert(u.length<198?u.replace((\s)+g,"$0$1"):u)};a();

This is beautiful to look at.

All those extra semicolons just to ensure that program 2 is longer than program 1...

Could you maybe use the regex (\S)+ and the substitution $0$1 to save some bytes?

@MartinBüttner Probably, I'll try this afternoon

JavaScript (ES6), 985
function f(x){x<0||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(0);
 function f(x){x<1||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(1);
  function f(x){x<2||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(2);
   function f(x){x<3||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(3);
    function f(x){x<4||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(4);
     function f(x){x<5||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(5);
      function f(x){x<6||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(6);
       function f(x){x<7||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(7);
        function f(x){x<8||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(8);
         function f(x){x<9||x>8||f.a||x++;alert(f.a=' '.repeat(x)+`${f}f(${x});`.replace(/\d/,x))}f(9);

I misunderstood the rules earlier, so my previous answer was incorrect.
This one uses function hoisting instead of variable hoisting, so it doesn't depend on program 10. In fact, I think it's a quine for any combination of two or more concatenated programs.
Disclaimer: it's really late right now, so everything above could be completely wrong.

I don't think you need alert because of function output.

Oh I see, nevermind.

You can take out trailing semicolons, saving you 20 bytes. (Make sure to update the template string inside, too.)

@ՊՓԼՃՐՊՃՈԲՍԼ I think the semicolons are needed for concatenation, since I'm not actually including the newlines.

Nevermind again, then.

 2, 214 chars / 334 bytes
ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
 ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
  ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
   ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
    ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
     ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
      ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
       ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
        ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)
         ℹ)đ ⬭ď9)?ℹ):⬭+ℹ)

Try it here (Firefox only).
Explanation
ℹ)                // quine function: get source code
  đ ⬭ď9)          // are there 9 spaces in a row anywhere in the source?
        ?ℹ):      // if so, pass the source itself to implicit output
            ⬭+ℹ) // otherwise, add a leading space to the source and pass to implicit output

The program counts the searches for 9 spaces in a row, which is the amount of leading spaces in the 10th program. If it finds a match, then the source code is outputted; otherwise, the source code, lead by a space, is outputted.

Which encoding are you using? Seems to be 284 bytes on the ISO 8859-1 encoding. Tested here

I'm using UTF-8.

I forgot that it's ESmin 2, so I read the char count as "2,214 chars" :P

source: Stack Exchange

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

sort: votes


text:
Pronoun operation
The challenge
Write a function or a program that takes a string composed of one or more subjective personal pronouns, separated by + signs, as an argument. The output must be a single pronoun, that is the result of the relation defined in the next paragraph.
Of course, feel free to edit as you wish to correct those grammatical errors that are surely present ;)
This is a code-golf challenge, so the shortest code wins.
The relation
The goal of this task is to translate in "math-speak" something that we use daily. How do we think of "You and I" ? Well, "We", don't we?
So, if the input is You+I the output  should be the string We.
With more than two pronouns, it should look like:
You+He+They -> You
The relation is defined as this table:
      I  You    He   We   You   They
I     I  We     We   We   We    We
You      You    You  We   You   You
He              He   We   You   They
We                   We   We    We
You                       You   You
They                            They

The 'You' Problem
Well, as you can see I'm not a native English speaker. In my language (Italian) there's a difference between the plural you (voi, in italian) and the singular you (tu). When I thought this challenge I didn't think in English, so there's the problem that it is impossible to recognize if I'm using plural or singular form. Fortunately (or obviously?), the input/output doesn't change in both forms, so you can use one of them and you will cover both cases!
About the input
The input will be always in the form "Pronoun+Pronoun+Pronoun" ... The pronouns will have the first letter in uppercase and the rest in lowercase. Pluses will be not be surrounded by spaces, only by pronouns. Empty input is possible and the result must be empty output.
Bonus
A little bonus of 15% if the program will manage two new pronouns: She and It. They are the same as He, obviously. Remember that this relation is reflexive, so She -> She and It -> It. Therefore, any combination that includes only She, He or It should output They.
Examples
You+I          -> We
You+He+They    -> You
I+You+He+They  -> We
They           -> They
They+You       -> You
You+You+I+You  -> We

For Bonus
She            -> She
She+He         -> They
I+It+He        -> We
It+You         -> You

@Timwi, if you are talking about the examples you are right, I'll add a few. Anyway, this "plus" relation is reflexive, so He+He is He, I+I is I ....

I get "I+I=I", since there can be only one "I" from a given speaker.  But couldn't "He+He=They"?  Generally if you say "He" twice in this construction, you're referring to two different male subjects, not the same one twice.

Many dialects of English have equivalents of voi. In mine, it's y'all, and used in the formal register. Another common one is yous, though I don't think that one gets used in formal speech really. Traditionally, you also have ye, well known to many because it's common in certain biblical translations. You should add in one of these or toss in thou as well to really shake things up.

Retina, 62 61 56 53 52 bytes
(.+)\+(?=\1)

.*(W|.I|I.).*
We
.*Y.*
You
.{4,}
They

Further golfing and explanation comes later.
The 4 substitution steps do the following:

anything multiple times is itself
if there is any We or I + anyhing the result is We
for anything else containing You the result is You
if we still have multiple parts or a sole They it's They as only He's and They's can be left

Try it online here.
3 bytes saved thanks to Martin Büttner.

Except for the last stage, you can use . instead of \+, since that's the only character allowed in front of a capital letter or after I.

JavaScript (ES6), 130 bytes
s=>(a=",I,You,He,We,They".split`,`,m="012345014444042242042345044444042545",r=0,s.split`+`.map(p=>r=m[+m[a.indexOf(p)]+r*6]),a[r])

Explanation
s=>(

  // a = array of each pronoun (including an empty string at index 0)
  a=",I,You,He,We,They".split`,`,

  // m = 6 x 6 map of pronoun indices for each combination of pronouns
  m="012345014444042242042345044444042545",

  r=0,                        // r = index of result pronoun
  s.split`+`.map(p=>          // for each pronoun in the input string
    r=m[+m[a.indexOf(p)]+r*6] // combine each pronoun with the previous one
  ),
  a[r]                        // return the resulting pronoun
)

Test

var solution = s=>(a=",I,You,He,We,They".split`,`,m="012345014444042242042345044444042545",r=0,s.split`+`.map(p=>r=m[+m[a.indexOf(p)]+r*6]),a[r])
<input type="text" id="input" value="You+You+I+You" />
<button onclick="result.textContent=solution(input.value)">Go</button>

Wow, I like this approach! I think I made a very poor bonus, cause to reach it here you'd have to add 7 bytes in the array (",She,It") and 28 in the matrix, reaching 165 -15% = 140 ...

Python 159 153 bytes
EDIT: Thanks @Pietu1998
This is a direct translation of the Javascript ES6 answer:
a=",I,You,He,We,They".split(',')
m="012345014444042242042345044444042545"
r=0
for p in raw_input().split('+'):r=int(m[int(m[a.index(p)])+r*6])
print a[r]

Try it here

s doesn't need to be a variable, and you can remove the extra line & space between the for and r= lines. Also, you might want to check if this could be shorter as a function.

Perl 5, 67 bytes
79 bytes really, but there's a 15% bonus.
$a{$_}=""for split/[+\s]/,<>;@_=%a;say@_<3?@_:I~~@_||We~~@_?We:You~~@_?You:They

Ruby, 150 136 131 119 111 bytes
ARGV.each{|a|puts %w[We You I He They][a.bytes.inject(0){|m,c|m|({87=>15,73=>7,89=>11,84=>9,72=>8}[c]||0)}%5]}

Bonus feature: handles multiple expressions on the same command line.

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


text:
A Yoda-speaking challenge, this is
The challenge
Well, I think it is quite clear, isn't it? You have to make a function or a program that takes a string as an argument and outputs the corrispondent Yoda-speaking.
This is code-golf, so least number of bytes wins.
The input
The input could be any string without linefeed. You can translate a string if it is composed like this:
Subject + Verb + Something else.
Where Subject is a personal pronoun (I, you, he, she, it, we, they). You don't have to recognize that the second word is a verb.
If the first word isn't a pronoun, the input is valid but the output will be Too difficult, this sentence is.
You have to win this code challenge -> Translatable
Luke has to win this code challenge -> Untranslatable

Input can end with a letter, a . or a !, not with a ?.
Furthermore, strings can contain Non-Ascii, Parenthesis, commas, colons ...
The output
In case of a translatable sentence, the output is the same sentence, with the subject and the verb at the end of the sentence.
You have to win this code challenge -> To win this code challenge, you have.

Comma, period and lower-case on the pronoun are mandatory. (Except, of course, if the pronoun is I).
As stated before, if it is untranslatable you have to output the string Too difficult, this sentence is.
Examples
You have to win this code challenge -> To win this code challenge, you have.
He won this code challenge -> This code challenge, he won.  (I know this is not yoda-speaking, but I don’t want to overcomplicate this challenge)
I ate an ice cream earlier! -> An ice cream earlier, I ate.
I liked the Star Wars original trilogy more than the prequel’s one. -> The Star Wars original trilogy more than the prequel’s one, I liked.
I find your lack of faith disturbing -> Your lack of faith disturbing, I find.
I think we are done with the examples -> We are done with examples, I think.
He is your son, Vader -> Your son, Vader, he is.
I think they’ll add new features -> They’ll add new features, I think.
I made a fantastic code challenge (I hope) -> A fantastic code challenge (I hope), I made.
I love constants like π -> Constants like π, I love.

I’ll be the next President, I swear! -> Too difficult, this sentence is.
This challenge is great! -> Too difficult, this sentence is.
Is this challenge great? -> Too difficult, this sentence is.
Luke is not ready for this task -> Too difficult, this sentence is.
Somebody loves constants like π -> Too difficult, this sentence is.
[Empty string] -> Too difficult, this sentence is.

From a non-question point of view, shouldn't infinitives be moved as well? For example, the You have to win this code challenge should be This code challenge, you have to win.

"To win this code challenge, you have." sounds really strange.

Can the input contain commas? What if the input doesn't end in a letter, period or !? Is that guaranteed not to happen or should we handle that and print the same thing as when there is no leading pronoun. Can the input contain linefeeds? Apostrophes? Colons/parentheses/backticks? Non-ASCII characters? You say the "the input could be any string", but your test cases only cover very specific types of strings.

To FlagAsSpam and nicael, you are both right. I thought that adding those rule would unnecesseraly overcomplicate the task.
Martin Büttner:
Yes, it can contain commas: added example.
Nothing happens, as you can see in examples.
No, the input cannot contain linefeed, you can assume that. added info.
Apostrophe, parantheses, Non-ASCII .... yeah, why not? added examples.

@SimoneChelo Additional test case: You will not win this challenge...! -> Not win this challenge..., you will.. A bit tricky because you can't use a pattern like (pronoun word)(string that doesn't end with puctuation) and then exchange them.

'have to' is an odd helper-verb construction peculiar to English; it's unlikely Yoda would use it. "This code challenge, win, you must." On the other hand, Yoda has his own helper-verb constructions he tends to use: "This code challenge, won, he did." I can't picture Yoda saying "This code challenge, he won" or "to win this code challenge, you have".

@RainerP. "Win this challenge, you will not." (c.f. "when 900 years old you are, look as good, you will not.)

Object (optional), Comma (if object), Primary Verb, Comma, Subject, Helper verb or modifier. (Of course, all this is irrelevant, because there's no reason the parameters of the challenge need to be accurate to actual Yoda-speak to be a good challenge).

@nicael Win this code challenge, you must is better...

@wiz Yeah, this sounds better.

It is not usually accepted by our community to accept an answer to the challenge 3 hours later. Give other people the chance to win!

"I ate an ice cream" ?

@LindaJeanne I can't picture Yoda saying anything at all about a "code challenge"!

"Input can end with a letter, a . or a !, not with a ?." It looks like you're listing all characters the input can end with, yet the example "I love constants like π" does not correspond to any of those case. Maybe you should simplify your sentence to "Input can't end with a ?".

@Cyoce The interests of someone who lived 800 years, you should not underestimate.

Don't the answers need more 'Mmmmm's?

Retina, 162 137 145 134 131 129
Multiple punctuation is now handled correctly. Test case: You will not win this challenge...! -> Not win this challenge..., you will.
Try it Online!
[.!]$

T`A-Z`a-z`^\w\w
G`^(I|we|you|s?he|it|they) \S+ \S
(\S+ \S+) (.*)
$2, $1.
T`a-z`A-Z`^.
^$
Too difficult, this sentence is.

Description:
If there is punctuation in the end, delete it.
[.!]$

^empty line

Transform the pronoun to lower case, except it is I.
T`A-Z`a-z`^\w\w

Filter out any line that does not match <Pronoun><space><word><space><word>...
G`^(I|we|you|s?he|it|they) \S+ \S

Split into pronoun + verb, remainder. Then rearrange.
(\S+ \S+) (.*)
$2, $1.

Transform the first character to upper case.
T`a-z`A-Z`^.

If the result is empty, it didn't pass the filter above. Print an error message.
^$
Too difficult, this sentence is.

The character classes in transliteration mode don't use square brackets.

Also, [^ ] can probably be replaced with \S everywhere, and in the first regex [^ ]+ can be replaced with .+. In the character classes you don't need to escape . so [.!] works fine. Also, since you don't swap the order of $1 and $2 in the third stage, you can capture them into a single group and save 5 bytes.

([^I]|It) can be shortened to ^\w\w

Wow, what a load of improvements. Thanks.

I think I|It can become I?, if Retina supports that

@CᴏɴᴏʀO'Bʀɪᴇɴ Thanks. I implemented it pretty similar, but one character shorter: s?he. But I had to convert to lowercase first, so It? is not possible anymore,

ES6, 212
This can probably a bit further golfed down:
i=>(r=/(you|s?he|it?|we|they)( \S+) ([^\.!?]+)/i.exec(i))?(c=(a,b)=>a[`to${['Low','Upp'][b]}erCase`]())(r[3].slice(0,1),1)+r[3].slice(1)+", "+c(r[1],+(/i/i.test(r[1])))+r[2]+".":"Too difficult, this sentence is."

JSFiddle (requires up-to-date browser like Chrome) or run it via node.js
Ungolfed:
i=>{
    r=/(you|s?he|it?|we|they)( \S+) ([^\.!?]+)/i.exec(i); //Main RegExp
    c=(a,b)=>a[`to${['Low','Upp'][b]}erCase`](); //shortcut for toUpperCase/toLowerCase
    if (r)
        return c(r[3].slice(0,1),1)+r[3].slice(1) + ", " //the "something else", properly formated
             + c(r[1], +(/i/i.test(r[1]))) //The subject lowercased except for "i" or "I"
             + r[2] + "."; //The End
    else //no match, no sentence to translate
        return "Too difficult, this sentence is.";
}

Broken test: I think they’ll add new features -> returns They, I think. on Google Chrome 47.0.2526.106 m. Also, it doesn't like I love constants like π. To add on that, I made a fantastic code challenge (I hope) returns A fantastic code challenge , I made. instead of A fantastic code challenge (I hope), I made.

@IsmaelMiguel Fixed, but even got 3 characters less due to another bug I also fixed

It solved all issues, all tests seem fine. Well done! You got my upvote.

You need to add ^ to the start of your regex otherwise a sentence with any text before the pronoun will still be parsed as valid.

JavaScript (ES6), 164 bytes
s=>([,p,,i,r]=s.match`^(((I)|You|He|She|It|We|They) \\S+) (.*?)[.!]?$`)?r[0].toUpperCase()+r.slice(1)+`, ${i?p:p.toLowerCase()}.`:"Too difficult, this sentence is."

Explanation
It's almost painful how many bytes capitalising the first letter of a string takes in JavaScript...
s=>

  // Match and get specific parts of the input string
  ([,p,,i,r]=s.match`^(((I)|You|He|She|It|We|They) \\S+) (.*?)[.!]?$`)?

    r[0].toUpperCase()+r.slice(1)     // capitalise first letter
      +`, ${i?p:p.toLowerCase()}.`    // lower-case the pronoun (unless it is I)
  :"Too difficult, this sentence is."

Test
Test does not use destructuring assignment to make it more cross-browser compatible.

var solution = s=>(p=s.match`^(((I)|You|He|She|It|We|They) \\S+) (.*?)[.!]?$`)?p[4][0].toUpperCase()+p[4].slice(1)+`, ${p[3]?p[1]:p[1].toLowerCase()}.`:"Too difficult, this sentence is."
<input type="text" id="input" value="I love constants like π...!" />
<button onclick="result.textContent=solution(input.value)">Go</button>

162 chars: var solution = s=>(p=s.match^(((It?)|You|[HW]e|[ST]hey) \\S+) (.*?)[.!]?$)?p[4][0].toUpperCase()+p[4].slice(1)+, ${p[3]?p[1]:p[1].toLowerCase()}.:"Too difficult, this sentence is."

@wally Thanks, but unfortunately that regex would make It stay capitalised and also match Shey instead of She.

Ah, my testing was insufficient!  Yes I can see why... Ah well.

Python, 261 bytes
import re
def a(b):
 if b[-1:]in".!":
  b=b[:-1]
 if re.match('(I|YOU|S?HE|IT|WE|THEY) \w+ \S+',b.upper()):
  b=(b+',').split()
  if b[0]!="I":
   b[0]=b[0].lower()
  b=" ".join(b[2:]+b[:2])
  return b[0].upper()+b[1:]
 return "Too difficult, this sentence is."

Turns out Python doesn't mind things like b[-1]in".!" Next I'll play with the match object more, if no-one beats me to it :)

I think you can remove a space in the b=b[:-1] part.

@CᴏɴᴏʀO'Bʀɪᴇɴ thanks!

you can put b=b[:-1] at the end of the line with the if. you can remove the space from after the return on the last line. this will break python3 compatibility by replacing 2 spaces with a tab and 3 with a tab and a space

Python, 218 217 204 bytes
Not sure if this can be further golfed down.
def f(s):t=s.split();u=' '.join(t[2:]).rstrip('!.');return['Too difficult, this sentence is.','%s, %s %s.'%(u[0].upper()+u[1:],['I',t[0].lower()][t[0]!='I'],t[1])][t[0]in'I We You He She It They'.split()]

Ungolfed:
def f(s):
    t = s.split()
    u = ' '.join(t[2:]).rstrip('!.')
    return [
        'Too difficult, this sentence is.',
        '%s, %s %s.' % (u[0].upper() + u[1:],
                        ['I', t[0].lower()][t[0] != 'I'],
                        t[1])
    ][t[0] in 'I We You He She It They'.split()]

you can change s.split(' ') to s.split() and 'I|We|You|He|She|It|They'.split('|') to 'I We You He She It They'.split(), replace the if...else with the same boolean list used elsewhere, change t[0]in to t[0]in, remove the spawce around the return

GNU sed, 129 bytes
I'm including +1 byte for the -r flag.
#!/bin/sed -rf

/^I /b
s/^(You|[HW]e|She|It|They) /\L&/
t
s/.*/Too difficult, this sentence is./p
d
:
s/[.!]$//
s/^([^ ]+ [^ ]+) (.*)/\u\2, \1./

Explanation
If we match a leading I we jump to the label:
/^I /b

If we match one of the other pronouns, we downcase it, then jump to the label:
s/^(You|[HW]e|She|It|They) /\L&/
t

Otherwise we print the failure message and move to the next input line:
s/.*/Too difficult, this sentence is./p
d

If we jumped to the label, we remove any final punctuation:
:
s/[.!]$//

and swap the first two words with the rest of the sentence, capitalising the new first word and adding the required punctuation as we do so:
s/^([^ ]+ [^ ]+) (.*)/\u\2, \1./

Your program does not check whether the input consists of at least three words. Sentences like You are pass first and second line  but don't match on the last, so the output is you are instead of the error message. Add a check like ...|They) \S+ \S/\L&/ to the first two lines.

@Rainer - You're right (I blame the lack of test cases for short inputs).  I'll look at how to rework this soon.


text:
A simple DNA simulator
Your code is going to generate a very simple ASCII-art representation of DNA, forever. It will take two numbers as input in any format you want: as a list, as arguments to a function, on stdin, etc.

A floating-point interval I in seconds between 0.0 and 1.0 (inclusive)
A zoom level Z as an integer from 1 to 64 (inclusive)

Your code will print one line to stdout or its equivalent every I seconds, producing an infinite output that looks something like this (for zoom level 4):
    A
 T-----a
G-------c
 G-----c
    g
 t-----A
a-------T
 c-----G
    T
 A-----t
C-------g
...

Specifically, our representation of DNA is a pair of sine waves connected by hyphens, one consisting of the characters a, c, g, and t, the other of the characters A, C, G, and T. If x is the 0-indexed number of the line we're currently printing, the 0-based position of the character in the lowercase wave is given by (sin(πx / Z) + 1) * Z, and in the uppercase wave is given by (-sin(πx / Z) + 1) * Z, both rounded (not floored) to the nearest integer. Further details:

In cases where the two waves overlap, you need to alternate which wave is in the front, starting with the uppercase wave. (Starting with the lowercase wave would give us a double helix that does not exist!)
Ignoring case, A always pairs with T and C always pairs with G, as in real DNA. The pairs themselves should be randomly chosen with a uniform distribution over the four possibilities. It does not matter if the choice of pairs is the same or different on successive runs of your code. The statistical quality of your random choices is not an issue as long as the output has no obvious pattern and a period at least in the billions (flawed PRNGs like RANDU are fine.)
You must either have no trailing spaces or pad every line to the maximum position of the waves at that zoom level (in the example above, nine characters.) Zoom level 1 may have one optional additional trailing space for mathematical reasons.

Because DNA is small, your code will need to be as short as possible.
More examples:
Zoom level 8:
        T
     C-----g
  A-----------t
 C-------------g
G---------------c
 T-------------a
  T-----------a
     T-----a
        c
     g-----C
  t-----------A
 g-------------C
a---------------T
...

Zoom level 2:
  A
T---a
  c
g---C
  G
A---t
  c
a---T
...

Zoom level 1 (note the leading space):
 G
 a
 C
 t
...

Related.

"Because DNA is small, your code will need to be as short as possible." Really?

@TanMath Do you really need a reason to Code-Golf? The backstories are almost always silly like this, just go with it.

@PatrickRoberts I know, but I was just pointing out how silly the reason is, a many code-golfers do. Don't take it too seriously! ;)

What does "randomly chosen" mean? Is RANDU okay? What about a shorter repeating sequence?

Added a clarification.

"Because DNA is small, your code will need to be as short as possible." It's funny cause 5.5 petabits can be stored in 1 cubic millimeter of DNA

Ruby, Rev B 171 161 bytes
Fixing the output for z=1 cost 10 bytes. It's a special case: the helix is really 3 characters wide if you looked at it at 90 degrees, but as we look at it at 0 degrees it looks only 1 character wide. zero leading spaces on z=1 no longer required
Some savings by eliminating brackets and by multiplying y.abs by 2 before truncation when calculating the number of - characters needed.
Finally, I avoided the include Math (required for sin and PI) by using complex number arithmetic with powers of the number i. The imaginary part of the complex number is equivalent to sin x, except that it repeats with period 4 instead of period 2*PI. Saving for this change was either 1 or 0 bytes.
->z,i{x=0
loop{y=z*("i".to_c**x).imag
s=(?-*(y.abs*2)).center z*2+1
s[z-y+0.5]='TGAC'[r=rand(4)]
x!=0&&s[z+y+0.5]='actg'[r]
puts s
sleep i
x+=2.0/z
x>3.99&&x=0}}

Ruby, Rev A 165 bytes
This is way longer than expected. There are a few potential golfing opportunities to be explored.
include Math
->z,i{x=0
loop{y=z*sin(x)
s=('--'*(y.abs+h=0.5)).center(z*2+1)
s[z+h-y]='TGAC'[r=rand(4)]
x!=0&&s[z+h+y]='actg'[r]
puts s
sleep(i)
x+=PI/z
x>6.28&&x=0}}

Commented in test program
include Math
f=->z,i{x=0
  loop{y=z*sin(x)
    s=('--'*(y.abs+h=0.5)).center(z*2+1)  #make a space-padded string of z*2+1 characters, containing enough - signs
    s[z+h-y]='TGAC'[r=rand(4)]            #insert random capital letter, saving index in r
    x!=0&&s[z+h+y]='actg'[r]              #insert small letter. This will normally go on top of the capital as it is done second, but supress for x=0 to make helix
    puts s
    sleep(i)
    x+=PI/z                               #increment x
    x>6.28&&x=0                           #reset x if equal to 2*PI (this proofs against loss of floating point precision, making correct output truly infinite.)
  }
}

Z=gets.to_i
I=gets.to_f
f[Z,I]

Looking good! One minor issue: there's a leading space for zoom level 1. Also, in your test program I=gets.to_i should be I=gets.to_f.

Whoops! You're right that Z=1 is a special case. That wasn't intentional and is actually a contradiction in the rules given the math I provided. I'm going to add the leading space for Z=1 to make the math consistent.

@Luke in general rules shouldn't be changed, but indeed there was a contradiction. As far as I can tell, the other answers haven't considered it either. I'll update my answer later, then, as it will be shorter that way.

@Luke updated, but it means I have both a leading space and a trailing space on Z=1. I understand that's according to the spirit of what you want and therefore OK, though its not strictly according to the phrasing about trailing spaces and the example for Z=1.

Whoops again, yes that's fine. Sorry for the confusion.

You can save a few bytes by using 1i instead of "i".to_c.

C, 569 402 361 bytes
#include<stdlib.h>
u,l,r,m,n,Z,I,y=0,x=0;main(c,char**v){Z = atoi(v[1]);I=atof(v[2])*1000000;srand(time(0));char *a="ACGTtgca";while(1){r=rand()%4;usleep(I);double s=sin(3.14*x++/Z);u=floor(((-1*s+1)*Z)+0.5);l=floor(((s+1)*Z)+0.5);m=(u<l)?u:l;n=u<l?l:u;char z[n+1];memset(z,' ',n);z[l]=a[r+4];z[u]=a[r];for(y=m+1;y<n;y++)z[y]='-';z[n+1]='\0';printf("%s\n",z);}}

Whipped this up pretty quick so I am sure there are some other things I could do to decrease my score but I am just happy I got this program to compile and run properly on the first attempt.
De-golf version:
#include<stdio.h>
#include<math.h>
#include<unistd.h>
#include<time.h>
#include<stdlib.h>
u,l,r,m,n,Z,I,y=0,x=0;
main(c,char**v){
   Z = atoi(v[1]);
   I=atof(v[2])*1000000;
   srand(time(0));
   char *a="ACGTtgca";
   while(1){
      r=rand()%4;
      usleep(I);
      double s=sin(3.14*x++/Z);
      u=floor(((-1*s+1)*Z)+0.5);
      l=floor(((s+1)*Z)+0.5);
      m=(u<l)?u:l;
      n=u<l?l:u;
      char z[n+1];
      memset(z,' ',n);
      z[l]=a[r+4];
      z[u]=a[r];
      for(y=m+1;y<n;y++)z[y]='-';
      z[n+1]='\0';
      printf("%s\n",z);
   }
}

UPDATE: I adjusted the loop to print everything in one print statement and used the fact that variables are defined as int by default to shave some bytes.
UPDATE2: Some var renaming and some logic shortening to shave a few more bytes.

You need to get hold of GCC. It's Linux but you can also run it on windows with Cygwin. Variables (if declared at the beginning of the program or as function arguments) don't need a type, they are assumed to be int. The same with functions. And I'm pretty sure you won't need those includes.

Also you have too many printfs :-D. Either 1. use putchar to print one character at a time or 2. work out what you want to print and then print it all with puts. 3. work out how to use a single printf with a big complex expression in it. Anyway, +1.

Okay thanks for the suggestions! I will try and make a single print statement. That is a good idea and I am sure it would improve my score. I will regolf this when I have some time today. Thanks @steveverrill

C, 294 289 285 283 281 270 265 237 218 bytes
#include<math.h>
o,i,p,r;char*c="acgtTGCA",d[256]={[0 ...254]='-'};P(w,z)float w;{for(;;poll(0,0,r=w*1e3))p=fabs(sinf(M_PI*i++/z))*z+.5,r=rand()&3,o^=4*!p,printf(p?"%*c%s%c\n":"%*c\n",z-p+1,c[r+o],d+256-p*2,c[r+4-o]);}

Or the longer version which parses input from main:
#include<stdlib.h>
#include<math.h>
o,i,p,r;char*c="acgtTGCA",d[256]={[0 ...254]='-'};main(n,v)char**v;{for(;n=strtod(v[2],0);poll(0,0,n=atof(v[1])*1e3))p=fabs(sinf(M_PI*i++/n))*n+.5,r=rand()&3,o^=4*!p,printf(p?"%*c%s%c\n":"%*c\n",n-p+1,c[r+o],d+256-p*2,c[r+4-o]);}

It's a pretty dumb overall implementation, with some printf tricks thrown in. It has some missing includes, uses K&R syntax for the function, and relies on GCC's range initialisers, so this isn't very standard. Also the function version still uses globals, so it can only be called once!
The function version takes 2 parameters; wait (in seconds) and zoom. Here's a caller for it:
#include <stdlib.h>
int main( int argc, const char *const *argv ) {
    if( argc != 3 ) {
        printf( "Usage: %s <delay> <zoom>\n", argv[0] );
        return EXIT_FAILURE;
    }
    const float delay = atof( argv[1] );
    const int zoom = strtod( argv[2], 0 );
    if( delay < 0 || zoom <= 0 ) {
        printf( "Invalid input.\nUsage: %s <delay> <zoom>\n", argv[0] );
        return EXIT_FAILURE;
    }
    P( delay, zoom );
    return EXIT_SUCCESS;
}

Run as:
./dna <delay> <zoom>
./dna 0.5 8

Breakdown:
// Globals initialise to 0
o,                                 // Ordering (upper/lower first)
i,                                 // Current iteration
p,                                 // Current indent
r;                                 // Current random value
char*c="acgtTGCA",                 // The valid letters
    d[256]={[0 ...254]='-'};       // Line of dashes (for printing)
main(n,v)char**v;{                 // K&R-style main definition (saves 2 bytes)
    // n will be used for Zoom, random number & casting delay
    for(
        ;n=strtod(v[2],0);         // Store zoom
        poll(0,0,n=atof(v[1])*1e3) // After each loop, use poll to delay
                                   // (Use variable to cast delay to int)
    )
        p=fabs(sinf(M_PI*i++/n))*n+.5,   // Calculate separation / 2
        r=rand()&3,                      // Pick random number [0-4)
        o^=4*!p,                         // Reverse order if crossing
        printf(p                         // Print... if not crossing:
                ?"%*c%s%c\n"             //  indent+character+dashes+character
                :"%*c\n",                //  Else indent+character
                n-p+1,                   // Width of indent + 1 for char
                c[r+o],                  // First character
                d+256-p*2,               // Dashes
                c[r+4-o]                 // Second character
        );
}

You're allowed to use a function instead of main(), which will save you the bytes of strtod and atof.

@Luke Ah cool; I'll see how much that saves...

JavaScript (ES6) 241 244 227 222 231 bytes
This looked interesting - I love ASCII art!
Just started, still in the process of golfing it...
(I,Z)=>{c=i=0,setInterval(_=>{with(Math)m=sin(PI*i++/Z),a=round(++m*Z),b=round((2-m)*Z),r=random()*4|0,D="TGAC"[r],d="actg"[r],e=a-b,c^=!e,p=" ".repeat(a>b?b:a)+(c?D:d)+"-".repeat(e?abs(e)-1:0)+(e?a>b?d:D:""),console.log(p)},I*1e3)

--- EDIT: turns out I can't actually put it in eval() - otherwise it can't access  vars I and Z (so adds 9 bytes)
- saved 6 bytes thanks to user81655
- saved 5 bytes thanks to Dave
Explanation
(I,Z)=>{
  c=i=0,                                // clear vars
  setInterval(_=>{                      // repeat

    with(Math)
      m=sin(PI*i++ / Z),                // calculate waves
      a=round(++m * Z),
      b=round((2-m) * Z),
      r=random()*4|0,                   // get random amino-acids
      D="TGAC"[r],
      d="actg"[r],
      e=a-b,
      c^=!e,                            // alternate upper/lowercase
      p=                                // prepare output
        " ".repeat(
          a>b ? b : a
        )+(
          c ? D : d
        )+

        "-".repeat(
          e ? abs(e)-1 : 0
        )+(
          e ? a>b ? d : D : ""
        ),

      console.log(p)                    // return output
  },I*1e3)                              // repeat for every 'I' seconds
}

You could save another 4 bytes by using c^=!e instead of c+=a==b (lets you remove the %2 check later). Also -m+2 could be 2-m!

@Dave - thanks! Would you mind explaining what c^=!e actually does? I've never seen that before :)

It's the same as c=c^(e==0); it applies an XOR in the same way you previously had an addition. If you're unfamiliar with XOR, it's a bitwise operation: eXclusive OR (wikipedia can explain it properly)


text:
Conjugate in the Spanish imperfect / Conjugue en el imperfecto de indicativo
Given an input of a Spanish verb in its infinitive form, output the verb
conjugated in all 6 forms of the indicative imperfect.
To conjugate an infinitive in the imperfect, remove the infinitive ending (-ar,
-er, -ir, and sometimes -ír) and add the imperfect endings listed below. There
are three irregular verbs in the imperfect, also listed below.
Verb ending    Replace with...
--------------------------------------------------------
-ar            -aba, -abas, -aba, -ábamos, -abais, -aban
-er, -ir, -ír  -ía,  -ías,  -ía,  -íamos,  -íais,  -ían

Irreg. verb    Conjugations
--------------------------------------------------------
ser            era,  eras,  era,  éramos,  erais,  eran
ver            veía, veías, veía, veíamos, veíais, veían
ir             iba,  ibas,  iba,  íbamos,  ibais,  iban

For the purposes of this challenge, use capital letters instead of accented
letters (á becomes A, é becomes E, and í becomes I). This is only because
accented letters are 2 bytes in UTF-8, but they can be different in other
encodings, and I'd rather not have to deal with any of that and stay within
printable ASCII instead.
Infinitive verbs will always be three or more characters long with the sole
exception of the verb ir, will never contain accented letters with the
exception of verbs that end in -ír, and will always end in either -ar, -er,
-ir, or -ír.  Reflexive verbs do not need to be handled.
Output may be in either the form of a whitespace-/comma-separated string (so
printing each conjugation to STDOUT on its own line is okay) or an
array/list/etc.
Since this is code-golf, the shortest code in bytes wins.
Test cases:
In       Out
---------------------------------------------------------------
hablar   hablaba hablabas hablaba hablAbamos hablabais hablaban
comer    comIa comIas comIa comIamos comIais comIan
vivir    vivIa vivIas vivIa vivIamos vivIais vivIan
sonreIr  sonreIa sonreIas sonreIa sonreIamos sonreIais sonreIan
ser      era eras era Eramos erais eran
ver      veIa veIas veIa veIamos veIais veIan
ir       iba ibas iba Ibamos ibais iban

So many exceptions.. :P

@ZachGates See, you say that, but you haven't seen anything until you've seen preterite. Imperfect is one of the tenses with the least exceptions.

I've taken Spanish 1-3, hehe. 0/10 would not recommend @FlagAsSpam

@ZachGates Me too. :c

Retina, 100 82 bytes
\B[^a]r$
I
r$
b
^vI$
veI
^sI$
er
$
a
$
 $_s $_ $_mos $_is $_n
T`l`L`.(?=[^I]amos )

Try it online. Unfortunately, due to the use of $_ it's not possible to modify the code to run all tests at once, so you'll have to copy in the individual verbs. I'm working on a new feature that will make this possible though.
Explanation
\B[^a]r$
I

We start by turning all endings which aren't ar into I, provided the input isn't the irregular verb ir. That takes care of the -er, -ir, -ír conjugations, messes up the irregular verbs ser and ver (but shortens them in the process), and leaves only ir and -ar with a trailing r.
r$
b

If the word still ends in r, we replace that with a b. We've now covered all standard conjugations as well as the irregular verb ir.
^vI$
veI

This fixes the irregular verb ver which has been turned into vI in the first stage.
^sI$
er

This fixes the irregular verb ser which has been turned into sI in the first stage. Now we've modified all possible stems correctly. All that's left to do is append all the possible endings, and then fix the accent for the first person plural in some cases.
$
a

First we append an a to the stem, because that's always part of all endings.
$
 $_s $_ $_mos $_is $_n

This makes use of the rarely seen $_ which inserts the entire string into the substitution (regardless of what was matched). This is actually very useful when duplicating strings, as are $` and $', which are also quite underappreciated.
Before this stage, we've got the first person singular in the string. We now append the other conjugations, by matching the end of the string with $ and building the other forms by appending the appropriate suffixes to the first person singular.
T`l`L`.(?=[^I]amos )

Finally, we fix the accent for the first person plural if applicable. This only needs to be done for a vowel, two characters in front of the -amos unless the character in between is I. So we match such a character and then use a transliteration stage to convert lower to upper case. This makes use of the new character classes l and L which I only added yesterday. They expand to a-z and A-Z respectively, so that new feature saves 4 bytes here.

Python 3, 154 232 bytes
M=input()
Q={'ser':'er','ver':'veI','ir':'ib'}.get(M)
H=[(Q if Q else M[:-2]+("ab"if M[-2:]=="ar"else"I"))+j for j in"a as a amos ais an".split(' ')]
if M[-2:]=="ar":H[3]=M[:-2]+"Abamos"
if Q in['er','ib']:H[3]=H[3].title()
print(H)

Fixed the missing capitals in irregular verbs.

Ungolfed
M=input()
Q={'ser':'er','ver':'veI','ir':'ib'}.get(M)

H=[]
for j in "a as a amos ais an".split(' '):
    if Q:
        F = Q
    else:
        if M[-2:] == "ar":
            F = M[:-2] + "ab"
        else:
            F = M[:-2] + "I"
    H += [F + j]

if M[-2:] == "ar":
    H[3] = M[:-2] + "Abamos"

if Q in ['er', 'ib']:
    H[3] = H[3].title()

print(H)

Milky Way 1.6.2, 281 bytes
'?{"ser"b_^"er";_}?{"ver"b_^"veI";_}?{"ir"b_^"ib";_}?{_:y2->CH=<1-&{~>;+<1-}^>;+<;_^""0}?{"ar"b_"ab";>+<0_}?{_"I";>+<_^}^;^"an ais amos a as a"" "\?{<y__<^}=3&{~<:>;>;+!^<1-}^?{'C=^"a"b_'C:y2->=^^<ΩG"Abamos"+!^^_}?{<"er"b_"Eramos"!^^_}?{<"ib"b_"Ibamos"!^^_}J:y1-;=<&{~<:>;>;+!^<1-}

Well that took awhile! Looks like I need to add some builtins, hehe...

Usage
./mw <path-to-code> -i <input>

Examples
$ ./mw test.mwg -i "hablar"
hablaba
hablabas
hablaba
hablAbamos
hablabais
hablaban

$ ./mw test.mwg -i "ver"
veIa
veIas
veIa
veIamos
veIais
veIan

Ruby, 151 149
Normally, I'll choose a newline over a semicolon where possible in the interests of readability, but as there are no semicolons, this is a one liner.
->n{%w{a as a amos ais an}.map{|z|['3r','veI','1b',n[0..-3]+(n[-2]==?a?'@b':?I)][("ser ver ir  "+n).index(n)/4].tr('31@',['eia','EIA'][z.size/4])+z}}

A feature is the use of placeholders 31@ for the accented vowels which depend on the amos endings. Thus the correct stem is formed, and then the placeholder is substituted for one of eia or EIA as appropriate
There a few uses of negative array indexes in here. Thus n[-2] refers to the second to last character of the input, and n[0..-3] refers to the input with the last 2 characters removed (the infinitive stem).
Ungolfed in test program
f=->n{
%w{a as a amos ais an}.map{|z|            #iterate through each verb ending
    ['3r','veI','1b',                     #array index 0,1,2 formats for irregular stems (note numbers 1 and 3 used as placeholders)
    n[0..-3]+(n[-2]==?a?'@b':?I)][        #array index 3 format for regular stems, AR->@b or ER/IR->I depending if A found at index -2 (@ used as placeholder)
    ("ser ver ir  "+n).index(n)/4]        #find index of input verb n in "ser ver ir  "+n, divide by 4 to obtain 0,1,2,3 above
    .tr('31@',['eia','EIA'][z.size/4])+   #if z is 4 characters long (AMOS) replace 3,1,@ with uppercase E,I,A. Otherwise with lowercase e,i,a
    z                                     #add the verb ending to the stem
  }
}

n=gets.chop
puts f[n]

Lexurgy, 153 bytes
i:
ser=>era
ver=>veIa
ir=>iba
([]+)$1 {a,{e,i,I}} r=>$1 {ab,I} a
c:
([]+)$1=>$1 ` $1 s ` $1 ` $1 mos ` $1 is ` $1 n
j:
i=>I/` _ bam
e=>E/` _ ram

Ungolfed explained:
# turn the irregulars into their roots
irreg:
ser=>era
ver=>veIa
ir=>iba

# do the same for everything else
roots:
([]+)$1 {a,{e,i,I}} r=>$1 {ab,I} a

# tack on the same endings
conjugate:
([]+)$1=>$1 ` $1 s ` $1 ` $1 mos ` $1 is ` $1 n

# fix the irregulars
irreg2:
i=>I/` _ bam
e=>E/` _ ram

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