text:
English to Alien translator
Briefing
Aliens have settled on earth and strangely enough, their alphabet is the exact same as ours. Their language is also very similar to ours with some very distinct and easy to compute differences.
Challenge
Take a string and output the alien's language equivalent. The translation works as such:
Swap all the vowels in the word with the corresponding:
  Vowel |   With
--------+--------
   a    |   obo
   e    |   unu
   i    |   ini
   o    |   api
   u    |   iki

You may also write another translator to translate Alien->English, this is optional however.
Examples
Input: Shaun
Output: Shoboikin

Input: Java
Output: Jobovobo

Input: Hello, World!
Output: Hunullapi, Wapirld!

If the vowel is capitalized then you capitalize the first letter..
Input: Alan
Output: Obolobon

Input: Australia
Output: Oboikistroboliniobo

Rules

Standard loopholes apply
Must work for text that contains new lines
You can either write a function, lambda, or full program
Capingrobotikilobotiniapins apin wrinitining thunu runuvunursunu trobonslobotapir!

I'm not sure what You may also write another translator to translate Alien->English is supposed to mean. Can we write the reverse translator instead of the regular one?

Maybe it's just me, but it's not obvious to me that also carries this meaning here. Anyway, I'm not sure how this is a rule if it's not part of the actual task.

@Dennis You're being a bit punudobontinic, but I've edited it to make it clearer.

Why the requirement for newlines? In my opinion, this is unnecessary and doesn't add anything to the main point of the challenge.

Can the input contain any ASCII character or only a subset. E.g., will there ever be numbers in the input?

@Riley yes, there may be.

Will all strings be capitalized?

Haskell, 100 91 bytes
(>>= \x->last$[x]:[y|(z:y)<-words"aobo eunu iini oapi uiki AObo EUnu IIni OApi UIki",z==x])

Hoboskunull surely

TI-Basic, 173 + 59 + 148 = 380 bytes
Hopefully the aliens use TI-83/84 calculators ;)
Main Program, 173 bytes
BONUS: Keep second or third line depending on whether your want a normal or reverse translator.
"("+Ans+")→Str1
"@a~obo@A~Obo@e~unu@E~Unu@i~ini@I~Ini@o~api@O~Api@u~iki@U~Iki@→Str2    <-- English to Alien
"@obo~a@Obo~A@unu~e@Unu~E@ini~i@Ini~I@api~o@Api~O@iki~u@Iki~U@→Str2    <-- Alien to English
For(I,2,length(Ans
If "@"=sub(Str2,I-1,1
Then
Str1+"~"+sub(Str2,I,inString(Str2,"@",I)-I
prgmQ
Ans→Str1
End
End

Subprogram (prgmQ), 59 bytes:
Ans→Str9
inString(Ans,"~
sub(Str9,Ans,length(Str9)-Ans+1→Str8
Str9
prgmR
Repeat Str9=Ans+Str8
Ans+Str8→Str9
prgmR
End

Subprogram (prgmR), 148 bytes:
Ans→Str0
inString(Ans,"~→Z
inString(Str0,"~",Ans+1→Y
inString(sub(Str0,1,Z-1),sub(Str0,Z+1,Ans-Z-1→X
sub(Str0,1,-1+inString(Str0,"~
If X
sub(Str0,1,X-1)+sub(Str0,Y+1,length(Str0)-Y)+sub(Str0,X+length(sub(Str0,Z+1,Y-Z-1)),Z-X-length(sub(Str0,Z+1,Y-Z-1

P.S. ~ represents token 0x81 and @ represents token 0x7F, learn more here.
P.P.S. Part of why these programs have a high byte count is because sub(, inString(, length(, and all lowercase letters are two bytes each...

I think you mixed up prgmR and prgmQ in your code headlines once?

Yes, thanks for catching that @ByteCommander :)

Perl, 56 bytes
Includes +1 for -p
Give input on STDIN
alien.pl:
#!/usr/bin/perl -p
s%\w%"`"&$&|("A\x0fboE\x15nuI\x09niO\x01piU\x09ki"=~/\u$&\K.../,$&)%eg

Works as shown, but replace the \xXX escapes by the actual character to get the claimed score

+1 Upvoted just for the Alien avatar. Just kidding, the solution is nice, also.

Jesus christ.. Perl at its best, ladies and gents.

05AB1E, 28 27 20 bytes
žÀ.•₅%~≠#ùÛãú•3ôD™«‡

Try it online!
Unuxplobonobotiniapin
žÀ                    # the string "aeiouAEIOU"
  .•₅%~≠#ùÛãú•        # the string "obounuiniapiiki"
              3ô      # split in pieces of 3
                D™«   # concatenate with a title-case copy
                   ‡  # transliterate

Ini lapivunu gapilfining!

@BasicallyAlanTuring: Took me way too long to translate that in my head. I think I need a reverse translator :P

Go for it, shouldn't be too hard :P

Scary, I think it says I love golf.

I've changed my question which makes you answer invalid. This must work with new lines

@BasicallyAlanTuring: What about languages (like this) that can't take newlines in input? Would taking multiple inputs separated by a newline be an acceptable alternative? Like this.

Python, 99 95 93 bytes
lambda s:"".join(("ouiaiOUIAI bnnpkbnnpk ouiiiouiii"+c)["aeiouAEIOU".find(c)::11] for c in s)

On ideone.com...
Pretty simple. Just take the index we find each character at in the vowel list and use it to pull the three characters we need. If it's not found, .find() returns -1 so just stick the current character on the end of the string. The spaces are necessary so any letter "a" doesn't include the added c. The translated vowels are grouped by letter order (the first letter of every translation, then the second, then the third).

Wow, nice creative approach. I'm impressed :)

You can remove the space in ["aeiouAEIOU".find(c)::11] for

sed 89
s,a,&b\n,gi
s,i,&n\r,gi
s,o,&p\r,gi
s,u,&k\r,gi
s,e,&n\f,gi
y,aeouAEOU\n\r\f,ouaiOUAIoiu,

Does this work for input that contains newlines?

@Jordan It does. sed reads "one line at a time". So it will process everything up to the first newline, print that, print a newline, then start over if there is more text.

Ah, of course.

@Jordan That wasn't a rule when I wrote this, but it ended up working anyway.

PHP , 91 Bytes
<?=strtr($argv[1],[A=>Obo,E=>Unu,I=>Ini,O=>Api,U=>Iki,a=>obo,e=>unu,i=>ini,o=>api,u=>iki]);

Python, 129 bytes
lambda s:"".join([str,str.capitalize][ord(l)<91]({"a":"obo","e":"unu","i":"ini","o":"api","u":"iki"}.get(l.lower(),l))for l in s)

See it running on ideone.com
Here's a more nicely formatted version:
lambda s: \
    "".join(
        [str, str.capitalize][ord(l) < 91](
            {"a":"obo", "e":"unu", "i":"ini", "o":"api", "u":"iki"}
            .get(l.lower(), l)
        )
    for l in s)

The most interesting parts are { ... }.get(l.lower(), l) which tries to look up the letter stored in l converted to lower case in the dictionary and either returns the translated version (if found), or else the original letter,
and [str, str.capitalize][ord(l) < 91]( ... ) which checks whether the original letter was a capital letter (ASCII code point lower than 91) and then either calls the str() function with the letter as argument (if it wasn't a capital letter, does nothing) or the str.capitalize() function (converts the first letter of the argument string to upper case).

Batch, 215 bytes
@echo off
set/pt=
set s=
:l
if "%t%"=="" echo(%s%&exit/b
set c=%t:~0,1%
for %%a in (obo.a unu.e ini.i api.o iki.u Obo.A Unu.E Ini.I Api.O Iki.U)do if .%c%==%%~xa set c=%%~na
set s=%s%%c%
set t=%t:~1%
goto l

Takes input on STDIN. Processing character-by-character has the convenience of being case-sensitive.

Batch is just the worst tool for everything, isn't it? (Well, at least you beat TI-Basic :)
Nice seeing a codegolf in Batch, by the way!

Pyth, 42 bytes
#sXw"aeiouAEIOU"+Jc"obounuiniapiiki"3mrd3J

A program that takes input on STDIN and prints the output.
Try it online
How it works
#sXw"aeiouAEIOU"+Jc"obounuiniapiiki"3mrd3J  Program.
#                                           Loop until error statement:
   w                                         Get w, the next line of the input
                   "obounuiniapiiki"         Yield string literal "obounuiniapiiki"
                  c                 3        Split that into groups of three characters
                 J                           Assign that to J and yield J
                                     mrd3J   Map title case over J
                +                            Merge the lower and title groups
    "aeiouAEIOU"                             Yield string literal "aeiouAEIOU"
  X                                          Translate w from that to the three-character
                                             groups
 s                                           Concatenate that
                                             Implicitly print

C, 167 bytes
I really didn't want to break my habit of always doing main functions when coding C, but this is substantially shorter than the version with a main and this way I got another letter to spell what I wanted!
Golfed
a;l;i;e(char*n){for(;i=*n++;l=i>90,i-=32*l,a=!(i-65)+2*!(i-69)+3*!(i-73)+4*!(i-79)+5*!(i-85),printf(a?"%c%c%c":"%c",(a?"HOUIAI"[a]:i)+l*32,"ibnnpk"[a],"!ouiii"[a]));}

Commented
a;l;i;
e(char*n)
{
    for(;
        i = *n++;  /* Get char and advance */
        l = i>90,  /* Is lowercase? */
        i -= 32*l, /* Make uppercase */

        /* Is 1,2,3,4,5 depeding on the vowel and 0 for no vowel */
        a = !(i-65) + 2*!(i-69) + 3*!(i-73) + 4*!(i-79) + 5*!(i-85),

        printf(a?"%c%c%c":"%c",        /* Print 1 or 3 chars? */
               (a?"HOUIAI"[a]:i)+l*32, /* Print appropriate char+case */
                  "ibnnpk"[a],            /* Print appropriate char */
                  "!ouiii"[a]));          /* Print appropriate char */
}

There is something special about C and how horrible you can be with pointers and such.

151 bytes

@ceilingcat I'd say post your answer on its own. It's diverged enough to deserve its own answer. :)

C (gcc), 150 141 136 134 bytes
a;i;e(char*n){for(char*v=" AEIOUIAI",*t;i=*n++;printf(&a))t=index(v,i-i/96*32),a=t?t-v:0,a=a?v[a+3]|L" 潢畮楮楰楫"[a]<<8|i&32:i;}

Try it online!
Based on the answer by @algmyr and -8 thanks to @ASCII-only
Less golfed version
a;i;
e(char*n){
  for(char*v=" AEIOUIAI",*t;i=*n++;printf(&a))
    t=index(v,i-i/96*32),
    a=t?t-v:0,
    a=a?v[a+3]|L" 潢畮楮楰楫"[a]<<8|i&32:i;
}

149? a;l;i;e(char*n){for(char*v=" AEIOU",*t;i=*n++;printf("%c%c%c"+4*!a,(a?" OUIAI"[a]:i)|i&32," bnnpk"[a]," ouiii"[t=index(v,i-32*l),a=t?t-v:0]))l=i>96;}

maybe also 149: a;l;i;e(char*n){for(char*v="AEIOU",*t;i=*n++;printf("%c%c%c"+4*!a,(a?" OUIAI"[a]:i)|i&32," bnnpk"[a]," ouiii"[t=index(v,i&95),a=t&&t-v<5?t-v+1:0]));}

144: a;l;i;e(char*n){for(char*v=" AEIOU",*t;i=*n++;)printf("%c%c%c"+4*!a,a?" OUIAI"[a]|i&32:i," bnnpk"[a]," ouiii"[t=index(v,i-i/96*32),a=t?t-v:0]);}

Retina, 60 bytes
Byte count assumes ISO 8859-1 encoding.
[A-Z]
»$&
T`L`l
i
ini
u
iki
e
unu
a
·b·
o
api
·
o
T`»l`_L`».

Try it online!

Javascript (ES6), 94 93 92 bytes
s=>s.replace(/[aeiou]/gi,c=>"OUIAIouiai"[n="AEIOUaeiou".search(c)]+"bnnpk"[n%=5]+"ouiii"[n])

Saved 1 byte thanks to edc65
Saved 1 byte thanks to Neil
Demo

let f =
s=>s.replace(/[aeiou]/gi,c=>"OUIAIouiai"[n="AEIOUaeiou".search(c)]+"bnnpk"[n%=5]+"ouiii"[n])

function translate() {
  document.getElementById("o").value = f(document.getElementById("i").value);
}
translate();
<input id="i" size=80 oninput="translate()" value="Hello, World!"><br><input id="o" size=80 disabled>

To check the return value of .indexOf and .search use ~ instead of <0

I looked to see what would happen if you only replaced vowels, and I originally got s=>s.replace(/[aeiou]/gi,c=>"ouiaiOUIAI"[n="aeiouAEIOU".indexOf(c)]+"bnnpk"[n%=5]+"ouiii"[n]) which is still 93 bytes. But since c is now known to be a vowel you can now use search instead of indexOf to save a byte!

@Neil - Nice! I tried both, actually, but didn't think about combining them.

C#, 133 121 bytes
s=>{int i;return string.Concat(s.Select(c=>(i ="AIUEOaiueo".IndexOf(c))>-1?"OboIniIkiUnuApioboiniikiunuapi".Substring(i*3,3):c+""));}

Edit (thanks to milk)
thank you :) I actually know this overload but somehow completely forgot it when writing this..
s=>string.Concat(s.Select((c,i)=>(i="AIUEOaiueo".IndexOf(c))>-1?"OboIniIkiUnuApioboiniikiunuapi".Substring(i*3,3):c+""));

You can use the Select(char, int) overload so you don't need to declare i and can put it all in one line. s=>string.Concat(s.Select((c,i)=>(i="AIUEOaiueo".IndexOf(c))>-1?"OboIniIkiUnuApioboiniikiunuapi".Substring(i*3,3):c+""));

Java 8, 172 bytes
String f(String s){String v="AEIOUaeiou",r="OboUnuIniApiIkiobounuiniapiiki",o="";for(char c:s.toCharArray()){int n=v.indexOf(c);o+=n>-1?r.substring(n*3,n*3+3):c;}return o;}

ungolfed:
String f(String s){
    String v="AEIOUaeiou",r="OboUnuIniApiIkiobounuiniapiiki",o="";
    for(char c:s.toCharArray()){
        int n=v.indexOf(c);
        o+=n>-1?r.substring(n*3,n*3+3):c;
    }
    return o;
}

And Alien back to English (171 bytes):
String g(String s){String[] v="AEIOUaeiou".split(""),r="Obo Unu Ini Api Iki obo unu ini api iki".split(" ");for(int i=0;i<v.length;i++)s=s.replaceAll(r[i],v[i]);return s;}

Ungolfed:
String g(String s){
    String[] v="AEIOUaeiou".split(""),r="Obo Unu Ini Api Iki obo unu ini api iki".split(" ");
    for(int i=0;i<v.length;i++)s=s.replaceAll(r[i],v[i]);
    return s;
}

Tcl, 75 bytes
String to be translated is in the variable s.
string map {A Obo a obo E Unu e unu I Ini i ini O Api o api U Iki u iki} $s

Mathematica, 128 bytes
#~StringReplace~{"a"->"obo","A"->"Obo","e"->"unu","E"->"Unu","i"->"ini","I"->"Ini","o"->"api","O"->"Api","u"->"iki","U"->"Iki"}&

Not sure whether a shorter program can be obtained by using IgnoreCase->True together with a case check.

C, 207 202 bytes (thanks to Cyoce)
#include <stdio.h>
#define r(c,t) case c:printf(t);continue;
int main(){int c;while(~(c=getchar())){switch(c){r('a',"obo")r('e',"unu")r('i',"ini")r('o',"api")r('u',"iki")default:putchar(c);}}return 0;}

1) I hate to omit type before any kind of declarations
2) I don't really like to put unusable code (without main() function)
Usage:
c89 cg.c -o cg; echo "Testing" | ./cg

Welcome to PPCG!

@MartinEnder, that's unexpected... but thank you :)

(c=getchar())!= EOF can become ~(c=getchar())

143 bytes

C 178 bytes
char*p[256],*a="obo\0unu\0ini\0api\0iki\0Obo\0Unu\0Ini\0Api\0Iki",*b="aeiouAEIOU";main(c){for(c=0;b[c];++c)p[b[c]]=a+4*c;for(;(c=getchar())>0;)p[c]?printf("%s",p[c]):putchar(c);}

153 bytes

@ceilingcat &c can be ok if it save number as byte1 byte2 byte3... For example 255  in memory as ff 00 00 00 but if there is the other endian for 255 we have 00 00 00 ff and print the void string ...

C, 163 162 159 bytes
char*t="aeiou";n,k;q(char*x){for(;*x;n<0||(*x=t[n>1?n%2?0:2:n+3])&&k>90||(*x-=32),printf("%c%.2s",*x++,n<0?"":&"bonunipiki"[2*n]))n=strchr(t,tolower(k=*x))-t;}

putting char*t="aeiou"; into for loop saves 1 byte

144 bytes

Swift 2.2 196 bytes
¯\_(ツ)_/¯
Golfed
var r = ["a":"obo","e":"unu","i":"ini","o":"api","u":"iki"];var q={(s:String) in var o = "";for var i in s.lowercaseString.characters{o += r[String(i)] != nil ? r[String(i)]!:String(i)};print(o);}

unGolfed
var r = ["a":"obo","e":"unu","i":"ini","o":"api","u":"iki"]
var q={(s:String) in
    var o = ""
    for var i in s.lowercaseString.characters {
        o += r[String(i)] != nil ? r[String(i)]!:String(i)
    }
    print(o)
}

Are the spaces in var r = [ necessary?

Yeah in the playgrounds app if you don't put a space in between an assignment it give you an error and tells you to add spaces. Swift is probably one of the worst languages to golf with but I thought it would be fun to try.

And it was interesting it didn't give me that error when I was assigning a variable to a closure. Hence the shrugging man

yeah I noticed that too. That's why I was confused.

Perl 6,  84  82 bytes
{my%o=<a obo e unu i ini o api u iki>;S:i:g[<{%o.keys}>]=%o{$/.lc}.samecase($/~'a')}

{my%o=<a obo e unu i ini o api u iki>;S:i:g[<[aeiou]>]=%o{$/.lc}.samecase($/~'a')}

Expanded:
# bare block lambda with implicit parameter ｢$_｣
{
  # create the mapping
  my %v = <a obo e unu i ini o api u iki>;

  # replace vowels in ｢$_｣
  S
    :ignorecase
    :global
  [
    <[aeiou]>
  ]

  = # replace them with:

  %v{ $/.lc }
  # change it to be the same case as what was matched, and a lowercase letter
  .samecase( $/ ~ 'a' )
}

Usage:
my &english-to-alien = {my%o=<a obo e unu i ini o api u iki>;S:i:g[<[aeiou]>]=%o{$/.lc}.samecase($/~'a')}

say english-to-alien 'Australia'; # Oboikistroboliniobo

Ruby, 102 93 91 88 78 bytes
gsub(/[#{b='aeiouAEIOU'}]/){'obounuiniapiikiOboUnuIniApiIki'[b.index($&)*3,3]}

Explanation:
Execute the line like ruby -pe "gsub(/[#{b='aeiouAEIOU'}]/){'obounuiniapiikiOboUnuIniApiIki'[b.index($&)*3,3]}", next up type, for example, Australia it should output: Oboikistroboliniobo.
It's pretty straightforward, replace all vowels with a substring based on the index of the to-be replaced vowel in (b), times 3 and the next 3 characters in the translation string.

I suspect the leading and trailing quotation marks (and internal escapes if the input has quotation marks) in the output might disqualify this. Anyway, you can save two bytes by moving the assignment of b into the Regexp (/[#{b=...}/).

I think the space p $* is unnecessary

Use the -p flag to save additional bytes. ruby -pe 'gsub(/[#{b="aeiouAEIOU"}]/){"obounuiniapiikiOboUnuIniApiIki"[b.index($&)*3,3]}'

I count 78 + 2 (-pe).  How do you get 71?

@NotthatCharles do the characters needed for execution really matter in this case? I just didn't count them.

@Biketire See the second bullet in the "Special Invocations" section in this meta answer.  Looks like this is a +1 case.  But how did you get 71 to begin with?  The number of bytes in the answer look like 78 to me.

@NotthatCharles turns out I can't count.. I fixed it :)

@Biketire no worries :)

C - 192 bytes
(newlines added for clarity)
int c,j,b;main(){
char*f[]={"bo","nu","ni","pi","ki",""},
s[]={14,16,0,-14,-12};
while(c=getchar()){for(b=j=0;j<10;++j)
{if(c=="aeiouAEIOU"[j]){c+=s[j%=5];b=1;break;}}
printf("%c%s",c,f[b?j:5]);}}

Just lookup tables and a boolean switch.
Lookup each letter in table (string) of vowels; if found, then modify it according to the rule in table s. Print each character followed by a string: if a vowel was found, print the character modified by the value in s followed by the rest of the syllable stored in table f; if a vowel was not found, print the original character and an empty string.

145 bytes

TI-BASIC, 201 197 195 bytes
Ans+" →Str1:"AEIOUaeiou→Str2:"OUIAIouiai→Str3:"bonunipiki→Str4:1→X:While X<length(Str1:inString(Str2,sub(Str1,X,1→A:5fPart(.2A→B:If A:sub(Str1,1,X-1)+sub(Str3,A,1)+sub(Str4,2B-1,2)+sub(Str1,X+1,length(Str1)-X→Str1:X+1+2(A>0→X:End:sub(Str1,1,length(Str1)-1

To think that I'd find another TI-BASIC answer here!
Anyway, the input is an English string in Ans.
The output is the translated string.
Examples:
"HE
HE
prgmCDGF1A
HUnu
"Hello
Hello
prgmCDGF1A
Hunullapi

Explanation:
(Newlines added for readability.  Multiple lines from the same line will be denoted with a : in the following code block.)
Ans+" →Str1                     ;append a space to the input string and store the result
                                ; in "Str1"
"AEIOUaeiou→Str2                ;store the upper- and lowercase vowels in "Str2"
"OUIAIouiai→Str3                ;store the beginning letter of each corresponding translated
                                ; vowel in "Str3"
"bonunipiki→Str4                ;store the remaining letters of each translated vowel
                                ; in "Str4"
1→X                             ;store 1 in "X"
While X<length(Str1             ;loop until all English letters have been checked
inString(Str2,sub(Str1,X,1→A    ;get the current letter and store its index in "Str2"
                                ; into "A"
5fPart(.2A→B                    ;get which translated vowel end should be used
                                ; B ranges from 1 to 5
If A                            ;if the current letter is a vowel
sub(Str1,1,X-1)                 ;extract the substring of the input before the
                                ; current letter
: +sub(Str3,A,1)                ;append the translated vowel start
: +sub(Str4,2B-1,2)             ;append the translated vowel end
: +sub(Str1,X+1,length(Str1)-X  ;append the remaining substring of the input
: →Str1                         ;store the result of these concatenations into "Str1"
X+1+2(A>0→X                     ;check if A>0 (if the current letter was a vowel)
                                ; if true, increment "X" by three
                                ; if false, increment "X" by one
End
sub(Str1,1,length(Str1)-1       ;remove the trailing space and store the result in "Ans"
                                ;implicit print of "Ans"

Notes:

TI-BASIC is a tokenized language.  Character count does not equal byte count.
Lowercase letters in TI-BASIC are two bytes each.

source: Stack Exchange

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

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

sort: votes


text:
Do the auto-super-logarithm
Given a positive integer n and a number a, the n-th tetration of a is defined as a^(a^(a^(...^a))), where ^ denotes exponentiation (or power) and the expression contains the number a exactly n times.
In other words, tetration is right-associative iterated exponentiation. For n=4 and a=1.6 the tetration is 1.6^(1.6^(1.6^1.6)) ≈ 3.5743.
The inverse function of tetration with respect to n is the super-logarithm. In the previous example, 4 is the super-logarithm of 3.5743 with "super-base" 1.6.
The challenge
Given a positive integer n, find x such that n is the super-logarithm of itself in super-base x. That is, find x such that x^(x^(x^(...^x))) (with x appearing n times) equals n.
Rules
Program or function allowed.
Input and output formats are flexible as usual.
The algorithm should theoretically work for all positive integers. In practice, input may be limited to a maximum value owing to memory, time or data-type restrictions. However, the code must work for inputs up to 100 at least in less than a minute.
The algorithm should theoretically give the result with 0.001 precision. In practice, the output precision may be worse because of accumulated errors in numerical computations. However, the output must be accurate up to 0.001 for the indicated test cases.
Shortest code wins.
Test cases
1    ->  1
3    ->  1.635078
6    ->  1.568644
10   ->  1.508498
25   ->  1.458582
50   ->  1.448504
100  ->  1.445673

Reference implementation
Here's a reference implementation in Matlab / Octave (try it at Ideone).
N = 10; % input
t = .0001:.0001:2; % range of possible values: [.0001 .0002 ... 2]
r = t;
for k = 2:N
    r = t.^r; % repeated exponentiation, element-wise
end
[~, ind] = min(abs(r-N)); % index of entry of r that is closest to N
result = t(ind);
disp(result)

For N = 10 this gives result =  1.5085.
The following code is a check of the output precision, using variable-precision arithmetic:
N = 10;
x = 1.5085; % result to be tested for that N. Add or subtract 1e-3 to see that
            % the obtained y is farther from N
s = num2str(x); % string representation
se = s;
for n = 2:N;
    se = [s '^(' se ')']; % build string that evaluates to iterated exponentiation
end
y = vpa(se, 1000) % evaluate with variable-precision arithmetic

This gives:

For x = 1.5085: y = 10.00173...
For x = 1.5085 + .001: y = 10.9075
For x = 1.5085 - .001 it gives y = 9.23248.

so 1.5085 is a valid solution with .001 precision.

Related. The differences are that the (super-)base of the super-logarithm here is not fixed, and the result is not an integer in general.

It seems like the function converges rather quickly. If our algorithm is simply a curve fit that's within 0.001, does that count as theoretically working for all positive integers?

Hmm, wolframalpha already has trouble with test case 6.. "Standard computation time exceeded..."

@KevinCruijssen I have a reference implementation in Matlab based on binary search which is reasonably fast. I can post it if that's helpful

I’d like to see the reference implementation, or more test cases (all of 1 through 25, and 1000, 10000, …)

@Lynn I've included a reference implementation

Unfortunately, Pyth cannot handle exponentiating numbers as large as the 100th tetration of 1.6... Or even the 6th tetration of 2.  >_>

@StevenH But do you really need that? See my reference implementation. Matlab is limited by double floating point data type. The challenge allows input restrictions due to data types

@LuisMendo Pyth will throw an error that halts execution of the program when it tries to do that tetration, so overflow is not a possibility.  If it wasn't for OverflowError: (34, 'Numerical result out of range'), there'd be a 10-byte solution.

Very related, possibly a duplicate. If you pass in n as both arguments to any of the answers to that challenge, it solves this one. (I ran across that challenge while looking for an algorithm for super-roots, as that's what this boils down to.)

@ETHproductions Does it? Super-root and super-logarithm are different inverses of tetration (one is with respect to the "base", the other with respecto to the "exponent")

I tried it with the Python answer on Ideone, and the answers are identical: http://ideone.com/r72orC

@ETHproductions You are right. That challenge uses both parameters as inputs, so it includes super-root and super-log. The only difference here would be that, since both parameters are equal, perhaps some simplification is possible. Not sure if that's enough to prevent this from being a dupe

The challenge is badly worded.  We're not solving for the super-logarithm, but instead for the base.  x^(x^(x...)))) [n times] = n, solve for x, right?  And we've constrained it so the result is equal to the super-logarithm?

@Xalorous You are right that the wording was bad. I've changed it to "find x such that n is the super-logarithm of itself in super-base x". Anyway the expression hopefully made it clear

Does x converge as n approaches infinity?

@mbomb007 Good question. My initial feeling was that x should converge to 1, but now I'm not sure

@LuisMendo It converges to e^(1/e) ≈ 1.444667861.

Dyalog APL, 33 25 bytes
Needs ⎕IO←0 which is default on many systems.
⌈/⎕(⊢×⊣≥(*/⍴)¨)(1+⍳÷⊢)1E4

Theoretically calculates for all integers, but practically limited to very small one only.
TryAPL online!

Does it work fast enough on the input 100?

@GregMartin Not enough memory.

Haskell, 55 54 52 bytes
s n=[x|x<-[2,1.9999..],n>iterate(x**)1!!floor n]!!0

Usage:
> s 100
1.445600000000061

Thanks to @nimi for 1 byte!

Thanks to @xnor for 2!

[ ]!!0 instead of head[ ] saves a byte

s n=[x|x<-[2,1.9999..],n>iterate(x**)1!!n]!!0 would be shorter if you could get Haskell to accept its types.

@xnor I played around with iterate when I wrote it actually, but somehow it turned out longer at the time

Javascript, ES6: 77 bytes / ES7: 57 53 bytes
ES6
n=>eval("for(x=n,s='x';--x;s=`Math.pow(x,${s})`);for(x=2;eval(s)>n;)x-=.001")

ES7
Using ** as suggested by DanTheMan:
n=>eval("for(x=2;eval('x**'.repeat(n)+1)>n;)x-=.001")

Example

let f =
n=>eval("for(x=n,s='x';--x;s=`Math.pow(x,${s})`);for(x=2;eval(s)>n;)x-=.001")

console.log(f(25));

If you use ES7, you can use ** instead of Math.pow.

J, 39 31 28 bytes
(>./@(]*[>^/@#"0)1+i.%])&1e4

Based on the reference implementation. It is only accurate to three decimal places.
Saved 8 bytes using the method from @Adám's solution.
Usage
Extra commands used to format multiple input/output.
   f =: (>./@(]*[>^/@#"0)1+i.%])&1e4
   (,.f"0) 1 3 6 10 25 50 100
  1      0
  3  1.635
  6 1.5686
 10 1.5084
 25 1.4585
 50 1.4485
100 1.4456
   f 1000
1.4446

Explanation
(>./@(]*[>^/@#"0)1+i.%])&1e4  Input: n
                         1e4  The constant 10000
(                      )      Operate on n (LHS) and 10000 (RHS)
                   i.           The range [0, 10000)
                      ]         Get (RHS) 10000
                     %          Divide each in the range by 10000
                 1+             Add 1 to each
     (          )               Operate on n (LHS) and the range (RHS)
             #"0                  For each in the range, create a list of n copies
          ^/@                     Reduce each list of copies using exponentation
                                  J parses from right-to-left which makes this
                                  equivalent to the tetration
        [                         Get n
         >                        Test if each value is less than n
      ]                           Get the initial range
       *                          Multiply elementwise
 >./@                           Reduce using max and return

Python, 184 bytes
def s(n):
 def j(b,i):
  if i<0.1**12:
   return b
  m = b+i
  try:
   v = reduce(lambda a,b:b**a,[m]*n)
  except:
   v = n+1
  return j(m,i/2) if v<n else j(b,i/2)
 return j(1.0,0.5)

Test output (skipping the actual print statements):
   s(1) 1.0
   s(3) 1.63507847464
   s(6) 1.5686440646
  s(10) 1.50849792026
  s(25) 1.45858186605
  s(50) 1.44850389566
 s(100) 1.44567285047

golfed to 119 bytes

It computes s(1000000) pretty quickly

Mathematica, 40 33 bytes
Thanks to murphy for an almost 20% savings!
1//.x_:>x+.001/;Nest[x^#&,1,#]<#&

Nest[x^#&,1,n] produces the nth tetration of x. So Nest[x^#&,1,#]<# tests whether the (input)th tetration of x is less than (input). We simply start at x=1 and add 0.001 repeatedly until the tetration is too large, then output the last x value (so the answer is guaranteed to be larger than the exact value, but within 0.001).
As I'm slowly learning: //.x_:>y/;z or //.x_/;z:>y means "look for anything that matches the template x, but only things for which the test z returns true; and then operate on x by the rule y; repeatedly until nothing changes". Here the template x_ is just "any number I see", although in other contexts it could be further constrained.
When the input is at least 45, the tetration increases so rapidly that that last step causes an overflow error; but the value of x is still updated and output correctly. Decreasing the step-size from 0.001 to 0.0001 fixes this problem for inputs up to 112, and gives a more precise answer to boot (and still runs quickly, in about a quarter second). But that's one extra byte, so forget that!
Original version:
x=1;(While[Nest[x^#&,1,#]<#,x+=.001];x)&

Golfed it a bit: 1//.x_:>x+.001/;Nest[x^#&,1,#]<#&

@murphy: great! I swear I'll yet get to the point where I can use //. without help :)

Racket 187 bytes
(define(f x n)(define o 1)(for((i n))(set! o(expt x o)))o)
(define(ur y(l 0.1)(u 10))(define t(/(+ l u)2))(define o(f t y))
(cond[(<(abs(- o y)) 0.1)t][(> o y)(ur y l t)][else(ur y t u)]))

Testing:
(ur 1)
(ur 3)
(ur 6)
(ur 10)
(ur 25)
(ur 50)
(ur 100)

Output:
1.028125
1.6275390625
1.5695312499999998
1.5085021972656247
1.4585809230804445
1.4485038772225378
1.4456728475168346

Detailed version:
(define (f x n)
  (define out 1)
  (for((i n))
    (set! out(expt x out)))
  out)

(define (uniroot y (lower 0.1) (upper 10))
  (define trying (/ (+ lower upper) 2))
  (define out (f trying y))
  (cond
    [(<(abs(- out y)) 0.1)
     trying]
    [(> out y)
     (uniroot y lower trying)]
    [else
      (uniroot y trying upper)]))

Perl 6, 42 bytes
{(0,.0001…2).min:{abs $_-[**] $^r xx$_}}

( Translation of example Matlab code )
Test:
#! /usr/bin/env perl6
use v6.c;
use Test;

my &code = {(0,.0001…2).min:{abs $_-[**] $^r xx$_}}

my @tests = (
  1   => 1,
  3   => 1.635078,
  6   => 1.568644,
  10  => 1.508498,
  25  => 1.458582,
  50  => 1.448504,
  100 => 1.445673,
);

plan +@tests + 1;

my $start-time = now;

for @tests -> $_ ( :key($input), :value($expected) ) {
  my $result = code $input;
  is-approx $result, $expected, "$result ≅ $expected", :abs-tol(0.001)
}

my $finish-time = now;
my $total-time = $finish-time - $start-time;
cmp-ok $total-time, &[<], 60, "$total-time.fmt('%.3f') is less than a minute";

1..8
ok 1 - 1 ≅ 1
ok 2 - 1.6351 ≅ 1.635078
ok 3 - 1.5686 ≅ 1.568644
ok 4 - 1.5085 ≅ 1.508498
ok 5 - 1.4586 ≅ 1.458582
ok 6 - 1.4485 ≅ 1.448504
ok 7 - 1.4456 ≅ 1.445673
ok 8 - 53.302 seconds is less than a minute

PHP , 103 Bytes
$z=2;while($z-$a>9**-9){for($r=$s=($a+$z)/2,$i=0;++$i<$n=$argv[1];)$r=$s**$r;$r<$n?$a=$s:$z=$s;}echo$s;

Axiom 587 bytes
l(a,b)==(local i;i:=1;r:=a;repeat(if i>=b then break;r:=a^r;i:=i+1);r);g(q,n)==(local r,y,y1,y2,t,v,e,d,i;n<=0 or n>1000 or q>1000 or q<0 => 0;e:=1/(10**(digits()-3));v:=0.01; d:=0.01;repeat(if l(v,n)>=q then break;v:=v+d;if v>=1 and n>25 then d:=0.001;if v>=1.4 and n>40 then d:=0.0001;if v>=1.44 and n>80 then d:=0.00001;if v>=1.445 and n>85 then d:=0.000001);if l(v-d,n)>q then y1:=0.0 else y1:=v-d;y2:=v;y:=l(v,n);i:=1;if abs(y-q)>e then repeat(t:=(y2-y1)/2.0;v:=y1+t;y:=l(v,n);i:=i+1;if i>100 then break;if t<=e then break;if y<q then y1:=v else y2:=v);if i>100 then output "#i#";v)

less golfed + numbers
l(a,b)==
  local i
  i:=1;r:=a;repeat(if i>=b then break;r:=a^r;i:=i+1)
  r
g(q,n)==
 local r, y, y1,y2,t,v,e,d, i
 n<=0 or n>1000 or q>1000 or q<0 => 0
 e:=1/(10**(digits()-3))
 v:=0.01; d:=0.01
 repeat  --cerco dove vi e' il punto di cambiamento di segno di l(v,n)-q
    if l(v,n)>=q then break
    v:=v+d
    if v>=1     and n>25 then d:=0.001
    if v>=1.4   and n>40 then d:=0.0001
    if v>=1.44  and n>80 then d:=0.00001
    if v>=1.445 and n>85 then d:=0.000001
 if l(v-d,n)>q then y1:=0.0
 else               y1:=v-d
 y2:=v; y:=l(v,n); i:=1  -- applico il metodo della ricerca binaria
 if abs(y-q)>e then      -- con la variabile i di sicurezza
    repeat
       t:=(y2-y1)/2.0; v:=y1+t; y:=l(v,n)
       i:=i+1
       if i>100 then break
       if t<=e  then break
       if  y<q  then y1:=v
       else          y2:=v
 if i>100 then output "#i#"
 v

(3) -> [g(1,1), g(3,3), g(6,6), g(10,10), g(25,25), g(50,50), g(100,100)]
   Compiling function l with type (Float,PositiveInteger) -> Float
   Compiling function g with type (PositiveInteger,PositiveInteger) ->
      Float

   (3)
   [1.0000000000 000000001, 1.6350784746 363752387, 1.5686440646 047324687,
    1.5084979202 595960768, 1.4585818660 492876919, 1.4485038956 661040907,
    1.4456728504 738144738]
                                                             Type: List Float

Common Lisp, 207 bytes
(defun superlog(n)(let((a 1d0)(i 0.5))(loop until(< i 1d-12)do(let((v(or(ignore-errors(reduce #'expt(loop for q below n collect(+ a i)):from-end t))(1+ n))))(when(< v n)(setq a (+ a i)))(setq i(/ i 2)))) a))

Using reduce with :from-end t avoids the need of doing a "reversing exponentiation" intermediate lambda (basically (lambda (x y) (expt y x)), saving 14 bytes (12, if you remove removable spaces).
We still need to handle float overflow, but an ignore-errors form returns nil if an error happened, so we can use or to provide a default value.

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


text:
Output an upside-down tent
Given an integer, output an upside-down tent.
The input determines both the size of the tent (absolute value) and whether the entrance is on the left side (negative numbers) or the right side (positive numbers).
If input = -1:
____
\/_/

If input = -2:
________
\  /   /
 \/___/

If input = -3:
____________
\    /     /
 \  /     /
  \/_____/

If input = 1:
____
\_\/

If input = 2:
________
\   \  /
 \___\/

If input = 3:
____________
\     \    /
 \     \  /
  \_____\/

et cetera

Note that the top of the tent (i.e. the last line) has 2 * abs(input) - 1 underscores.
There can be no leading spaces, such that the first line directly starts with an underscore.
Assume that the input will never be 0.
Your code should be as short as possible.
This challenge is based on a chat mini challenge by Helka Homba, which is allowed to be used in real challenges under the conditions of Calvin's Hobbies Public License.

Are trailing spaces OK? Meaning, can we output four strings of 12 length (a rectangle) for input 3 for example?

@TimmyD They are allowed.

I first misread the title for Upside-Down-Ternet. Which might yield another interesting challenge...

@Nathaniel I'm curious why you haven't close-voted Turtles, given the same reasoning.

@TimmyD sure, that one's probably a dupe of something else too, I'm not really sure where the chain starts. I just think we've seen enough of these by now.

I fail to see how the questions are even remotely similar. Sure, they're both [tag:ascii-art] challenges that take an number and have you output the n-th iteration of something, but that's where the similarity ends. If that's enough to close as dupe, we shouldn't take any more [tag:ascii-art] challenges at all.

@Nathaniel Our accepted guideline for two challenges being duplicates is whether answers from one can be reused (competitively) on the other with little or no modification. Whether challenges bring something novel to the table is not part of that guideline. Please use downvotes for challenges you want to discourage or just ignore them if they don't think they're interesting and let those who do enjoy them.

@MartinEnder I've asked a half-dozen times on meta why my questions were closed and was never once referred to an official guideline, despite explicitly asking for that. Instead I was told each time that I should just take my chances and suffer the consequences if five people happened not to like the idea. I am extremely in favour of having clear guidelines and enforcing close votes to meet them. If you're willing to delete my close votes on the basis of being against a guideline, would you please in future do the same when others VTC on my questions as well? Thanks.

@MartinEnder by the way, I don't want to give the impression that I VTC'd this just to make these points. I did it because I'd been led to believe, based on my previous enquiries, that close-voting is the expected and encouraged action if you (a) don't much care for a challenge type, and (b) have a sort of general feeling that it's a bit duplicatey. I was trying to play along despite not feeling that's a fair way to do things, and I'm genuinely happy to hear that it's not encouraged after all. If this turns out not to be a double standard then I might be able to enjoy contributing after all.

MATL, 55 53 52 51 bytes
|95cy4*Y"DXytPEt0*yvG0>?P_]!'\/ 'w)95JG|G0<yEq:++&(

Try it online!
Explanation
Let N denote the input. The code proceeds in three steps.
First, the first line of  4*N underscores is built as a string and is displayed (which removes it from the stack).
Second, the "frame" of the tent is built using the two types of slashes. To do this, a numerical 2D array is created which contains 1 and 2 corresponding to the two types of slashes, and 0 for space.
This is done concatenating four matrices:

An identity matrix of size abs (N);
A matrix of the same size containing 2 in the antidiagonal;
A null matrix of the same size;
A copy of matrix 2.

Concatenating these four matrices vertically gives, using N=3 as an example, the following 4*N × N matrix:
1 0 0
0 1 0
0 0 1
0 0 2
0 2 0
2 0 0
0 0 0
0 0 0
0 0 0
0 0 2
0 2 0
2 0 0

(which, transposed, begins to look like the tent).
We now take care of the sign of the input. If it is positive we simply transpose the above matrix and index into the string '\/ '. Indexing is 1-based and modular, so 1 becomes '\', 2 becomes '/' and 0 becomes ' ', producing the 2D char array
\    /     /
 \  /     /
  \/     /

On the other hand, if the input is negative we vertically flip and arithmetically negate the 4*N × N matrix, producing
-2  0  0
 0 -2  0
 0  0 -2
 0  0  0
 0  0  0
 0  0  0
-2  0  0
 0 -2  0
 0  0 -2
 0  0 -1
 0 -1  0
-1  0  0

Index -1 now refers to '/' and -2 to '\'. That is, the two types of slashes have been interchanged, as required. Again transposing and indexing into the string '\/ ' thus gives the reversed tent:
\     \    /
 \     \  /
  \     \/

Third, underscores need to be filled into part of the last row of the 2D char array. The horizontal position of this line depends on the sign of the input, and its lenght is abs(N).
Once the corresponding spaces have been replaced by underscores, the result is implicitly displayed, below the initial line of underscores that was already displayed in the first step.

Shouldn't those underscores at the beginning be spaces?

@DJMcMayhem Sorry, what do you mean?

When I run your code the first line is all underscores. The output zyabin gave doesn't have that.

@DJMcMayhem I don't follow. The first line in the test cases is underscores, isn't it? And other answers (not yours) do that too?

Woah. That's so weird. When I look at the source HTML for the challenge I can see the underscores, but they are not rendering on the challenge itself.

@DJMcMayhem :-D Weird indeed. Try a different browser?

Javascript (ES6), 139 bytes
Builds the tent recursively:
f=(N,n=N>0?N:-N,i=0,r=(j,i)=>' _'[i||0].repeat(j),a=`\\${r(i)}/`,b=r(n*2+i-1,+!i))=>n--?f(N,n,i+2)+`
`+r(n)+(N<0?a+b+'/':'\\'+b+a):r(i*2,1)

Ungolfed and commented
f = (
  N,                                  // N is the original parameter (remains unchanged)
  n = N > 0 ? N : -N,                 // n is initialized to abs(N)
  i = 0,                              // i is the row counter (*2)
  r = (j, i) => ' _'[i||0].repeat(j), // helper function to repeat ' ' or '_' j times
  a = `\\${r(i)}/`,                   // a = '\ /' pattern
  b = r(n*2+i-1, +!i)                 // b = padding pattern filled with ' ' or '_'
) =>
  n-- ?                               // if we haven't made it yet to the top row:
    f(N, n, i+2) + `\n` +             //   - compute next row(s) / append line break
    r(n) +                            //   - append leading spaces
    (N < 0 ? a+b+'/' : '\\'+b+a)      //   - append a/b patterns according to N sign
  :                                   // else:
    r(i*2, 1)                         //   - return top row, made of '_' characters

Examples

var f=(N,n=N>0?N:-N,i=0,r=(j,i)=>' _'[i||0].repeat(j),a=`\\${r(i)}/`,b=r(n*2+i-1,+!i))=>n--?f(N,n,i+2)+`
`+r(n)+(N<0?a+b+'/':'\\'+b+a):r(i*2,1)

console.log(f(3));
console.log(f(-4));

Python 2, 143 141 139 138 137 bytes
-2 bytes thanks to @Sp3000 (no need to parenthesise exec in Python 2)
-1 byte thanks to @Sp3000 (use cmp)
def f(n):d=cmp(n,0);a,b='\/'[::-d];s=n*d;x=2*s-1;y=4*s;print'_'*y;i=0;exec"print' '*i+(b+' '*(y-3-x-i-i)+a+'_ '[s-i>1]*x+a)[::d];i+=1;"*s

Test it at ideone
First we see if n is negative and make d +1 if it is and -1 if not.
Then we select the two slashes, a and b, using d such that a='\', b='/' when n is positive and a='/', b='\' when n is negative.
Next we set s=abs(n) which may be achieved by s=n*d.
Then we calculate the number of _ at the top (bottom of the picture), which is also the number of  in the side of the tent as x=2*s-1.
Then we calculate the number of _ at the base of the tent (top of the picture), and store it as y=4*s since it will be used in the loop to create the rest of the tent.
Now we print the base of the tent using print'_'*y.
Then we print the rest of the tent by executing s print statements with a looping variable i initialised to 0 which increments by 1 for each print statement.
The rest of the tent then has y-3-x-i-i spaces in the door and x spaces in the body until the top is reached, when s-i>1 evaluates to False, picking the _ from '_ '.
For a positive, left-door, tent the whole of the tent, excluding the leading spaces is back-to-front, so it is reversed while the positive, 'right-door', tent is not with [::d].

@Sp3000 unfortunately cmp(0,0) returns 0

C#, 215 214 bytes
string t(int N){var n=N<0;N=n?-N:N;var t=new string('_',4*N);for(int i=0;i<N;){string f=new string(i<N-1?' ':'_',2*N-1),p=new string(' ',2*N-2*i-2);t+='\n'+new string(' ',i++)+'\\'+(n?p+'/'+f:f+'\\'+p)+'/';}return t;}

There's a possibility to save a few bytes when using using s=string; beforehand.
s t(int N){var n=N<0;N=n?-N:N;var t=new s('_',4*N);for(int i=0;i<N;){s f=new s(i<N-1?' ':'_',2*N-1),p=new s(' ',2*N-2*i-2);t+='\n'+new s(' ',i++)+'\\'+(n?p+'/'+f:f+'\\'+p)+'/';}return t;}

which would be 15 (using) + 184 (method) = 199 bytes.

Welcome to PPCG, BackFromExile!

Indeed, welcome to PPCG! A very nice first answer +1. I tried to find anything to golf (quite a while since I programmed in C#), and in the end was only able to find one thing for -1 byte: If you change the first var inside the for-loop to string, you can remove the second var  (including space to save the byte). So var f becomes string f, and ;var p= becomes ,p=.

Python 2, 121 bytes
def f(n):i=k=abs(n);print'_'*k*4;exec"print' '*(k-i)+r'\\\%%s%\*%c%%*sc/'[n<0::2]%(' _'[i<2]*(2*k-1))%(2*i-1,47);i-=1;"*k

Just a lot of string formatting.

PowerShell v2+, 217 205 190 187 184 bytes
param($b)"_"*(($a=[math]::Abs($b))*4);$z,$y='/\'[($b=$b-lt0),!$b]
((($x=1..$a|%{($w=" "*($_-1))+$z+" "*(2*($a-$_))+$y+(' ','_')[$_-eq$a]*($a*2-1)+$y+$w})|%{-join$_[($a*4)..0]}),$x)[$b]

Takes input $b as an integer. Note that if $b is negative, you need to explicitly surround it with parens to cast it appropriately (see examples), else PowerShell will think it's a string.
Regardless of which direction the tent is facing, the first line is the same, a bunch of underscores; exactly 4*abs(input) many of them, actually. That number is also stored into $a for use later. Additionally, now that we have the absolute value of $b stored into $a, we turn $b into a Boolean for its sign, and choose our slashes stored into $y and $z.
The next line is constructing and formulating the output, and it's a doozy, so let's break it down.
We're essentially indexing into an array of two elements, (big long calculations saved into $x) or $x, based on $b.
The calculations are where the tent body is constructed. We loop from 1..$a|%{...}. Each iteration we're constructing a line of the tent body. We start with a number of spaces equal to the line # we're on -1, so that it's appropriately left-aligned. That's stored into $w for later, and concatenated with the appropriate slash ($z, based on $b), then the doorframe number of spaces, then the other slash $y, then either underscores or spaces depending upon if we're on the bottom line or not, then another slash $y, and finally the appropriate number of trailing spaces ($w) to construct a rectangular string. That resulting array of strings is stored into $x.
If the left half of the array is selected (i.e., $b is False since the input was positive), then we need to loop through $x and reverse each line item -- this is where the trailing spaces come into play; it allows us to simply reverse the lines rather than re-calculate distances.
If $b is True, then the right half of the array $x is selected instead.
In either case, the pipeline now contains an array of strings. Implicit output via Write-Output happens at program completion, with default newline between elements.
Examples
PS C:\Tools\Scripts\golfing> .\print-upside-down-tent.ps1 (-5)
____________________
\        /         /
 \      /         /
  \    /         /
   \  /         /
    \/_________/

PS C:\Tools\Scripts\golfing> .\print-upside-down-tent.ps1 (4)
________________
\       \      /
 \       \    /
  \       \  /
   \_______\/

TSQL, 195 bytes
Golfed:
DECLARE @ INT=-2
DECLARE @b INT=ABS(@),@i INT=0PRINT REPLICATE('_',4*@b)z:SET @i+=1PRINT SPACE(@i-1)+'\'+STUFF(REPLICATE(IIF(@i<@b,' ','_'),4*@b-2*@i),@b*2-IIF(@<0,@i*2-1,0),1,IIF(@<0,'/','\'))+'/'IF @i<@b GOTO z

Ungolfed:
DECLARE @ INT=-2

DECLARE @b INT=ABS(@),@i INT=0

PRINT REPLICATE('_',4*@b)
z:
  SET @i+=1
  PRINT
    SPACE(@i-1)+'\'
    +STUFF(REPLICATE(IIF(@i<@b,' ','_'),
      4*@b-2*@i),@b*2-IIF(@<0,@i*2-1,0),1,IIF(@<0,'/','\'))
    +'/'
IF @i<@b GOTO z

Fiddle

V, 66 bytes
é /ä
"aDoÀñá_>ñ^hr\A\/ò^hÄX$2é_Ó_/ òÄÒ_ñ/-
ddÍÜ¨[ _]*©Ü¨ *©/Ü²¯±

Try it online!
This is a pretty naive approach, so I'll try to golf it down further later today. This solution contains unprintable characters, so here is a hexdump:
0000000: e920 2fe4 0a22 6144 6f1b c0f1 e15f 3ef1  . /.."aDo...._>.
0000010: 5e68 725c 415c 2f1b f25e 68c4 5824 32e9  ^hr\A\/..^h.X$2.
0000020: 5fd3 5f2f 20f2 c4d2 5ff1 2f2d 0a64 64cd  _._/ ..._./-.dd.
0000030: dca8 5b20 5f5d 2aa9 dca8 202a a92f dcb2  ..[ _]*... *./..
0000040: afb1                                     ..

05AB1E, 52 bytes
Ä©'_4®*×,FNð×'\®·<N>®Qi'_ëð}×®N>-·ð×®¹Qi'\ës'/}s'/J,

Explanation
                                                     # implicit input, call this A
Ä©                                                   # store abs(A) in register for later use
  '_4®*×,                                            # print 4*A underscores (tent floor)
         F                                           # for each non-floor section in range(N)
          Nð×'\                                      # push N spaces at the beginning of the
                                                     # row followed by a backslash
                  N>®Qi'_ëð}                         # if we're on the last row push an
                                                     # underscore, else a space
               ®·<          ×                        # repeat that char abs(A)*2-1 times
                             ®N>-·ð×                 # push 2*(abs(A)-(N+1)) spaces
                                    ®¹Qi'\ës'/}      # if input is positive push backslash
                                                     # else push a slash
                                               s'/   # move that char between the 2 sections
                                                     # of spaces
                                                  J, # join the row and print

Try it online!

Haskell, 187 184 183 bytes
f x=unlines$[(n*4)%'_']++((' '#)<$>[0..n-2])++['_'#(n-1)]where m#i=i%' '++'\\':m!i++"/";m!i|x>0=(2*n-1)%m++'\\':(2*(n-i-1))%' '|q<-2*(n-i-1)=q%' '++'/':(2*n-1)%m;n=abs x;m%c=c<$[1..m]

I feel like this is not a great score for Haskell, so any ideas for improvement are welcome.

3 bytes saved thanks to @Myridium
1 byte saved thanks to @nimi

Ungolfed
tent :: Int -> String
tent x = unlines $ [replicate (n*4) '_'] ++ (row ' '<$>[0..n-2]) ++ [row '_' (n-1)]
    where row m i = replicate i ' ' ++ "\\" ++ dir m i ++ "/"
          -- direction selector
          dir m i | x > 0 = side m ++ "\\" ++ entrance i ' '
                  | 1 > 0 = entrance i ' ' ++ "/" ++ side m
          side = replicate (2*n-1)
          entrance i = replicate (2*(n-i-1))
          n = abs x

Better than my 290 bytes I was about to post...

Should you not add a main so that it accepts stdin as the input?

You can post a single function unless the question specifies otherwise. There's a meta thread for the general rules on answering, I'll try to find it for you.

I was just looking for such threads, and looking through the Documentation Center but couldn't find the rules for this SE.

Here are some useful ones:
Full program / function;
Forbidden loopholes;
Default I/O

You can save 2 bytes by changing where you prepend a single character to use the : character. i.e. change "\\" ++ entrance... to '\\':entrance.

Don't waste the "otherwise" guard: you can change |1>0=(2*(n-i-1))%' ' to |q<-2*(n-i-1)=q%' '.

You still have ' '++'\\' and ' '++'/' that you can change to ' ':'\\' and ' ':'/' respectively. You can prepend as many elements as you like in Haskell to the start of a list, i.e. a:b:c:[d] == [a,b,c,d].

Actually, " /"++ is shorter than ' ':'/':, and likewise " \\"++ is shorter than ' ':'\\':. To avoid confusion, here's my full suggestion:
f x=unlines$[(n*4)%'_']++((' '#)<$>[0..n-2])++['_'#(n-1)]where m#i=i%" \\"++m!i++"/";m!i|x>0=(2*n-1)%m++'\\':(2*(n-i-1))%' '|q<-2*(n-i-1)=q%" /"++(2*n-1)%m;n=abs x;m%c=c<$[1..m]

I can't really use this trick, because the left side characters are actually part of a function application. Note the % operator, shortcut of replicate, defined at the end of the golfed code.

C, 240 207 193 Bytes
#define P putchar
a,j,l,m;g(x,y,z){for(m=y+z+1;m--;P(m^z?l?32:95:x));}f(n){g(32,(a=abs(n))*4,0);for(P(10),j=2*(l=a)-1;l--;){for(m=a;--m>l;P(32));P(92);m=n>0?g(92,j,l*2):g(47,l*2,j);puts("/");}}

This time I optimized the function g(...) to use a single for loop.
#define P putchar
a,j,l,m;g(x,y,z){for(;y--;P(l?32:95));for(P(x);z--;P(l?32:95));}f(n){g(32,(a=abs(n))*4,0);l=a;j=2*a-1;P(10);for(;l--;){for(m=a;--m>l;P(32));P(92);m=n>0?g(92,j,l*2):g(47,l*2,j);puts("/");}}

This time macro X is better off as a function g(...) and since y and z are parameters in a new scope I can just decrement them in the scope of g.
#define P putchar
#define X(x,y,z){for(k=0;k++<y;P(l?32:95));P(x);for(k=0;k++<z;P(l?32:95));}
a,i,j,k,l,m;f(n){for(l=a=abs(n);i++<a*4;P(95));j=2*a-1;P(10);while(l--){for(m=a;--m>l;P(32));P(92);if(n>0)X(92,j,l*2)else X(47,l*2,j)puts("/");}}

Test with this main function;  This should golf down much smaller.
main(c,v)char**v;
{
    f(atoi(v[1]));
}

C# 241 231 Bytes
Saved 10 bytes thanks to @Kevin Cruijssen
using s=System.String;s f(int N){var f=N<0;N=N>0?N:-N;var o=new s('_',N*4);for(int j=0,z;j<N;){z=-2*j+2*N-2;var O=j>N-2?'_':' ';o+='\n'+new s(' ',j)+'\\'+new s(' ',z)+(f?'/':O)+new s(O,j++*2)+(f?O:'\\')+new s(' ',z)+'/';}return o;}

Old version:
string f(int N){var f=N<0;N=N>0?N:-N;var o=new string('_',N*4);for(int j=0;j<N;){int z=-2*j+2*N-2;var O=j>N-2?'_':' ';o+='\n'+new string(' ',j)+'\\'+new string(' ',z)+(f?'/':O)+new string(O,j++*2)+(f?O:'\\')+new string(' ',z)+'/';}return o;}

Originally had the new string(...) as a Func<char,int,string> but saved one byte using the constructor. I wish int->char was implicit
Pretty sure my math can be fixed somehow too, but I can't see it

You can golf it some more. First of all you can remove the int  before z= by adding it to the for-loop: int j=0,z. And since you use string quite a lot, you can alias it with using s=System.String; So the total becomes: using s=System.String;s f(int N){var f=N<0;N=N>0?N:-N;var o=new s('_',N*4);for(int j=0,z;j<N;){z=-2*j+2*N-2;var O=j>N-2?'_':' ';o+='\n'+new s(' ',j)+'\\'+new s(' ',z)+(f?'/':O)+new s(O,j++*2)+(f?O:'\\')+new s(' ',z)+'/';}return o;} (231 bytes)

Batch, 289 bytes
@echo off
set/pn=
set u=
for /l %%i in (2,1,%n:-=%)do call set u=_%%u%%_
echo _%u%__%u%_
set l=
set m=%u%/_%u%
if %n% gtr 0 set m=%u%_\%u%
set m=%m:_= %
for /l %%i in (2,1,%n:-=%)do call:l
set m=%m: =_%
:l
echo %l%\%m%/
set l= %l%
if %n% gtr 0 set m=  %m:~0,-2%
set m=%m:~2%

Takes input on STDIN. Starts by creating a string of 2*(abs(n)-1) underscores. This is then repeated plus an additional 4 underscores for the base of the tent. The rest of the tent then consists of an indent (which increases by 1 on each line), a \, the middle of the tent, and a /. The middle of the tent starts as 2*(abs(n)-1) spaces, plus either \ or / plus a space (which I can't represent in Markdown), plus another 2*(abs(n)-1) spaces. I reuse the underscore string and change them to spaces for convenience, but then change the spaces back to underscores for the last line. Each line removes two spaces from one side of the middle of the tent, although it's slightly golfier to move the two spaces to the start of the string first if necessary.

Swift 2.2 421 bytes
Well... This was an attempt.
Golfed:
let t={(s:String,n:Int)->String in return String(count:n,repeatedValue:Character(s))};let e={(n:Int)in var w=[String]();w.append(t("_",abs(n)*4));let c = abs(n);let d = n>0 ? "/": "\\";let f = n>0 ? "\\": "/";for var i in 0...abs(n)-1 {w.append(t(" ",i)+d+t(" ",c*2-2-(2*i))+f+(i<c-1 ?t(" ",2*c-1)+f:t("_",2*c-1)+f)+(n>0 ?t(" ",i):""));};w=n<0 ?w:w.map(){String($0.characters.reverse())};print(w.joinWithSeparator("\n"))}

UnGolfed:
let t={(s:String,n:Int) -> String in
    return String(count:n,repeatedValue:Character(s))
};
let e={(n:Int) in
    var w=[String]();
    w.append(t("_",abs(n)*4));
    let c = abs(n);
    let d = n>0 ? "/": "\\";
    let f = n>0 ? "\\": "/";
    for var i in 0...abs(n)-1 {
        w.append(t(" ",i)+d+t(" ",c*2-2-(2*i))+f+(i<c-1 ?t(" ",2*c-1)+f:t("_",2*c-1)+f)+(n>0 ?t(" ",i):""));
    };
    w=n<0 ?w:w.map(){String($0.characters.reverse())};
    print(w.joinWithSeparator("\n"))
}

PHP, 143 bytes
$t=str_repeat;echo$t(_,4*$s=$k=abs($n=$argv[1]));for(;$k--;$p.=" "){$f=$t("  ",$k);$r=$t($k?" ":_,2*$s-1);echo"
$p\\",$n<0?"$f/$r/":"$r\\$f/";}

run with php -r '<code>' <parameter>
breakdown
$t=str_repeat;  // function name to variable saves 10-1 bytes
echo$t(_,4*$s=$k=abs($n=$argv[1])); // print bottom
for(
    ;
    $k--;   // $k from abs($n-1) to 0
    $p.=" "                 // create padding
)
{
    $f=$t("  ",$k);         // create front
    $r=$t($k?" ":_,2*$s-1); // create side/roof
    echo"\n$p\\",$n<0
        ?"$f/$r/"   // print, entrance left
        :"$r\\$f/"  // print, entrance right
    ;
}

Canvas, 25 bytes
⤢＼║ｌ╵：╷：«_×╋ｌ／＋Ｌ_×；∔⁸０＞？↔

Try it here!


text:
Let's get Animated!
The Challenge
GIFs are the most common image format for animation, and are used pretty heavily in today's social media. For the purpose of this challenge, I'm going to redefine what a GIF can be. This challenge will require you to take in a 3D array containing some sort of representation of a 2D 'image' and iterate through them, displaying an animation. This animation can be done anywhere, in a GIF, in your console, in a GUI, etc; the delivery doesn't matter, so long as it is animated.
The Input

A 3D array where the data inside somehow represents a 2D image.

The array may contain RGB data, true/false data or anything else you see fit.
I'm also fine with you dumbing it down to a 2D array of strings or something similar, but the animation must be a 2D animation.

The time between each frame in a format of your choosing (Seconds, Milliseconds, etc...).

People have been asking me whether or not they HAVE to include the duration length. My answer is "meh", as long as you are able to show animation. I'm more concerned that you adhere to the "Array" parameter than this one, meaning no random animations.

The Output

A seamlessly iterated sequence of output that looks like a 2D animation with the correct delay on each transition based on the value input.

The Rules

Output can be, but is not limited to:

GIF image.
GUI animation (my example).
In-console animation.
Honestly, any "animation" that you see fit, as long as it follows the below rules.

When outputting your image you must clear the console before showing the next frame, you cannot just print them sequentially.

Emulating a console "clear" is also acceptable, as long as it looks like a seamless animation (see the hint under my example for more information on what I mean).

Regardless of implementation, your animation should loop forever, or until stopped.

The "looping" can be as simple as while(true){} or infinite recursion, you may assume the user wants to view this masterpiece until they hit "ctrl+c".

You must be able to handle any size 2D 'images', if your language is limited by buffer sizes, this is acceptable and you may state this in your explanation.
Standard loopholes are disallowed.

Example I/O
Input (3D Array, Delay)
f([
  [[1,0,0],
   [0,0,0],
   [0,0,0]],
  [[0,0,0],
   [0,1,0],
   [0,0,0]],
  [[0,0,0],
   [0,0,0],
   [0,0,1]],
], 1)

Output (Example, 2020 Bytes - Java)
import javax.swing.JFrame;
import javax.swing.JTextArea;

/**
 * Simple GIF class to animate a 3D integer array in a swing text area.
 * (Clearing the console in java isn't something you really do, so I chose
 * java on purpose to make it an extremely ungolf-able answer that someone
 * wouldn't bother to steal).
 */
public class Gif implements Runnable {
    /**
     * The output area.
     */
    private final JTextArea area;

    /**
     * The list of images.
     */
    private final int[][][] images;

    /**
     * The delay between image transitions.
     */
    private final long transitionDelay;

    /**
     * Main method, instantiates a GIF object and runs it.
     * @param args Does absolutely nothing.
     */
    public static void main(String[] args) {
        final int[][][] images = {{{1,0,0},{0,0,0},{0,0,0}},{{0,0,0},{0,1,0},{0,0,0}},{{0,0,0},{0,0,0},{0,0,1}}};
        final long transitionDelay = 1000L;
        new Thread(new Gif(images, transitionDelay)).start();
    }

    /**
     * Constructor for a GIF, takes in a 3D array of images and a transition
     * delay to wait between transitioning the images.
     * @param images The list of images.
     * @param delay The delay between each image.
     */
    public Gif(int[][][] images, long transitionDelay) {
        this.images = images;
        this.transitionDelay = transitionDelay;
        this.area = new JTextArea();
        final JFrame frame = new JFrame("It's a GIF!");
        frame.setSize(10,100);
        frame.add(area);
        frame.setVisible(true);
    }

    /**
     * When run, it will alter the area to imitate an animated GIF.
     */
    @Override
    public void run() {
        while (true) {
            for (int i = 0; i < images.length; i++) {
                final StringBuffer frame = new StringBuffer();
                for (int j = 0; j < images[i].length; j++) {
                    for (int k = 0; k < images[i][j].length; k++) {
                        frame.append("" + images[i][j][k]);
                    }
                    frame.append("\n");
                }
                this.area.setText(frame.toString());
                try{Thread.sleep(transitionDelay);}catch(Exception e){}
                this.area.setText("");
            }
        }
    }
}

This results in a swing GUI popping up, animating the array:

HINT HINT: Use a language where console clearing is possible, or specify why what you are doing will end up with a result that looks like an animation in the language you chose. I think some languages have default buffer sizes on their consoles, you may use this to your advantage, but I expect an explanation or example. Just because I output my animation as a string, you don't have to; I could've just as easily used 0 for black and 1 for white and made a real GIF.
Judging
This is code-golf, lowest byte count wins (inputs excluded).
I'll +1 anyone who uses a language in a cool or unexpected way as well.

How many lines long does the "clear" have to be? Can it be the same as the number of characters per line?

Similar challenge with more strict input: http://codegolf.stackexchange.com/questions/27101/steampunk-clacker-animation

@Riley I'm not sure I get what you're asking. The clear is essentially to keep the output on the same line; your code may not actually "clear" anything, but replace in line as well. I don't care how you accomplish the animation, more that it essentially functions using frames.

@luserdroog I hadn't seen that one, but I also saw one on "create a snowscene" as well, but I don't see either as close enough to warrant not posting this.

@Monomeeth post a comment so I can +1 you for grammar-editing me.

My thought was that if you print enough blank lines it "pushes" the previous text past the top of the screen and you don't see it anymore. I have a solution in sed, but I don't think there's a way to clear previous lines. I also can't pause between frames which might be a deal breaker anyway.

@Riley Hm... If you want to declare an operating system or state which shell you used to execute, I think I could live with you printing enough newlines to reset the buffer of the specific shell you picked. Also, if you can't pause between frames, I think there may be something else you can do to control the animation flow; be creative (Hint: STDIN would make it a flipbook). I'm interested to see this implementation in SED to be completely honest.

@carusocomputing No worries, more than happy to do the grammar check. By the way, in terms of what language is used for the animation, does it matter if it's one no longer in popular use?

@Monomeeth It's code-golf, it can be any language you want man.

MATL, 16 12 11 bytes
`G@)D1Y.XxT

Input is a cell array of 2D. For example:
{[1 0 0; 0 0 0; 0 0 0] [0 0 0; 0 1 0; 0 0 0] [0 0 0; 0 0 0; 0 0 1]}

The pause time is the 1 in the code. It can be changed to any real number, such as .5 or `.2 .
Try it at MATL Online! (If it doesn't work, refresh the page and press "Run" again.)
The input can also be a cell array of 2D char arrays. For example:
{['x...';'+...';'....';'....'] ['+x..';'....';'....';'....'] ['.+x.';'....';'....';'....'] ['..+x';'....';'....';'....'] ['...+';'...x';'....';'....'] ['....';'...+';'...x';'....'] ['....';'....';'...+';'...x'] ['....';'....';'....';'..x+'] ['....';'....';'....';'.x+.'] ['....';'....';'....';'x+..'] ['....';'....';'x...';'+...'] ['....';'x...';'+...';'....']}

Try this one too!
Explanation
`       % Do...while
  G     %   Push input: cell array
  @     %   Push iteration index
  )     %   Index to obtain that cell. This uses modular indexing,
        %   so each cell is addressed cyclically
  D     %   Display
  1     %   Push 1: number of seconds to pause
  Y.    %   Pause for that many seconds
  Xx    %   Clear screen
  T     %   True. This is used as loop condition: infinite loop
        % End. Implicitly end do...while loop

Can you save a few bytes using my trick? Filling the matrix with [0.2 0 0.2;0 0.2 0] ... , and thus reduce xx to x, and avoid 1G and 2G? I believe it adheres to the rules. You need to add a few bytes in order to convert 0.2 to 1, unless you want 0.2 to jump around of course, and some way to store the pausing value. I still think it could reduce the byte count though :)

@Weeingitfirst Thanks! Well, the challenge specifies two inputs: the array and the pause, so I think both are needed. Let's wait for confirmation anyway

Wow. You followed the brief perfectly, even adhering to the inputs. This is a very impressive answer. Definitely will be hard to beat, and compared to answers that didn't include pause duration, this is basically flawless, bravo.

Also, if you wish to remove the pause as an input to save bytes, I have updated the brief, but I did enjoy being able to alter the duration in your link heh.

@carusocomputing Great! Thanks for letting me know. 4 bytes off! The duration can still be changed, it's pretty obvious in the code

@LuisMendo I gotta admit, I've been back to this thread 5 times now specifically to play around with this snippet.

@carusocomputing Haha. I know what you mean. Pause time of the order of .01 is particularñy fun!

I'm going to be honest, I doubt this is going to be beat, so until further submissions I'm marking this as best answer.

sed 141 134 90
-51 thanks to seshoumara
/^$/!{H;d}
:;/^$/g;s,^\n,,;s,$, ,;s,^,\d27[2J,p
:p;P;s,[^\n]*\n,,;/^ \n/!bp;N;s,[ \n]*,,;b

Input: First takes each frame separated by a line with a single space then display the next frame after each blank line is received (looks like a flipbook). Minimum 3 frames.
By default on my system (Windows 7) when I open cygwin it have 24 lines vertically. Between frames, there are always at least that many blank lines printed. This effectively clears the screen.
Over 1/3 of the bytes come from clearing the console. I'm sure there's a better way.

You can reduce 1 byte by having the first p command as part of s///p, plus 6 bytes more by removing /^\n/! before P, which I think is not needed. For the effort, +1, though I'm also sure there's a better way.

After some time browsing the internet, I found a simple way to manipulate the terminal's cursor, thus also clearing a screen: using ANSI Escape Sequences. The mechanism is also used to print text in colors. Please see my answer for details and an example usage. I don't know if they work on cygwin, but you can try.

@seshoumara It works in cygwin when it comes from sed, but for some reason it doesn't work with cat or echo.

Try echo -e "\e[2Jtest". With cat the escape character must already be in the file/input, try echo -e "\e[2Jtest"|cat -n and scroll up.

@seshoumara I knew it had to be something like that. thanks!

+1 for the initial SED answer, that's pretty cool, and awesome how such a unique answer garnered the attention of someone with a similar skillset! I would've never guessed you could do color animations in sed.

Octave, 56 54 47 bytes
Removed the possibility to input the pausing time as part of the input matrix. I was very satisfied with it, so have a look in the edit history if you want to have a look. This solution is 7 bytes shorter.
n=input('');while(any(n=~n))spy(n);pause(1);end

n=input('');  % Takes input as a matrix of zeros and ones

k=n(1);       % maximum of the input matrix is the desired pause time. Have to store
              % this, because n is soon to be messed with
              % NOTE: k=n(1); is not needed anymore, since the pause time can be hardcoded!

any(n=~n)     % Check if there are any truthy values in `n` (there is), and at the
              % same time negate it, thus creating a matrix where all elements
              % alternates between 1 and 0.
while(any(n=~n))   % Loop as long as there are any non-zero elements (always some)
spy(n)        % Create a spy-plot where all non-zero elements are shown as a dot
pause(1)      % Pauses for k seconds
end           % ends the loop (will never happen, since it's infinite).

The input will be something like this: [4 0 0 4;0 4 4 0;4 0 0 0], where this will be a matrix of dimensions 3x4, and the desired pause time is 4 seconds.
It displays a plot like the one below, but alternates between showing the true and the false values of the input. So all the blue dots will become white in the next iteration, and all the white will become blue.
In the below plot, I used the input rand(10,10)>0.6*2. This means it will have dimensions 10x10, and all elements of the random matrix that are larger than 0.6 will be true. After that I multiply it by the desired pausing time, 2 seconds. I used a random matrix here, but I could have created the matrix manually too.
I don't have Octave installed on this computer, so I made a minor alteration to make this work in MATLAB. It's the exact same principle, but n=~n doesn't work in MATLAB.

@carusocomputing, do I have to take the pausing time as input, or can I choose it myself? For instance always have 1 seconds?

@carusocomputing, also: Is it OK to let the user choose the pause time, but don't have it as a separate parameter? In my not so humble opinion, this qualifies as: "a cool or unexpected way" ;-)

Yeah, I agree completely, this qualifies; as long as you are allowing the user to specify some parameter of input, and it is not entirely randomized, I think it's fine. The whole point of the pausing was to be able to see the animation. I didn't want any for loops where people state, "well, you can't see it, but it's definitely animating."

Also, I liked both of your ideas; the "TV Static Generator" was a very unique implementation, using randomization, which I didn't even consider. This is also impressive in that you managed to take the first iteration and adhere closer to the brief. Great job man.

GNU sed, 88 84 + 1(n flag) = 85 bytes
Edit: 3 bytes less thanks to Riley
H;1h;${:
g;s:\n.*::;H;x;s:[^\n]*\n::;x;y:,:\n:;s:^:ESC[2J:;s:ESC:\d27:gp;esleep 1
b}

The input format is one animation frame per line. For multiple output lines in a frame, use comma as separator. Because I run the program in a Linux console, the maximum image size available (measured in rows and columns) is dependent on the size of the terminal window. The pause between two frames is accomplished by the sleep shell command; to get a faster animation call esleep 0.4 (seconds).
100,000,000            # The timer could be read from the input as well, but that
000,010,000            #would require a lot more bytes and I understand I'm allowed
000,000,001            #to hardcode the value.

The best part is that I support color animation! To do this, I used the so called ANSI Escape Sequences to control the text font, foreground and background color, plus the position of the cursor, thus being able to clear the screen before each frame (code ESC[2J). To add color information, use the following format in the input, which is better explained here.
ESC[$FORMATm$textESC[0m     # 'ESC' is an actual string, it is then replaced
                            #in sed by the character with the ASCII value 27

Run:
sed -nf animate.sed input.txt

Examples: for each test, 2 animation cycles were screen-captured and saved in image GIF format (apologies for the low resolution)
0.4 seconds pause
1 second by default
Explanation:
H;1h                           # read each line/frame and store them in hold space
${:                            # when the input was read, start a loop
   g                           # copy hold space to pattern space
   s:\n.*::                    # remove all except the first/current frame
   H                           # append frame to hold space
   x;s:[^\n]*\n::;x            # delete first frame from hold space
   y:,:\n:                     # replace all commas with a newline
   s:^:ESC[2J:;s:ESC:\d27:gp   # use an ANSI Escape Sequence to clear the screen
                               #and print frame in color
   esleep 1                    # wait 1 second
b}                             # repeat

You could save a few bytes by replacing 1h;1d;H; with H;1h;

@Riley Thanks, I updated the code.

Wow, this was more in depth than a lot of the others, I like the color support and it's the only answer that does that :). Pretty unique use of newlines as well. +1 for color support and the uniqueness of the answer itself. I honestly wouldn't've believed it if I hadn't seen it myself!

SmallBasic, 167 bytes
As a parameter, define and set the global var i!
Sadly, SmallBasic does not support parameters for own Sub-routines.
sub animate
for j=0 to Array.getItemCount(i)
for k=0 to Array.getItemCount(i[0])
TextWindow.writeLine(i[j][k])
endfor
Program.delay(9)
TextWindow.clear()
endfor
endsub

Ruby, 89 45 bytes
f=->h,t{h.cycle{|x|puts"^[[2J",x.map(&:join)}}

The ^[ is an escape character.
Hexdump:
00000000: 663d 2d3e 682c 747b 682e 6379 636c 657b  f=->h,t{h.cycle{
00000010: 7c78 7c70 7574 7322 1b5b 324a 222c 782e  |x|puts".[2J",x.
00000020: 6d61 7028 263a 6a6f 696e 297d 7d         map(&:join)}}

Saved a lot of bytes thanks to @Jordan

@DLosc Ah, yes, fixing

You can save a lot of bytes here. ->h,t{h.cycle{|x|puts"^[[2J",x.map(&:join)}}

Good answer, also as an FYI the brief was changed, you no longer have to adhere to the duration being an input, as this restricts the possible languages. You just need to pause so the animation is apparent.

Lua(LÖVE), 296 287 bytes
c=0;f=1;t=10;l=love
function l.load()loadstring('i='..arg[2])()s=tonumber(arg[3])end
function l.update(d)if c>s then
c=0;f=f==#i and 1 or f+1
end;c=c+d;end
function l.draw()for K,V in pairs(i[f])do
for k,v in pairs(V)do if v>0 then l.graphics.rectangle('fill',k*t,K*t,t,t)end
end
end
end

Usage Example
love main.love '{{{1,0,0},{0,0,0},{0,0,0}},{{0,1,0},{0,0,0},{0,0,0}},{{0,0,1},{0,0,0},{0,0,0}},{{0,0,0},{0,0,1},{0,0,0}},{{0,0,0},{0,0,0},{0,0,1}},{{0,0,0},{0,0,0},{0,1,0}},{{0,0,0},{0,0,0},{1,0,0}},{{0,0,0},{1,0,0},{0,0,0}},{{1,0,0},{1,0,0},{0,0,0}},{{1,1,0},{1,0,0},{0,0,0}},{{1,1,1},{1,0,0},{0,0,0}},{{1,1,1},{1,0,1},{0,0,0}},{{1,1,1},{1,0,1},{0,0,1}},{{1,1,1},{1,0,1},{0,1,1}},{{1,1,1},{1,0,1},{1,1,1}},{{1,1,1},{1,1,1},{1,1,1}},{{0,0,0},{0,0,0},{0,0,0}}}' 1

Output : https://youtu.be/0kDhPbbyG9E

Hmm, I've not had much exposure to lua, I didn't know it had graphics support as well, but knew it had great performance. A very interesting and unexpected answer. This is probably the answer that is closest to allowing colored input based on the numbers passed. Also the first answer to not use ASCII, despite the high byte count, great job man +1 for uniqueness.

@carusocomputing Thanks! LÖVE is a framework for making 2d games. You should check it out :-)

Oh man, really? Can you link me to some of your other work man? I would absolutely love to see it dude.


text:
Simplify a continued fraction
Continued fractions are expressions that describe fractions iteratively. They can be represented graphically:
$$
a_0 +\cfrac 1
 {a_1 + \cfrac 1
  {a_2 + \cfrac 1
   {\ddots + \cfrac 1
    {a_n}
   }
  }
 }
$$
Or they can be represented as a list of values: \$[a_0 ; a_1, a_2, \dots, a_n]\$
The challenge:
take a base number: \$a_0\$ and a list of denominator values: \$[a_1, a_2, \dots, a_n]\$ and simplify the continued fraction to a simplified rational fraction: return or print numerator and denominator separately.
Examples:

\$\sqrt 19\$: [4;2,1,3,1,2]: 170/39
\$e\$: [1;0,1,1,2,1,1]: 19/7
\$\pi\$: [3;7,15,1,292,1]: 104348/33215
\$ϕ\$: [1;1,1,1,1,1]: 13/8

Example implementation: (python)
def foo(base, sequence):
    numerator = 1
    denominator = sequence[-1]
    for d in sequence[-2::-1]:
        temp = denominator
        denominator = d * denominator + numerator
        numerator = temp
    return numerator + base * denominator, denominator
Winning: shortest code in bytes: --no builtins that do the entire problem allowed--

You should make this sentence more clear, "and simplify the continued fraction to a single fraction"; unless you intended the wording to mean a result of 2.002 can be expressed as 2002/1000. That's technically a "single fraction", you probably want to say, "a single fraction, in its most simple form."

@carusocomputing point taken.. although I wouldn't feel too bad about 2/4 (or similar) as it has still simplified the multiple fraction structure to a single fraction

Hmm... I think there's a way to exploit that, but with the 13 byte golfscript answer, I'd have to probably use MATL to win.

@carusocomputing I'd say go for it... If you can beat the 13 byte answer, that'd be awesome

You can make the pi stop earlier - 355/113.

@ThorbjørnRavnAndersen all of them can in fact stop whenever, or never at all, as they're all infinite series expansions...

Related challenge, and Another

@mbomb007 those two are exactly the same as each other, whereas mine reverses the inputs and outputs of the question... Obvi they're related, but the exact question hadn't been asked yet

J, 8 5 bytes
Same as this, but uses a build-in for rationals.
Argument is {a0,a1,a2,a3,...} as a list of J extended precision rational numbers. Result is the fraction as a J extended precision rational number.
(+%)/

(+%) the plus-the-reciprocal-of
/ reduction over
Try it online!
-3 thanks to miles.

If you take the input as a list of extended integers, you could save 3 bytes. Also you used APL division in the explanation.

@miles Thanks. Can't get closer to the built-in prohibition than that. Too bad J doesn't have a hook composition character like Dyalog APL's ∘.

The try J online link is broken

@ChieltenBrinke Thanks. Fixed.

Haskell, 37 36 18 bytes
foldr1$(.(1/)).(+)

This function expects Haskell's Ratio type as input. Usage example:
Prelude Data.Ratio> ( foldr1$(.(1/)).(+) )  [4%1,2,1,3,1,2]
170 % 39

Note: one explicit Ratio in the input list (4%1) is enough, the type systems figures out that the others have to be Ratios, too.
Edit: @Lynn saved a byte. Thanks!
Edit II: removed the import (see this discussion on meta).

Oooh, nice edge case. The function itself is polymorphic, so it doesn't need the import. However to call it, you have to feed Ratios to it which does need the import.  Should I add the import to the byte count or not?

That sounds like a good question for meta.

I've never used Haskell, so correct me if I'm wrong, but if the python equivelent would be: from fractions import Fraction to do operations with Fraction objects, the import statement is counted as well.

.. we had that before.

@Aaron: the problem is: the definition of the function doesn't need the import, because it's polymorphic. When you want to call it, you need to provide numbers of type Ratio which can only be constructed via %, which requires the import. Usually we don't count bytes for calling overhead, just for the function itself.

@nimi this is exactly the same with python. If I load the fraction module and create Fraction objects, I can then use the standard built-in operators (+ - * / % etc.) to do operations on them just like I would with floats. It is a valid way of getting a rational number instead of a float, but my import statement would still count (even if I was doing everything interactively)

(1/) is a byte shorter than recip.

if you state that you your haskell interpreter is Lambdabot you don't have to pay for the imports: http://codegolf.stackexchange.com/a/92314/43037

@nimi I regarding @BlackCap's comment, if Prelude does import Data.Ratio by default, I don't have any problem with omitting it..

@BlackCap: yes, but that's a different story. I want to stick to default Haskell and not a specific interpreter.

... moved discussion about byte count to meta. Please  answer there.

GolfScript, 13 bytes
~]-1%{\-1?+}*

Try it online!
Yay for GolfScript's hidden rationals. :)
Explanation
GolfScript's only "official" number type is integers. But the exponentiation operator doesn't cast its result to integer and conveniently the native result of an integer exponentiation in Ruby (the language of GolfScript's interpreter) is a rational number. So we can easily get fractions by raising something to the power of -1. Conveniently, we want reciprocals anyway...
~]     # Evaluate input and wrap all a_i in a list.
-1%    # Reverse the list so that a_n is at the start and a_0 at the end.
{      # Fold... (apply this block to each element from a_n-1 down to a_0, with
       # the previous result on the stack)
  \    #   Swap previous result with current a_i.
  -1?  #   Raise previous result to the power of -1, computing its reciprocal
       #   as a rational number.
  +    #   Add a_i.
}*

LabVIEW, 36 equivalent bytes
Fairly straight forward naive implementation using OP's algorithm. Is there a nicer way to do this?

Your electrical engineering degree is showing.

@ijustlovemath Props, but..... relevant

Yeah it's a contentious language to be sure. I see LabVIEW as the "I hate math" of the programmers world. The problem is not math itself, but how it's taught (or often the lack of teaching at all).

Mathematica, 23 22 bytes
Fold[#2+1/#&]@*Reverse

Essentially a port of my GolfScript answer. Here are some alternatives:
For 24 bytes, we can write a recursive variadic function:
f@n_=n
n_~f~m__:=n+1/f@m

For 21 bytes, we can even define a "variadic operator", but its calling convention would be so weird, that I'm reluctant to count this one:
±n_=n
n_ ±m__:=n+1/±m

You would have to call this with a sequence of the input values, e.g. ±Sequence[3, 7, 15, 1, 292, 1] or ±##&[3, 7, 15, 1, 292, 1].
And also for 21 bytes, there would be the (forbidden) built-in:
FromContinuedFraction

Dyalog APL, 10 bytes
Does not even use a build-in for rationals.
Takes {a0,a1,a2,a3,...} as argument, returns {denominator,numerator}.
1(,÷∨)+∘÷/

1(,÷∨) 1-prepended-to divided by the GCD of 1 and
+∘÷ plus-the-reciprocal-of
/ reduction over
TryAPL online!

Python 2, 62 bytes
a=d=0
b=c=1
for n in input():a,b=b,n*b+a;c,d=d,n*d+c
print b,d

It's unfortunately not as golfy (see @xnor's answer for shorter), but it calculates the fraction without needing to reverse the input. This uses the "magic table" approach for convergents – given the last two fractions a/c and b/d, the next fraction is (n*b+a)/(n*c+d).
For instance, for pi:
          3    7    15     1      292        1

  0   1   3   22   333   355   103993   104348
  1   0   1    7   106   113    33102    33215

We can see that 15*22 + 3 = 333, 15*7 + 1 = 106, 1*333 + 22 = 355, 1*106 + 7 = 113, etc.

M, 5 bytes
Ṛİ+¥/

The input is a list of the values [a0, a1, ..., aN] and it outputs a rational number.
Try it online! or Verify all test cases.
Explanation
Ṛİ+¥/  Input: list A
Ṛ      Reverse A
    /  Reduce A from left to right using
   ¥     A dyadic chain
 İ         Take the reciprocal of the left value
  +        Add the reciprocal to the right value
       Return and print implicitly

What is this? Some new Jelly dialect?

@miles actually 9 bytes sorry :(

@Adám It's an old fork of Jelly meant for math and symbolics. Here's its Github repo.

@Aaron M uses the same code page as Jelly, and it can be encoded using a byte for each character.

@miles OK, added.

@miles point taken.. my bad

Haskell, 30 bytes
foldr(\h(n,d)->(h*n+d,n))(1,0)

Recursively adds each layer going outward, updating n/d to h+(1/(n/d)), which equals h+d/n or (h*n+d)/n. The fraction is stored as a tuple of (num,denom). The initial fraction of (1,0) flips to 0/1 which is 0.

 Common Lisp, 54
A somewhat verbose fold-right:
(lambda(s)(reduce(lambda(a r)(+(/ r)a))s :from-end t))

Tests
PASS  NAME  ACTUAL               EXPECTED
===============================================
T     √19   170/39               170/39
T     ℯ     19/7                 19/7
T     π     104348/33215         104348/33215
T     ϕ     13/8                 13/8

Python, 50 bytes
f=lambda l,n=1,d=0:l and f(l,l.pop()*n+d,n)or(n,d)

Builds the continued fraction from the end of the list going backwards, repeatedly updating the fraction n/d on the last element x as n/d -> 1+1/(n/d) == (x*n+d)/n.

JavaScript (ES6), 44 bytes
a=>a.reduceRight(([n,d],v)=>[v*n+d,n],[1,0])

Julia (53 Bytes)
This is my first time ever using Julia, if I overlooked an iterator I could have used to lose some more bytes, let me know. Here's a hint to anyone who doesn't know what language to choose for this specific challenge: https://en.wikipedia.org/wiki/Rational_data_type
f(x,c)=(a=0;for b in x[end:-1:1];a=1//(b+a);end;a+c;)

Reverse the input array.
Iterate through it with rational division.
Add c to the decimal result.

you can save two bytes by defining an operator (e.g. ∘) instead of a function

also, change the for loop for a while and pop: x∘c=(a=0;while x!=[];a=1//(pop!(x)+a);end;a+c;)

25: x->foldr((x,y)->x+1//y,x) (same as Haskell solution). usage: (x->foldr((x,y)->x+1//y,x))([4//1,2,1,3,1,2])

Ooo... A reverse folding function? That's beautiful! I don't deserve to take credit for that though haha.

05AB1E, 19 17 bytes
R¬V¦vyY*X+YUV}YX)

Explanation
Input taken as a list of numbers
                     # variable X is initialized as 1
R¬V¦                 # reverse the list, remove the first item and store it in variable Y
    v        }       # for each item N left in list
     yY*X+  V        # store N*Y+X in Y
          YU         # store Y in X
              YX)    # wrap X and Y in a list

Try it online!

Javascript (ES6), 55 bytes
s=>eval('for(F=[1,0];s+"";)F=[s.pop()*F[0]+F[1],F[0]]')

Test cases

var f =
s=>eval('for(F=[1,0];s+"";)F=[s.pop()*F[0]+F[1],F[0]]')

console.log(f([4, 2, 1, 3, 1, 2]));
console.log(f([1, 0, 1, 1, 2, 1, 1]));
console.log(f([3, 7, 15, 1, 292, 1]));
console.log(f([1, 1, 1, 1, 1, 1]));

CJam, 18 16 bytes
XUq~W%{2$*+\}/]p

Online interpreter.
XU                  Push 1 and 0 to the stack
  q~W%              Push input, eval and reverse it
      {     }/      For each n in the reversed input...
       2$             Copy numerator
         *+           Calculate n*denominator + numerator
           \          Swap numerator and denominator
              ]p   Wrap in array and output

Zephyr, 145 bytes
input n as Integer
set a to Array(n)
for i from 1to n
input a[i]as Integer
next
set r to a[n]
for i from 1to n-1
set r to(/r)+a[n-i]
next
print r

Zephyr is the first programming language I ever created. It was designed to be intuitive and have clean syntax--rather at the expense of brevity. Why am I golfing with it, you ask? Because, unlike any language I've written since, it has a built-in Fraction type. You can even use the division operator / as a unary operator for "inverse" (a feature I borrowed for Pip).
Now, there are significant limitations. The biggest problem for this challenge is that arrays must be defined with fixed size, which means that the program starts by reading the size of the array from the user. (I hope this is ok; the alternative is hardcoding the size.) There's also the minor problem that operator precedence doesn't exist, meaning multi-operator expressions have to have parentheses.
Here's an example run:
C:\Zephyr> python zephyr.py contfrac.zeph
6
1
1
1
1
1
1
13/8

Perl 6, 24 bytes
{[R[&(1/*+*)]](@_).nude}

Explanation:

1 / * + * is a lambda with two parameters (*) which takes the reciprocal of the first, and adds the second. ( returns a Rat )
R[&(…)] uses that as if it was an infix operator and reverses it.
( including making it right associative )
[…](@_) takes that and uses it to reduce the input.
… .nude returns the numerator and denominator of the Rat.
{ … } make it a bare block lambda with implicit parameter @_.

Usage:
say {[R[&(1/*+*)]](@_).nude}(3,7,15,1,292,1) #*/# (104348 33215)

my &code = {[R[&(1/*+*)]](@_).nude}; # stupid highlighter */

say code 4,2,1,3,1,2;    # (170 39)
say code 1,0,1,1,2,1,1;  # (19 7)
say code 1,1,1,1,1,1;    # (13 8)

Javascript (ES6), 50 bytes
f=(s,n=1,d=s.pop())=>s+""?f(s,d,s.pop()*d+n):[d,n]

It's thanks to Arnauld's answer, before seeing it I was stuck to 66 bytes:
f=(b,s,i=s.length-1,n=1,d=s[i])=>i?f(b,s,--i,d,s[i]*d+n):[n+b*d,d]

Example:
Call: f([1, 0, 1, 1, 2, 1, 1])
Output: Array [ 19, 7 ]

APL(NARS), 15+1 chars, 30+2 bytes
{1=≢⍵:↑⍵⋄+∘÷/⍵}

Translation in Apl(Nars) from Adam J solution...
the input allowed for that function will be
all list of integer numbers, where the first element
will be of type rational. Test:
  f←{1=≢⍵:↑⍵⋄+∘÷/⍵}
  f 4x 2 1 3 1 2
170r39
  f 1x 0 1 1 2 1 1
19r7
  f 3x 7 15 1 292 1
104348r33215
  f 1x 1 1 1 1 1
13r8
  f 3x 89 888 999 11 222 373 7282 9272 3839 2828
158824716824887954093160207727r52744031585005490644982548907
  f ,0x
0
  f ,9x
9

so it would be 15 chars as length of function and 1 char for "x" for enter the type of input I want
and exit the type I want...

Ruby, 34 bytes
->a{a.reverse.inject{|b,i|i+1r/b}}

This performs a right fold (by reversing and then left folding), adding each element to 1 over the running total (the elements to the right). Ruby has the Rational type, which is really nice. And literal rationals are a number suffixed with r.

Stax, 4 bytes
╣╩┼►

Run and debug it
As small as it is, it's not a built-in.  The built-in rationals help quite a bit though.  Unpacked to ascii, the program is rksu+.

Reverse the array.
Fold the array using (a, b) => (a + 1/b).

Husk, 4 bytes
Ḟ·+\

Try it online!
pretty simple with TNum being a rational type.

Vyxal, 6 5 bytes
‡Ė+ḭƒ

Try it Online!
I added foldr lol.
Explained
‡Ė+ḭƒ
‡Ė+    # lambda x, y: 1 / x + y
   ḭ   # reduce input by ↑, going right-to-left
    ƒ  # fractionify the result

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