Answer-Chaining Fibonacci

25

4

(Inspired by ASCII's 95 Characters...95 Movie Quotes)

The Challenge

Given input n, output the nth Fibonacci number. You can use either 0 or 1 indexing, please state which in your submission. Simple, yeah? The catch is you must take the character set of the immediate previous answer, remove two characters from it, and add a separate character. The separate character must

  • not be from the immediate previous answer's character set
  • be from the set of (printable ASCII, space, newline, horizontal tab)

and thus your total character set size will be exactly one smaller than the immediate previous answer's set.

The initial answer

The first submission must contain a subset of (all printable ASCII, space, newline, and horizontal tab) with two characters removed. Every submission thereafter must restrict their answers to this original ASCII-only format (meaning you can't add a Unicode or extended-ASCII character ... sorry Jelly, APL, et al.).

Examples and Clarifications

  • Suppose the first answer is in C and contains (almost all printable ASCII, newline, and horizontal tab), and omits the % and ^ from its character set. The second submission, then, must remove two characters from the previous (almost all printable ASCII, newline, and horizontal tab) character set and add in either the % or ^. Perhaps it's a one-liner PowerShell answer that omits the newline. And so on.
  • If the previous answer had print(){}!*+ as its character set (12 characters), your submission could have print(){}! (10 characters) and one additional character, print(){!+ (10 characters) and one additional character, etc.
  • If the previous answer had print(){}!*+ as its character set (12 characters), your submission could not have print() and & (8 characters) as its character set, since 12 - 8 > 1.
  • If the previous answer had print(){}!*+ as its character set (12 characters), your submission could not have print(){}! (10 characters) plus additional character * as its character set, since even though that's 11 characters, the * is included in the previous set.
  • Not every character in your character set must do something useful for your submission. For example, if the previous answer had print(){}!*+ as its character set, and your language has a built-in ! that calculates the Fibonacci sequence and # that starts a comment, your submission could be !#print(){} and still be valid.
  • You can use the same character from your character set multiple times. For example, suppose your character set was !*#_, your answer could be !!!**#**#_!! and would be acceptable.
  • In addition to your code (and an explanation is nice, too!) please also explicitly list your character set, to make it easier for future submissions.

Winning

The winner of the challenge will be the person who posted the second most-recent submission (i.e., not the person who posted last, since they broke the chain).

Final Rules

Usual rules apply:

  • The same person can't post twice in a row
  • If an answer is deemed invalid (for example, it used a forbidden character, or doesn't calculate correctly), it needs to be deleted (and any subsequent answers that chain off of it also)
  • Two users who post "at the same time" will have to let the earlier submission stand
  • The same language cannot be posted twice in a row. For the purposes of this rule, languages of the same family (e.g., Python 2 and Python 3) count as "the same language."

Final things:

  • This post works best if you sort by "Oldest" so that the answers are in proper order.
  • Kyle Gullion constructed a code checker in Python here to verify if you're missing or using wrong characters.

AdmBorkBork

Posted 2017-04-06T17:22:07.980

Reputation: 41 581

Just a few quick clarifications: 1) Does our program have to actually contain the full set we're using, or we can use a smaller set of characters? (Important for minimalist languages, like brain(fuck|flak), unary, etc.) 2) You say that the same language cannot be posted twice in a row. Can the same language be posted any number of times as long as it's not in a row? – James – 2017-04-06T17:30:00.020

Why do we remove 2 characters, but add only one? Also, can I post first answer with enormous comment with lots of characters, so next 100500 entries won't be lacking any character? – Dead Possum – 2017-04-06T17:30:30.233

@DJMcMayhem 1) Yes, it has to contain the full set. If the extraneous characters are just junk or comments (like, suppose the first answer was in Whitespace), that's perfectly fine. That may mean the BFs may need to wait a while to answer. 2) Yes, languages can be used any number of times, so long as it's not twice in a row. Going Java-Python-Java-Python-Java-Python, is perfectly acceptable. – AdmBorkBork – 2017-04-06T17:37:41.637

1I suggest you add the first one, because one can destroy this challenge if it posts the first one – Mr. Xcoder – 2017-04-06T17:37:55.323

1@DeadPossum It's based on character set, not overall character count. Removing two and adding one ensures that the eventual pool of available characters dwindles and forces creativity on future answers. – AdmBorkBork – 2017-04-06T17:39:01.390

3@Mr.Xcoder I have faith in the PPCG community, and if someone purposefully messes it up I reserve the right to call them a doody-head in chat. – AdmBorkBork – 2017-04-06T17:39:45.627

@AdmBorkBork I for sure will use that right as I need – Christopher – 2017-04-06T20:41:48.560

3

Threw a code checker up to make life a bit easier for anyone interested.

– Kyle G – 2017-04-07T01:58:38.803

Answers

6

1. C

Contains no { or }.

#if 1
#define Q !"$&'",./=@[]^_\`|*
int WERTYUIOPASDFGHJKLZXCVBNM34567890(qwrtyuopasghjklzxcvbm)<%
	return qwrtyuopasghjklzxcvbm<2?1:WERTYUIOPASDFGHJKLZXCVBNM34567890(~-qwrtyuopasghjklzxcvbm)+WERTYUIOPASDFGHJKLZXCVBNM34567890(qwrtyuopasghjklzxcvbm-2);
%>
#endif

Try it online!

I hope I did this right.

betseg

Posted 2017-04-06T17:22:07.980

Reputation: 8 493

1Well shoot. I seconds away from posting a brain-flak answer, and now that's pretty much impossible. :/ – James – 2017-04-06T17:41:46.807

@DJMcMayhem Nah, you just gotta wait for someone to add one of { or } so you can then add the other. – AdmBorkBork – 2017-04-06T17:42:44.087

@DJMcMayhem well, if someone adds { or }, then you can add the other one and the Brain-Flak answer. – betseg – 2017-04-06T17:43:17.813

1I notice this answer has no *. Are we allowed to omit characters from our character set and have them still be "included", or was that an oversight? – Greg Martin – 2017-04-06T17:53:42.503

@gregMartin 2?1*1 would fix that. – Magic Octopus Urn – 2017-04-06T17:54:43.453

5

2. Mathematica

Contains no }, Z, or horizontal tab. (Reincluded {.)

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

The two first lines are just a comment; the last line is the builtin function, using the Only True Super Cosmically Ordained Indexing where inputs 0 and 1 yield outputs 0 and 1 respectively (I have no idea whether to call this 0-indexed or 1-indexed).

Greg Martin

Posted 2017-04-06T17:22:07.980

Reputation: 13 940

5

8. Octave

Added U and removed + and -. Solution contains no +-`01AEI or tab character.

% !"#$&\'*./256789:<>?BCDFGHJKLMNOPQRSTUVWXYZ\\_abceghijklnpqrstuvwyz{|}~
f=@(x)([mod(4,3) mod(4,3);mod(4,3) mod(4,4)]^x)(3)

Based on the Fibonacci Matrix.

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

You do have t though... – Anthony Pham – 2017-04-07T01:38:44.667

\t is the way the tab character is printed in Python (which I used to check my answer), I'll edit to make it a bit more clear. – Kyle G – 2017-04-07T01:49:04.173

That Fibonacci matrix is a good idea! – Luis Mendo – 2017-04-07T10:14:19.760

5

33, MATL

Added -, removed (). Solution doesn't contain !&'()/\01?AEIKLMNPSTWZ`dmwz{}|~, tab, space, or newline.

5X^Hq+G^Hq5X^-G^-HG^5X^*Hqqq^*Yo%"#$,.2346789:;<=>@BCDFJOQRUV[]_abcefghijklnprstuvxy

Try it at MATL Online

Fixed mistake: 0, 1, and \ were accidentally left in the comment (after the %) at the end. Their removal does not break the functionality. Moved this answer from 32 to 33 in an attempt to keep it valid. If it needs to be deleted, please let me know and I'll do just that.

user67955

Posted 2017-04-06T17:22:07.980

Reputation:

1Welcpme to PPCG! :) – betseg – 2017-04-08T17:33:49.180

Thanks, it's fixed now. The 0 1 and \ were in the comment at the end (after the %) and thus their removal does not affect the program's functionality. I'm really sorry for ruining the chain, eugh. – None – 2017-04-08T18:57:20.823

Perhaps the smoothest fix would be to count the Python 3 answer as #32, and for you to alter yours to make it #33? Seems like you have characters to spare :)

– Greg Martin – 2017-04-08T19:12:39.370

You should probably remove the - from the doesn't contain list since you added it – fəˈnɛtɪk – 2017-04-08T19:28:29.210

5

36. Java

Added \. Removed qx. Doesn't use !&'()/1?AEIKLMNPSTWZ`dmnqtwxz{}|~[], tab, or space.

\u002f\u002f"#$%*:>@BCGHJOQRUVXY^_jk
class
Fibo\u006eacci\u007b
i\u006e\u0074
fib\u0028i\u006e\u0074
\u006e\u0029\u007b
i\u006e\u0074
lo\u0077=0,high=3-2,\u0074e\u006Dp;
for\u0028i\u006e\u0074
i=3-2;i<\u006e;i++\u0029\u007b
\u0074e\u006Dp=lo\u0077;
lo\u0077=high;
high=high+\u0074e\u006Dp;
\u007D
re\u0074ur\u006e
lo\u0077;
\u007D
public
s\u0074a\u0074ic
voi\u0064
\u006Dai\u006e\u0028\u0053\u0074ri\u006eg\u005b\u005Db\u0029\u007b
Fibo\u006eacci
a=\u006ee\u0077
Fibo\u006eacci\u0028\u0029;
for\u0028i\u006e\u0074
i=3-2;i<=20;i++\u0029\u007b
\u0053ys\u0074e\u006D.ou\u0074.pri\u006e\u0074l\u006e\u0028a.fib\u0028i\u0029\u0029;
\u007D
\u007D
\u007D

I know I probably could have waited longer but I wanted to make sure to get this out before it was too late. Not only does this class define a function which takes an integer n and return that Fibonacci number, but it also prints the first 20 for you just for fun. I tried to do my due diligence by writing this in plain old java with no sneaky golfing and then I removed illegal characters 1 by 1 until we got to the creature you see before you now.

Try it online!

Poke

Posted 2017-04-06T17:22:07.980

Reputation: 3 075

2So that is why you wanted 0 – Christopher – 2017-04-13T11:36:20.720

Dang, looks like you broke the chain. :-( – AdmBorkBork – 2017-04-18T12:37:27.140

@AdmBorkBork b-but I removed q and x :[ Who needed those!? I could have removed anything – Poke – 2017-04-18T13:04:18.460

@Poke now that it has been a week so I "win". Now to post one more answer – Christopher – 2017-04-21T20:27:32.850

@DownChristopher haha aw :[ – Poke – 2017-04-21T20:29:44.803

@Poke it is the closest I have to accepted answer :P – Christopher – 2017-04-21T20:32:12.253

@Poke done. now you respond – Christopher – 2017-04-21T20:36:40.717

@Christopher well you see now I just have to wait for longer than you waited... – Poke – 2017-04-21T21:09:42.760

@Poke that won't work. Remember I "won" you can only get 2nd – Christopher – 2017-04-21T21:12:45.723

5

37. Python 2

Readded x. Doesn't use !&'()/1?AEIMNPSTWZdmnqtwz{}|~[], space, tab or `. Removed K and L.

f=u"\u0074"
b=u"\u006D"
i=u"\u0028"
j=u"\u0029"
h=u"\u006e"
r=2.2360679775
s=u"\u002F"
exec"p="+i+"3-2+r"+j+s+"2"
exec"g=i"+h+"pu"+f+i+j
exec"pri"+h+f+i+"i"+h+f+i+i+"p**g-"+i+"-p"+j+"**-g"+j+s+"r"+j+j
#$%´:;<=>@BCGHJOQRUVXY^agklopvy

With comments:

f=u"\u0074" #t
b=u"\u006D" #m
i=u"\u0028" #(
j=u"\u0029" #)
h=u"\u006e" #n
r=2.2360679775 #sqrt(5)
s=u"\u002F" #/
exec"p="+i+"3-2+r"+j+s+"2" #p=(3-2+r)/2 = (1+sqrt(5))/2 = phi
exec"g=i"+h+"pu"+f+i+j #g=input()
exec"pri"+h+f+i+"i"+h+f+i+i+"p**g-"+i+"-p"+j+"**-g"+j+s+"r"+j+j #print(int((p**g-(-p)**-g)/r))

This approach uses the fibonacci series' general term.

staticmethod

Posted 2017-04-06T17:22:07.980

Reputation: 191

Nice first answer! Not to mention I just added another one :P – Christopher – 2017-05-11T01:40:58.043

4

3. Brain-Flak

Contains no Z, ~, A, or horizontal tab. (Re-included })

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

Try it online!

James

Posted 2017-04-06T17:22:07.980

Reputation: 54 537

4

5, Haskell

Removed AEIOU and tab, added Z

-- #!"$%&'*./23456789;:<>?@BCDFGHJKLMNPQRSTVWXYZ[\]^`abcdeghijklmopqrstuvwxyz{|}~,_
f 0 = 1
f 1 = 1
f n = f (n-1) + f (n-2)

Try it online!

ovs

Posted 2017-04-06T17:22:07.980

Reputation: 21 408

3I don't like you anymore... I need 3 vowels. AND YOU TOOK EM – Christopher – 2017-04-06T20:26:40.543

So I used a different language – Christopher – 2017-04-06T20:34:45.563

3

6. Brain-Flak

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

Try it online! Doesn't use tabAEIU`_, and added back O

Christopher

Posted 2017-04-06T17:22:07.980

Reputation: 3 428

I made CW since I just changed a bit of the code so I don't get unfair rep for others work. – Christopher – 2017-04-06T20:35:45.767

3

12. Python 3

added : removed {; doesn't contain {};`01AEIPQx or tab character.

#!"#$%&\',./23456789?@BCDFGHJKLMNORSTUVWXYZ[\]^_abcdgjkmopqrvwyz|~:
def fib(n,a=3-2,b=3-2):
 if n==2-2:
  return a
 a, b = b, a + b
 return fib(n-1,a,b)

gonengazit

Posted 2017-04-06T17:22:07.980

Reputation: 31

You mean you removed {;, not };. – L3viathan – 2017-04-07T11:55:02.180

3

26. Prolog (SWI)

Added %. Removed NK. Doesn't use &*01AEIKLMNPSTWZ`dmrwz{}], tab or newline.

a(X,B):-X<3,B is 4-3;C is X-4-(-3),D is X-2,a(C,G),a(D,F),B is G-(-F).%!"#$'/56789=>?@HJOQRUVY[\^_bcefghjklnopqtuvxy|~

Try it online!

Emigna

Posted 2017-04-06T17:22:07.980

Reputation: 50 798

3

34. brainfuck

Added newline, removed n and t. Doesn't use !&'()/\01?AEIKLMNPSTWZ`dmntwz{}|~, tab, or space. (maybe we can get some 2D languages now)

0-indexed. Input/output is by byte values.

,[->]+>+<<[->>[->+<]<[->+<]>>[-<+<+>>]<<<]>>.
"#$%*23456789:;=@BCDFGHJOQRUVXY^_abcefghijklopqrsuvxy

Try it online!

Business Cat

Posted 2017-04-06T17:22:07.980

Reputation: 8 927

@Poke done. I added it back – Christopher – 2017-04-12T23:47:53.783

2

4, Python 2

Removed AEIZ, tab added ~

# !"$%&'*-./23456789;<>?@BCDFGHJKLMNOPQRSTUVWXY[\]^`chjklmpqsvwxyz{|}

def f(x):
 a=0
 b=1
 for _ in range(x):
  a,b = a+b,a
 return a

Try it online!

Post Rock Garf Hunter

Posted 2017-04-06T17:22:07.980

Reputation: 55 382

2

9. Python 2

Added -, removed m and x. Contains no +`01AEImx or tab character.

# --!"$%&'*./29;:<>?@[\]^345678BCDFGHJKLMNOPQRSTUVWXYZabcdeghijklopqrstuvwyz{|}~,_

def fibonacci(n):
    elif n==(2/2):
        return 2-2
    elif n==2:
        return 2/2
    else:
        return fibonacci(n-2/2)-(-(fibonacci(n-2)))

Recursive Python function! Adds all Fibonacci numbers backwards until n is 1.

Anthony Pham

Posted 2017-04-06T17:22:07.980

Reputation: 1 911

You forgot to add the uppercase letters to your code – Conor O'Brien – 2017-04-07T01:54:52.430

1looks like you've still got a backtick and a 1 and left out 345678BCDFGHJKLMNOPQRSTUVWXYZ – Kyle G – 2017-04-07T02:02:18.020

@KyleGullion The previous answer had no 1 or backtick in its character set though – Anthony Pham – 2017-04-07T11:23:39.873

I've made an edit suggestion to show what I mean. – Kyle G – 2017-04-07T11:43:28.567

2

10. C

Added m, removed PQ. Doesn't contain +`01AEIPQx or tab character.

Compiler flag: -lm

//!"#$%&'*346789:<=>?@BCDFGHJKLMNORSTUVWXYZ[\]^_acfghkmvyz|.

double fib(i){
    double j = -(-~-2-sqrt(5))/2;
    return floor((pow(j,i)-pow(-j,-i))/sqrt(5));
}

Try it online!

betseg

Posted 2017-04-06T17:22:07.980

Reputation: 8 493

. is still missing in your comment. – L3viathan – 2017-04-07T10:01:34.850

2

11. Standard ML (mosml)

Added +. Removed :}. Doesn't contain :}0`1AEIPQx or tab character.

(* !"#$%&\',./23456789;<>?@BCDFGHJKLMNORSTUVWXYZ[\]^_abcdgjkmopqrvwyz{|~ *)
fun f s = if s = 2-2 then 2-2 else if s = 3-2 then 3-2 else f (s-4+2) + f (s-3+2)

SML isn't on TIO, and I used the moscow ml variety, but there's an online SMLNJ interpreter here.

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

2

18. Octave

Added ; and removed f and space. Solution contains no {}:`*%01AEIPQfrd, no tab, no newline, and no space characters.

g=@(x)([4-3,4-3;4-3,4-4]^x)(3)#!"$&'+./256789<>?BCDFGHJKLMNORSTUVWXYZ\_abcehijklmnopqstuvwyz|~

Identical to answer 8, just with more SML hate :P

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

Don't purposefully try and break things too much. A little friendly "competitive cooperation" is nice, but the unstated goal of answer-chaining challenges is to keep them going as long as possible. :) – AdmBorkBork – 2017-04-07T12:56:04.703

1

Just a bit of fun between Octave and SML. Besides, a well timed Lenguage answer will ultimately take the cake I think.

– Kyle G – 2017-04-07T13:14:10.190

2

23. Standard ML (mosml)

There we go again. Added Q, removed } and ]. Doesn't use %&*+01:AEILMPZ`dmrzM{}], tab, or linefeed

fun f x = #2("!#$\\',.23456789<>?@BCDFGHJKNOQRSTUVWXY[/;^_abcgjkopqvwxy|~", if x = 2-2 then 2-2 else if x = 3-2 then 3-2 else f (~(~(x-4)-2)) + f (x-(~3-2)))

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

@Emigna Right, sorry. Then I'll allow Q instead. – L3viathan – 2017-04-07T17:08:51.053

2

25. CJam

Added + back, removed S and T. Doesn't use %&*01AEILMPSTZ`dmrz{}]Ww, tab, or linefeed.

Basically a port of my older answer, but this one uses some eval trickery to circumvent the lack of braces.

q~"XX"a:~'|("_(j\((j+"'|)'j+++~e# !$,-./23456789;<=>?@BCDFGHJKNOQRUVY[^bcfghiklnopstuvxy

0-indexed.

Try it online!

Business Cat

Posted 2017-04-06T17:22:07.980

Reputation: 8 927

2

27. JavaScript

Added *, removed " and '. Doesn't use "&'01AEIKLMNPSTZ`dmrz{}]Ww, tab, or linefeed.

f=a=>a<2?3-2:f(a-3+2)+f(a-4+2)/* !#$,.56789;%@BCDFGHJOQRUVXY[\^_bceghijklnopqstuvxy|~*/

Business Cat

Posted 2017-04-06T17:22:07.980

Reputation: 8 927

2

28. Haskell

f=length"":scanl(+)(length"f")f;g=const(f!!)"#$%*,./23456789<>?@BCDFGHJOQRUVXY[\\^_bijkpquvxy|~"

Try it online! Usage: g 3 gives 2.

Added ", removed <space> and -. Does not use &'-01AEIKLMNPSTZ`dmrz{}]Ww or any white spcae.

Laikoni

Posted 2017-04-06T17:22:07.980

Reputation: 23 676

2

30. Standard ML

Added :, removed + and ?. Does not contain !&'+-01?AEIKLMNPSTWZ`dmrwz{} or any white space.

fun$(a,b,x)n=if(length(x)=n)then(length(a))else$(b,a@b,()::x)n;("#%*./23456789<>BCDFGHJOQRUVXY\\^_cjkopqvy|~";$([],[()],[]))

The first part fun$(a,b,x)n=if(length(x)=n)then(length(a))else$(b,a@b,()::x)n defines a function $ which computes the nth fibonacci number itereatively using an unary list encoding. The length of argument x indicates the current number and a and b are lists of length fib(length(x)-1) and fib(length(x)). If n equals length(x) we return length(b), otherwise recursively add a and b via list concatenation and increment x by adding an element () to it.

The second part ("#%*./23456789<>BCDFGHJOQRUVXY\\^_cjkopqvy|~";$([],[()],[])) is a sequence where the string is discarded and $([],[()],[]) is the initialisation of the function $ with a = 0, b = 1 and x = 0, resulting in an anonymous function which computes the nth fibonacci number.

Laikoni

Posted 2017-04-06T17:22:07.980

Reputation: 23 676

2

32, Python 3

exec(chr(2**2+2**5+2**6)+chr((3^2)+2**2+2**5+2**6)+chr(2+2**2+2**5+2**6)+chr(2**5)+chr(2+2**2+2**5+2**6)+chr(2**3+2**5)+chr(2**3+2**4+2**5+2**6)+chr((3^2)+2**3+2**5)+chr(2+2**3+2**4+2**5)+chr(2+2**3)+chr(2**5)+chr((3^2)+2**5+2**6)+chr((3^2)+2**2+2**3+2**4+2**5)+chr(2**4+2**5)+chr(2+2**3)+chr(2**5)+chr(2+2**5+2**6)+chr((3^2)+2**2+2**3+2**4+2**5)+chr((3^2)+2**4+2**5)+chr(2+2**3)+chr(2**5)+chr(2+2**2+2**5+2**6)+chr((3^2)+2+2**2+2**3+2**5+2**6)+chr(2+2**4+2**5+2**6)+chr(2**5)+chr((3^2)+2+2**2+2**3+2**4+2**6)+chr(2**5)+chr((3^2)+2**3+2**5+2**6)+chr(2+2**2+2**3+2**5+2**6)+chr(2**5)+chr(2+2**4+2**5+2**6)+chr((3^2)+2**5+2**6)+chr(2+2**2+2**3+2**5+2**6)+chr((3^2)+2+2**2+2**5+2**6)+chr((3^2)+2**2+2**5+2**6)+chr(2**3+2**5)+chr(2**3+2**4+2**5+2**6)+chr((3^2)+2**3+2**5)+chr(2+2**3+2**4+2**5)+chr(2+2**3)+chr(2**5)+chr(2**5)+chr((3^2)+2**5+2**6)+chr(2**2+2**3+2**5)+chr(2+2**5+2**6)+chr(2**5)+chr((3^2)+2**2+2**3+2**4+2**5)+chr(2**5)+chr((3^2)+2**5+2**6)+chr((3^2)+2+2**3+2**5)+chr(2+2**5+2**6)+chr(2**2+2**3+2**5)+chr((3^2)+2**5+2**6)+chr(2+2**3)+chr(2**5)+chr(2+2**4+2**5+2**6)+chr((3^2)+2**2+2**5+2**6)+chr(2**2+2**4+2**5+2**6)+chr((3^2)+2**2+2**4+2**5+2**6)+chr(2+2**4+2**5+2**6)+chr(2+2**2+2**3+2**5+2**6)+chr(2**5)+chr((3^2)+2**5+2**6))#"$%,.789:;<=>@BCDFGHJOQRUVXY[]_abfgijklnopqstuvy

Added r and removed |~. Solution contains no !&'/\-01?AEIKLMNPSTWZ`dmrwz{}|~, no tab, no newline, and no space characters.

Francisco Couzo

Posted 2017-04-06T17:22:07.980

Reputation: 141

2

38. Matl

Added q. Removed 0 <newline>. Doesn't use !&'()/1?AEIKLM0NPSTW{Z`dmntwxz}|~[], tab, newline, or space.

5X^Hq+G^Hq5X^-G^-HG^5X^*Hqqq^*Yo%"#$,.2346789:;<=>@BCDFJORUV_abcefghijklprsuvy

Try it online

Christopher

Posted 2017-04-06T17:22:07.980

Reputation: 3 428

This answer doesn't work, it contains q – Kyle G – 2017-05-04T19:07:24.777

when did { get readded? – Destructible Lemon – 2017-05-11T01:49:24.737

(you still use { according to the doesn't use list) – Destructible Lemon – 2017-05-11T01:51:06.600

Answer 37 uses x, you didn't remove it, yet it's restricted. Can you add x at the end of the comment? The restricted list also says you don't use q, so you need to remove that. – NieDzejkob – 2017-09-04T16:43:19.493

Nevermind that, sent an edit – NieDzejkob – 2017-09-04T16:59:57.063

2

39. Python 2

Added 0. Removed @^. Doesn't use !^&'()/1?@AEIMNPSTWZdmntwz{}|~[] `, tab or newline.

C=u"f=la\u006Db\u0064a\u0020X:3-2if\u0020X<2else\u0020f\u0028X-3+2\u0029+f\u0028X-2\u0029";exec""+C#$%*,.57>BFGHJKLOQRUVY_ghjkopqrvy

Argument to exec without escape sequences:

f=lambda X:3-2if X<2else f(X-3+2)+f(X-2)

Try it online!

NieDzejkob

Posted 2017-04-06T17:22:07.980

Reputation: 4 630

1

7, Python 2

Re-included _. Removed characters: tab and AEIU`, and (just to get a little nasty) 0 and 1. Otherwise, just a copy of Wheat Wizard's answer (hence the community wiki).

# !"$%&'*./456789;<>?@BCDFGHJKLMNOPQRSTVWXY[\]^chjklmpqsvwxyz{|}

def f(x):
 a=2-2
 b=3-2
 for _ in range(x):
  a,b = a+b,a
 return a

Try it online!

Greg Martin

Posted 2017-04-06T17:22:07.980

Reputation: 13 940

1

13. Standard ML (mosml)

Added x. Removed :r. Doesn't contain :;{}0`1AEIPQr or tab character.

(* !"#$%&\',./23456789<>?@BCDFGHJKLMNORSTUVWXYZ[\]^_abcdgjkmopqvwxyz|~ *)
fun f s = if s = 2-2 then 2-2 else if s = 3-2 then 3-2 else f (s-4+2) + f (s-3+2)

After we've pretty much excluded C-style languages, let's go after Python. This answer is pretty much identical to answer 11.

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

1

14. Octave

Added r and removed newline and space. Solution contains no {}:;`01AEIPQ, no tab, no newline, and no space characters.

f=@(n)round(((2/2+sqrt(5))/2)^n/sqrt(5))%!"#$&'*-,.346789<>?BCDFGHJKLMNORSTUVWXYZ[\]_abceghijklmpvwyz|~

Based on a closed form formula (7).

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

1

15. Standard ML (mosml)

Added space and removed %/. Doesn't contain {}:;`01AEIPQ, tab, or newline.

fun f s = if s = 2-2 then 2-2 else if s = 3-2 then 3-2 else f (s-4+2) + f (s-3+2) (* !"#$&\',.23456789<>?@BCDFGHJKLMNORSTUVWXYZ[\]^_abcdgjkmopqrvwxyz|~ *)

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

1

16. Octave

Added / and removed * and space. Solution contains no {}:;`*%01AEIPQ, no tab, no newline, and no space characters.

f=@(n)round(((2/2+sqrt(5))/2)^n/sqrt(5))#!"$&'-,.346789<>?BCDFGHJKLMNORSTUVWXYZ[\]_abceghijklmpvwyz|~

Identical to answer 14, just a straight up attack on SML and Python :P

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

Well played. I see what I can do. – L3viathan – 2017-04-07T12:26:24.253

1

17. Standard ML (mosml)

Added space, removed rd. Contains no {}:;`*%01AEIPQrd, tab, or newline.

fun f s = #2("!#$&\\',.23456789<>?@BCDFGHJKLMNORSTUVWXYZ[]^_abcgjkmopqvwxyz|~", if s = 2-2 then 2-2 else if s = 3-2 then 3-2 else f (s-4+2) + f (s-3+2))

Again, a copy from my previous answers, but instead of a comment a string literal that gets discarded. And good bye, sqrt and round.

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

1

19. 05AB1E

Added }. Removed Zz. Contains no {:`*%01AEIPQfrdZz, tab, space, newline.

Xs2<<sFUX+Xs}q!"#$&'()+,-./23456789;<=>?@BCDFGHJKLMNORSTUVWXY[\]^_abceghijklmnopqstuvwxy|~

Try it online!

Emigna

Posted 2017-04-06T17:22:07.980

Reputation: 50 798

1

20. CJam

Added {, removed M and m. Doesn't contain %*01:AEIMPQZ`dfmrz, tab, space, or linefeed.

q~[XX]{_(j\((j+}je#!"$&'),-./23456789;<=>?@BCDFGHJKLNORSTUVWY^abcghiklnopstuvwxy|

0-indexed.

Try it online!

Business Cat

Posted 2017-04-06T17:22:07.980

Reputation: 8 927

1

22. PHP

Added f, removed & and L. Doesn't use %&*+01:AEILMPQZ`dmrzM{, tab, or linefeed.

$a=aRRay(3-2,3-2);$i=ReaDline();$c=3-2;while(($c=$c- -3-2)<=$i)$a[$c]=$a[$c- -2-3]- -$a[$c-2];echo $a[count($a)- -2-3];#!"'+./456789>?@BCFGHJKNOSTUVWXY\^_bfgjkpqsvx|}~

0-indexed.

Try it online!

Business Cat

Posted 2017-04-06T17:22:07.980

Reputation: 8 927

1

24. ><>

Added :. Removed Ww. Doesn't use %&*+01AEILMPZ`dmrzM{}]Ww, tab or newline

Uses the -v flag.

55-54-:@55-$--@@54--:54-54-p@555-54-54-g?.~~~n; !"#'(),/236789<=>BCDFGHJKNOQRSTUVXY[\^_abcefhijkloqstuvxy|

Try it online!

As we really needed to add : in order to duplicate values.
So we can't include the newline, requiring a one liner.
The only control flow we have while using 1 line is jump (.).
Utilizing this, the trick is mostly about keeping the values in the correct order on the stack.
Unfortunately we can't use }, so we use a workaround with g and p instead.

Emigna

Posted 2017-04-06T17:22:07.980

Reputation: 50 798

1

31. CoffeeScript

Added + and removed /\. Solution contains no !&'/\-01?AEIKLMNPSTWZ`dmrwz{}, no tab, no newline, and no space characters.

f=(x)=>if(x<2)then(x)else(f(x+(~2|2))+f(x+(~3|2)))#"$%*,.456789:;@BCDFGHJOQRUVXY[]^_abcgjkopquvy

Basic recursive solution. Try it online!

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

1

35. MATL

Added 0, removed [ and ]. Doesn't use !&'()/\1?AEIKLMNPSTWZ`dmntwz{}[]|~, tab, or space.

5X^Hq+G^Hq5X^-G^-HG^5X^*Hqqq^*Yo%"#$,.2346789:;<=>@BCDFJOQRUV_abcefghijklprsuvxy0
<newline>

Try it online

Christopher

Posted 2017-04-06T17:22:07.980

Reputation: 3 428

@Poke thanks. It gets harder to do this every time – Christopher – 2017-04-13T11:35:49.380

1

40. Aceto (line-mode)

Added d. Removed u\. Doesn't use !^&'()/1?@AEIMNPSTWZmntuwz{}|~\[] `, tab, or newline.

Use command-line option -l (which I counted in the used characters)

ridd32-532-2:F+sFs32-532-2:F-sF-s2sF532-2:F*:ipX"#$%,.046789;<=>BCDGHJKLOQRUVY_abcefghjkloqvxy

I'm using Binet's formula for the nth fibonacci number. Since I can't really use more than one stack (as []{}() are banned), I do it all on one, which is a bit annoying since the register is also blocked by the ban of M. Duplication and swapping still works, though. Instead of the number one I substract two from three (32-).

After printing, I exit with X and then just append the remaining characters (Aceto knows no comments).

L3viathan

Posted 2017-04-06T17:22:07.980

Reputation: 3 151

1

41. Alphuck, 366 bytes

Added ! and removed +.. Solution doesn't contain !^&'()+./1?@AEIMNPSTWZmntuwz{}|~\[] `, tab, or newline characters.

pisapiseppisapisopepiiiiiiiiiiipapiseeeeeepciiiiiiaisciiccpiaaeeeeeeeeeeccsaapicceaasceassscscaecpaaapisccpaaeccisapceaisapceaiscpceaaecisapceaiscccisaaapiscpiscpaaeaecccisaaapccceaaaiscceapciapaeeeeeeeeeecpiaipaeaasapepiceasaeaascccccsapiseeeeeeeepceeeeeeaisapcceaaisapcceaaisccsascpiaaeeeeeeeepceeeeeeaisscpjpiscsc!"#$%*-023456789:;<=>BCDFGHJKLOQRUVXY_bdfghklqrvxy

Try it online!

KSmarts

Posted 2017-04-06T17:22:07.980

Reputation: 1 830

1

42. Headsecks

Added ^ and removed Q_. Solution doesn't contain &'()+./1?@AEIMNPQSTWZ[\]_`mntuwz{|}~, space, tab, or newline characters.

U6y#OH;0:jFqCsfic8JoB^!kp2G3KVa*xbh#;gr"R7Csl>YOvX9,4dLD$<e5=-%o

Below is a Python3 function to transpiles Headsecks to brainf***

transpiler = lambda hs:"".join("+-<>.,[]"[ord(cmd)%8] for cmd in hs)

Code based on answer 34.

Let's see if we can get this chain going again! I added ^ to try and enable something like 38. Hopefully we can restore some stuff for other languages too.

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761

0

21. 05AB1E

Xs2<<sFUX+Xs}q!"#$&'(),-./23456789<=>?@BCDFGHJKLNORSTUVWXY[\]^_abceghijklnopqstuvwxy|~ 

Added space, removed + and {. Doesn't contain %*01:AEIMPQZ`dfmrzM{, tab, or linefeed. I removed the bracket to make it harder Try it online!

Christopher

Posted 2017-04-06T17:22:07.980

Reputation: 3 428

0

29. Octave

Added ] and removed !:. Solution contains no &'-!:01AEIKLMNPSTZ`dmrz{}Ww, no tab, no newline, and no space characters.

f=@(x)([length("l"),length("l");length("l"),length("")]^x)(3)#$%*+./2456789<>?BCDFGHJOQRUVXY\_abcijkopqsuvy|~

Same idea as answer 8

Kyle G

Posted 2017-04-06T17:22:07.980

Reputation: 761