text:
Answer-Chaining Fibonacci
(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 answer-chaining 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.

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?

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?

@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.

I suggest you add the first one, because one can destroy this challenge if it posts the first one

@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.

@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 I for sure will use that right as I need

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

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.

Well shoot. I seconds away from posting a brain-flak answer, and now that's pretty much impossible. :/

@DJMcMayhem Nah, you just gotta wait for someone to add one of { or } so you can then add the other.

@DJMcMayhem well, if someone adds { or }, then you can add the other one and the Brain-Flak answer.

I 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?

@gregMartin 2?1*1 would fix that.

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.

You do have t though...

\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.

That Fibonacci matrix is a good idea!

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.

Welcpme to PPCG! :)

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.

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 :)

You should probably remove the - from the doesn't contain list since you added it

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).

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!

So that is why you wanted 0

Dang, looks like you broke the chain. :-(

@AdmBorkBork b-but I removed q and x :[ Who needed those!? I could have removed anything

@Poke now that it has been a week so I "win". Now to post one more answer

@DownChristopher haha aw :[

@Poke it is the closest I have to accepted answer :P

@Poke done. now you respond

@Christopher well you see now I just have to wait for longer than you waited...

@Poke that won't work. Remember I "won" you can only get 2nd

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.

Nice first answer! Not to mention I just added another one :P

3. Brain-Flak
Contains no Z, ~, A, or horizontal tab. (Re-included })
({}<(())>){({}<(({})<>)<>({}{}<<>({}<>)>)>[()])}{}{}
# !"$%&'*+,-./0123456789:;=?@BCDEFGHIJKLMNOPQRSTUVWXY\^_`abcdefghijklmnopqrstuvwxyz|

Try it online!

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!

I don't like you anymore... I need 3 vowels. AND YOU TOOK EM

So I used a different language

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

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

I made CW since I just changed a bit of the code so I don't get unfair rep for others work.

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)

You mean you removed {;, not };.

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!

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!

@Poke done. I added it back

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!

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.

You forgot to add the uppercase letters to your code

looks like you've still got a backtick and a 1 and left out 345678BCDFGHJKLMNOPQRSTUVWXYZ

@KyleGullion The previous answer had no 1 or backtick in its character set though

I've made an edit suggestion to show what I mean.

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!

. is still missing in your comment.

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.

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

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. :)

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

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)))

@Emigna Right, sorry. Then I'll allow Q instead.

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!

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|~*/

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.

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.

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.

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

This answer doesn't work, it contains q

when did { get readded?

(you still use { according to the doesn't use list)

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.

Nevermind that, sent an edit

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!

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!

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.

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).

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|~ *)

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

Well played. I see what I can do.

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.

19. 05AB1E
Added }.  Removed Zz. Contains no {:`*%01AEIPQfrdZz, tab, space, newline.
Xs2<<sFUX+Xs}q!"#$&'()+,-./23456789;<=>?@BCDFGHJKLMNORSTUVWXY[\]^_abceghijklmnopqstuvwxy|~

Try it online!

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!

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!

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.

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!

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

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).

41. Alphuck, 366 bytes
Added ! and removed +..  Solution doesn't contain !^&'()+./1?@AEIMNPSTWZmntuwz{}|~\[] `, tab, or newline characters.
pisapiseppisapisopepiiiiiiiiiiipapiseeeeeepciiiiiiaisciiccpiaaeeeeeeeeeeccsaapicceaasceassscscaecpaaapisccpaaeccisapceaisapceaiscpceaaecisapceaiscccisaaapiscpiscpaaeaecccisaaapccceaaaiscceapciapaeeeeeeeeeecpiaipaeaasapepiceasaeaascccccsapiseeeeeeeepceeeeeeaisapcceaaisapcceaaisccsascpiaaeeeeeeeepceeeeeeaisscpjpiscsc!"#$%*-023456789:;<=>BCDFGHJKLOQRUVXY_bdfghklqrvxy

Try it online!

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.

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!

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


text:
Same code different characters
Note: This challenge only allows answers in compiled languages
Task
Your task is pretty simple, make two different programs that when compiled result in the same output.
Scoring
Here is where the fun comes in.  Your score will be the number of unique bytes present in exactly one program.  For example if your two programs (encoded in IBM Code page 437) are
☻☻Program A

and
☺Program B

The characters that are in exactly one program are
☻☺AB

Thus the score is 4.  Note that ☻ appears twice in the first program but is only counted once.
Your goal is to get the highest score, the highest score possible is 256.
Here is a scoring program that works for ASCII encoded programs.
Stipulations

Every byte in both programs should be able to be replaced with a different byte causing either the program to compile into a different result or fail to compile all together.  Removing any byte should do the same.
You may use any compilation flags as long as both programs are run with the same flags.
The resulting compilation should be static (i.e. should not vary from run to run), if results vary from machine to machine indicate the machine it is intended to run on.
The output of compilation should be byte for byte identical not "equivalent" or "similar enough".
The output of the compilation should be non-empty
Warnings/Errors need not be the same between compilations
If either the programs or the compilation include unprintable characters be sure to include a hexdump.  Although it is not technically required.

It's quite unclear, because one can declare a variable named abcdefghijqlmnop... to use 20+ unique characters. Is this allowed?

@Mr.Xcoder As long as it follows the first stipulation (so probably no).

This is a great Code-Bowling question!

Made an easy online scoring tool that won't require you to have to escape things / modify code to fit the python input strings in the TIO, just in-case that's an issue for anyone: http://jsfiddle.net/vybsgh4p/

Someone could probably create an answer in CoffeeScript

Perl, score 254 + 2 = 256
Here's a hex dump of one program:
00000000: 6c65 6e67 7468 2700 0102 0304 0506 0708  length'.........
00000010: 090a 0b0c 0d0e 0f10 1112 1314 1516 1718  ................
00000020: 191a 1b1c 1d1e 1f20 2123 2425 2628 292a  ....... !#$%&()*
00000030: 2b2c 2d2e 2f30 3132 3334 3536 3738 393a  +,-./0123456789:
00000040: 3b3c 3d3e 3f40 4142 4344 4546 4748 494a  ;<=>?@ABCDEFGHIJ
00000050: 4b4c 4d4e 4f50 5152 5354 5556 5758 595a  KLMNOPQRSTUVWXYZ
00000060: 5b5d 5e5f 6061 6263 6465 6667 6869 6a6b  []^_`abcdefghijk
00000070: 6c6d 6e6f 7071 7273 7475 7677 7879 7a7b  lmnopqrstuvwxyz{
00000080: 7c7d 7e7f 8081 8283 8485 8687 8889 8a8b  |}~.............
00000090: 8c8d 8e8f 9091 9293 9495 9697 9899 9a9b  ................
000000a0: 9c9d 9e9f a0a1 a2a3 a4a5 a6a7 a8a9 aaab  ................
000000b0: acad aeaf b0b1 b2b3 b4b5 b6b7 b8b9 babb  ................
000000c0: bcbd bebf c0c1 c2c3 c4c5 c6c7 c8c9 cacb  ................
000000d0: cccd cecf d0d1 d2d3 d4d5 d6d7 d8d9 dadb  ................
000000e0: dcdd dedf e0e1 e2e3 e4e5 e6e7 e8e9 eaeb  ................
000000f0: eced eeef f0f1 f2f3 f4f5 f6f7 f8f9 fafb  ................
00000100: fcfd feff 273d 3d32 3533 6f72 2078 2829  ....'==253or x()

and here's the other program:
"\\"

Perl isn't normally thought of a compiled language, but it is; it's first compiled to bytecode, and then the bytecode is executed. You can apply a filter on the bytecode (e.g. to dump it rather than running the program) using the -MO option. Both these programs compile into the following bytecode (disassembled using -MO=Terse):
LISTOP (0x564fcd99f020) leave [1]
    OP (0x564fcd99f148) enter
    COP (0x564fcd99f068) nextstate
    OP (0x564fcd99f100) null [5]

Explanation
Perl replaces all statements with no effect (such as string literals on their own) with a hardcoded "statement with no effect" statement in the resulting bytecode, so both programs compile to the same thing. In terms of character replacements, replacing most of the characters from program 1 with apostrophes will cause it to fail to compile (or replacing the apostrophes with 0). In program 2, replacing the any character with c will cause the program to fail to compile (as \c takes an argument).
As for character deletions, the first version of this answer predated the "radiation hardening rule" (that deleting any character must change the behaviour of the program). This updated, radiation-hardened version works via the use of a checksum; if deleting a character doesn't outright cause a syntax error, the code will compile into a call to the nonexistent function x. The Perl compiler doesn't optimize out the call in the case where it's made (and in general doesn't seem aware that the function doesn't exist), and thus the output is different. However, Perl's constant folder is capable of seeing that the un-mutated program is a single statement with no effect, and thus optimizes the whole thing down into a single statement like before.
I originally misread the question as counting only unique characters from one program, and tried to optimize for that. Clearly, program 2 needs to contain at least one character in order to generate the "statement with no effect" opcode, meaning that the best possible score in one program is 255. I haven't yet found a way to include a backslash in program 1 in such a way that the character immediately following it can't be replaced in such a way as to cause the program to break, but it wouldn't surprise me if it were possible (leading to a score of 255 + 1 = 256).

@WheatWizard: The challenge would be a bit less easy, but I think I could likely adapt this answer to work with such a stipulation via the usual checksumming trick (which Perl is capable of optimizing out). I'll delete this answer and undelete it once I have a new one.

@WheatWizard: And done. Turns out it wasn't too hard to update.

C, 231
Program A
i[]={'','','','','','','',','   ','
                                       ','
                                          ','','','','','','','','','','','','','','','','','','',' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~','','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�'};main(){}

Lots of unprintables above.  Here's the xxd hexdump:
00000000: 695b 5d3d 7b27 0127 2c27 0227 2c27 0327  i[]={'.','.','.'
00000010: 2c27 0427 2c27 0527 2c27 0627 2c27 0727  ,'.','.','.','.'
00000020: 2c27 0827 2c27 0927 2c27 0b27 2c27 0c27  ,'.','.','.','.'
00000030: 2c27 0e27 2c27 0f27 2c27 1027 2c27 1127  ,'.','.','.','.'
00000040: 2c27 1227 2c27 1327 2c27 1427 2c27 1527  ,'.','.','.','.'
00000050: 2c27 1627 2c27 1727 2c27 1827 2c27 1927  ,'.','.','.','.'
00000060: 2c27 1a27 2c27 1b27 2c27 1c27 2c27 1d27  ,'.','.','.','.'
00000070: 2c27 1e27 2c27 1f27 2c27 2027 2c27 2127  ,'.','.',' ','!'
00000080: 2c27 2227 2c27 2327 2c27 2427 2c27 2527  ,'"','#','$','%'
00000090: 2c27 2627 2c27 5c27 272c 2728 272c 2729  ,'&','\'','(',')
000000a0: 272c 272a 272c 272b 272c 272c 272c 272d  ','*','+',',','-
000000b0: 272c 272e 272c 272f 272c 2730 272c 2731  ','.','/','0','1
000000c0: 272c 2732 272c 2733 272c 2734 272c 2735  ','2','3','4','5
000000d0: 272c 2736 272c 2737 272c 2738 272c 2739  ','6','7','8','9
000000e0: 272c 273a 272c 273b 272c 273c 272c 273d  ',':',';','<','=
000000f0: 272c 273e 272c 273f 272c 2740 272c 2741  ','>','?','@','A
00000100: 272c 2742 272c 2743 272c 2744 272c 2745  ','B','C','D','E
00000110: 272c 2746 272c 2747 272c 2748 272c 2749  ','F','G','H','I
00000120: 272c 274a 272c 274b 272c 274c 272c 274d  ','J','K','L','M
00000130: 272c 274e 272c 274f 272c 2750 272c 2751  ','N','O','P','Q
00000140: 272c 2752 272c 2753 272c 2754 272c 2755  ','R','S','T','U
00000150: 272c 2756 272c 2757 272c 2758 272c 2759  ','V','W','X','Y
00000160: 272c 275a 272c 275b 272c 275c 5c27 2c27  ','Z','[','\\','
00000170: 5d27 2c27 5e27 2c27 5f27 2c27 6027 2c27  ]','^','_','`','
00000180: 6127 2c27 6227 2c27 6327 2c27 6427 2c27  a','b','c','d','
00000190: 6527 2c27 6627 2c27 6727 2c27 6827 2c27  e','f','g','h','
000001a0: 6927 2c27 6a27 2c27 6b27 2c27 6c27 2c27  i','j','k','l','
000001b0: 6d27 2c27 6e27 2c27 6f27 2c27 7027 2c27  m','n','o','p','
000001c0: 7127 2c27 7227 2c27 7327 2c27 7427 2c27  q','r','s','t','
000001d0: 7527 2c27 7627 2c27 7727 2c27 7827 2c27  u','v','w','x','
000001e0: 7927 2c27 7a27 2c27 7b27 2c27 7c27 2c27  y','z','{','|','
000001f0: 7d27 2c27 7e27 2c27 7f27 2c27 8027 2c27  }','~','.','.','
00000200: 8127 2c27 8227 2c27 8327 2c27 8427 2c27  .','.','.','.','
00000210: 8527 2c27 8627 2c27 8727 2c27 8827 2c27  .','.','.','.','
00000220: 8927 2c27 8a27 2c27 8b27 2c27 8c27 2c27  .','.','.','.','
00000230: 8d27 2c27 8e27 2c27 8f27 2c27 9027 2c27  .','.','.','.','
00000240: 9127 2c27 9227 2c27 9327 2c27 9427 2c27  .','.','.','.','
00000250: 9527 2c27 9627 2c27 9727 2c27 9827 2c27  .','.','.','.','
00000260: 9927 2c27 9a27 2c27 9b27 2c27 9c27 2c27  .','.','.','.','
00000270: 9d27 2c27 9e27 2c27 9f27 2c27 a027 2c27  .','.','.','.','
00000280: a127 2c27 a227 2c27 a327 2c27 a427 2c27  .','.','.','.','
00000290: a527 2c27 a627 2c27 a727 2c27 a827 2c27  .','.','.','.','
000002a0: a927 2c27 aa27 2c27 ab27 2c27 ac27 2c27  .','.','.','.','
000002b0: ad27 2c27 ae27 2c27 af27 2c27 b027 2c27  .','.','.','.','
000002c0: b127 2c27 b227 2c27 b327 2c27 b427 2c27  .','.','.','.','
000002d0: b527 2c27 b627 2c27 b727 2c27 b827 2c27  .','.','.','.','
000002e0: b927 2c27 ba27 2c27 bb27 2c27 bc27 2c27  .','.','.','.','
000002f0: bd27 2c27 be27 2c27 bf27 2c27 c027 2c27  .','.','.','.','
00000300: c127 2c27 c227 2c27 c327 2c27 c427 2c27  .','.','.','.','
00000310: c527 2c27 c627 2c27 c727 2c27 c827 2c27  .','.','.','.','
00000320: c927 2c27 ca27 2c27 cb27 2c27 cc27 2c27  .','.','.','.','
00000330: cd27 2c27 ce27 2c27 cf27 2c27 d027 2c27  .','.','.','.','
00000340: d127 2c27 d227 2c27 d327 2c27 d427 2c27  .','.','.','.','
00000350: d527 2c27 d627 2c27 d727 2c27 d827 2c27  .','.','.','.','
00000360: d927 2c27 da27 2c27 db27 2c27 dc27 2c27  .','.','.','.','
00000370: dd27 2c27 de27 2c27 df27 2c27 e027 2c27  .','.','.','.','
00000380: e127 2c27 e227 2c27 e327 2c27 e427 2c27  .','.','.','.','
00000390: e527 2c27 e627 2c27 e727 2c27 e827 2c27  .','.','.','.','
000003a0: e927 2c27 ea27 2c27 eb27 2c27 ec27 2c27  .','.','.','.','
000003b0: ed27 2c27 ee27 2c27 ef27 2c27 f027 2c27  .','.','.','.','
000003c0: f127 2c27 f227 2c27 f327 2c27 f427 2c27  .','.','.','.','
000003d0: f527 2c27 f627 2c27 f727 2c27 f827 2c27  .','.','.','.','
000003e0: f927 2c27 fa27 2c27 fb27 2c27 fc27 2c27  .','.','.','.','
000003f0: fd27 2c27 fe27 2c27 ff27 7d3b 6d61 696e  .','.','.'};main
00000400: 2829 7b7d 0a                             (){}.

Program B
i[]={1,2,3,4,5,6,7,010,011,013,014,016,017,020,021,022,023,024,025,026,027,030,031,032,033,034,035,036,037,040,041,042,043,044,045,046,047,050,051,052,053,054,055,056,057,060,061,062,063,064,065,066,067,070,071,072,073,074,075,076,077,0100,0101,0102,0103,0104,0105,0106,0107,0110,0111,0112,0113,0114,0115,0116,0117,0120,0121,0122,0123,0124,0125,0126,0127,0130,0131,0132,0133,0134,0135,0136,0137,0140,0141,0142,0143,0144,0145,0146,0147,0150,0151,0152,0153,0154,0155,0156,0157,0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0173,0174,0175,0176,0177,-0200,-0177,-0176,-0175,-0174,-0173,-0172,-0171,-0170,-0167,-0166,-0165,-0164,-0163,-0162,-0161,-0160,-0157,-0156,-0155,-0154,-0153,-0152,-0151,-0150,-0147,-0146,-0145,-0144,-0143,-0142,-0141,-0140,-0137,-0136,-0135,-0134,-0133,-0132,-0131,-0130,-0127,-0126,-0125,-0124,-0123,-0122,-0121,-0120,-0117,-0116,-0115,-0114,-0113,-0112,-0111,-0110,-0107,-0106,-0105,-0104,-0103,-0102,-0101,-0100,-077,-076,-075,-074,-073,-072,-071,-070,-067,-066,-065,-064,-063,-062,-061,-060,-057,-056,-055,-054,-053,-052,-051,-050,-047,-046,-045,-044,-043,-042,-041,-040,-037,-036,-035,-034,-033,-032,-031,-030,-027,-026,-025,-024,-023,-022,-021,-020,-017,-016,-015,-014,-013,-012,-011,-010,-7,-6,-5,-4,-3,-2,-1};main(){}

These compile to precisely the same object code.  GCC embeds the filename in the object code, so you'll need to give the files the same name (in different directories).
I was worried that the fact that there are no references to i might cause the compiler to optimize this variable out completely, but I think that making it a global guarantees that it will be present in the object.  This may be verified by inspection of the generated assembly:
    .file   "diffchar.c"
    .globl  i
    .data
    .align 32
    .type   i, @object
    .size   i, 1012
i:
    .long   1
    .long   2
    .long   3
    .long   4
    .long   5
    .long   6
    .long   7
    .long   8
    .long   9
    .long   11
    .long   12
    .long   14
    .long   15
    .long   16
    .long   17
    .long   18
    .long   19
    .long   20
    .long   21
    .long   22
    .long   23
    .long   24
    .long   25
    .long   26
    .long   27
    .long   28
    .long   29
    .long   30
    .long   31
    .long   32
    .long   33
    .long   34
    .long   35
    .long   36
    .long   37
    .long   38
    .long   39
    .long   40
    .long   41
    .long   42
    .long   43
    .long   44
    .long   45
    .long   46
    .long   47
    .long   48
    .long   49
    .long   50
    .long   51
    .long   52
    .long   53
    .long   54
    .long   55
    .long   56
    .long   57
    .long   58
    .long   59
    .long   60
    .long   61
    .long   62
    .long   63
    .long   64
    .long   65
    .long   66
    .long   67
    .long   68
    .long   69
    .long   70
    .long   71
    .long   72
    .long   73
    .long   74
    .long   75
    .long   76
    .long   77
    .long   78
    .long   79
    .long   80
    .long   81
    .long   82
    .long   83
    .long   84
    .long   85
    .long   86
    .long   87
    .long   88
    .long   89
    .long   90
    .long   91
    .long   92
    .long   93
    .long   94
    .long   95
    .long   96
    .long   97
    .long   98
    .long   99
    .long   100
    .long   101
    .long   102
    .long   103
    .long   104
    .long   105
    .long   106
    .long   107
    .long   108
    .long   109
    .long   110
    .long   111
    .long   112
    .long   113
    .long   114
    .long   115
    .long   116
    .long   117
    .long   118
    .long   119
    .long   120
    .long   121
    .long   122
    .long   123
    .long   124
    .long   125
    .long   126
    .long   127
    .long   -128
    .long   -127
    .long   -126
    .long   -125
    .long   -124
    .long   -123
    .long   -122
    .long   -121
    .long   -120
    .long   -119
    .long   -118
    .long   -117
    .long   -116
    .long   -115
    .long   -114
    .long   -113
    .long   -112
    .long   -111
    .long   -110
    .long   -109
    .long   -108
    .long   -107
    .long   -106
    .long   -105
    .long   -104
    .long   -103
    .long   -102
    .long   -101
    .long   -100
    .long   -99
    .long   -98
    .long   -97
    .long   -96
    .long   -95
    .long   -94
    .long   -93
    .long   -92
    .long   -91
    .long   -90
    .long   -89
    .long   -88
    .long   -87
    .long   -86
    .long   -85
    .long   -84
    .long   -83
    .long   -82
    .long   -81
    .long   -80
    .long   -79
    .long   -78
    .long   -77
    .long   -76
    .long   -75
    .long   -74
    .long   -73
    .long   -72
    .long   -71
    .long   -70
    .long   -69
    .long   -68
    .long   -67
    .long   -66
    .long   -65
    .long   -64
    .long   -63
    .long   -62
    .long   -61
    .long   -60
    .long   -59
    .long   -58
    .long   -57
    .long   -56
    .long   -55
    .long   -54
    .long   -53
    .long   -52
    .long   -51
    .long   -50
    .long   -49
    .long   -48
    .long   -47
    .long   -46
    .long   -45
    .long   -44
    .long   -43
    .long   -42
    .long   -41
    .long   -40
    .long   -39
    .long   -38
    .long   -37
    .long   -36
    .long   -35
    .long   -34
    .long   -33
    .long   -32
    .long   -31
    .long   -30
    .long   -29
    .long   -28
    .long   -27
    .long   -26
    .long   -25
    .long   -24
    .long   -23
    .long   -22
    .long   -21
    .long   -20
    .long   -19
    .long   -18
    .long   -17
    .long   -16
    .long   -15
    .long   -14
    .long   -13
    .long   -12
    .long   -11
    .long   -10
    .long   -9
    .long   -8
    .long   -7
    .long   -6
    .long   -5
    .long   -4
    .long   -3
    .long   -2
    .long   -1
    .text
    .globl  main
    .type   main, @function
main:
.LFB0:
    .cfi_startproc
    pushq   %rbp
    .cfi_def_cfa_offset 16
    .cfi_offset 6, -16
    movq    %rsp, %rbp
    .cfi_def_cfa_register 6
    movl    $0, %eax
    popq    %rbp
    .cfi_def_cfa 7, 8
    ret
    .cfi_endproc
.LFE0:
    .size   main, .-main
    .ident  "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609"
    .section    .note.GNU-stack,"",@progbits

Note that in program B, (most of) the char values are given in octal.  They could have also been given in decimal, but by using octal, we gain a couple of extra characters - 8 and 9 - in the difference set.
GCC doesn't seem to like CR, LF and (for obvious reasons) NUL characters inside of single quotes ''.
Try it online and score.

Is there any way to use a string literal instead if the cumbersome array format?  (I don't know very much about C)

@WheatWizard Yes, but then the variable needs to be explicitly declared as char instead of implicit int, to the detriment of the score.

More than 200! Nice job

For the octal constants which are also valid decimal with the same value, you need to remove the deleting zeroes, otherwise those can be deleted without breaking the program. You could also probably improve the score by using digraphs and/or trigraphs in one of the programs?

@ais523 Yes, good point about the octal/decimal ambiguous values - I've fixed those.  I'll explore {di,tri}graphs later...

Python, score 16 26 27 28
Unique Characters: -+;132547698<ACBEDFOXabopsx|
Calculate the score
Program 1:
def y():
 if 0: 0xBCAFD0|0XE|(0o4<<0O4)|48;

 return 0

In program 1, there are 5 spaces in the seemingly blank line.
Program 2:
def y():
 if 0:return--12365790+(0b1110000)
 pass
 return 0

Some help was found with the peephole optimiser source code.
Tested with this helper script: Try it online!

Python 3.6, 2 3 5 6
Program 1:
z=11_11;a=41_68;y=None;x=5_2_7_9;x*x

Program 2:
z=1111;a=4168;y=None;x=1111+4168;x*x

Python isn't normally compiled, but it does compile its source code into pyc files. Crucially, such compiling includes an optimization pass which changes "1111+4168" into 5279. The underscores serve two purposes: one of them is to add one to the score, and the other is the keep the length, which is stored in the pyc header the same. All of the variable assignments other than 'x' are to keep the co_consts in the right order. The x*x at the end serves to keep the co_stacksize the same.

I'm also using 3.6.0. Make sure that the files you compile from have the same mtime and filename, and add two spaces at the end of the first file.(I tested this using the built in compile function, which doesn't add the header. The mtime and filename concerns only apply to the header

The time the file was last modified. Python prepends its bytecode with an encoding of this time, so it can automattically refresh stale bytecode

Yes, using the os.utime function

Let us continue this discussion in chat.

oops  I had misinterpreted this as a code golf not a code bowling challenge

if 1+1 and 2 work, there's no reason 1+2+9+8 and 0+3+4+6+7 don't. If space is ok, tab, cr, lf should be ok too

@tsh not quite, because some fiddling with setting of other variables to get the co_consts and co_stacksize right are required

FASM, 254
00000000h: 64 62 20 27 01 02 03 04 05 06 07 08 0B 0C 0E 0F ; db '............
00000010h: 10 11 12 13 14 15 16 17 18 19 1B 1C 1D 1E 1F 21 ; ...............!
00000020h: 22 23 24 25 26 28 29 2A 2B 2D 2E 2F 3A 3B 3C 3D ; "#$%&()*+-./:;<=
00000030h: 3E 3F 40 41 43 45 46 47 48 49 4A 4B 4C 4D 4E 4F ; >?@ACEFGHIJKLMNO
00000040h: 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F ; PQRSTUVWXYZ[\]^_
00000050h: 60 61 63 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 ; `acefghijklmnopq
00000060h: 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 ;
00000070h: 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 ;
00000080h: 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 ;
00000090h: A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 ;
000000a0h: B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 ;
000000b0h: C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 ;
000000c0h: D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 ;
000000d0h: E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 27 ;
000000e0h: 0D 64 62 20 27 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB ;
000000f0h: FC FD FE FF 27                                  ;

DB  1,2,3,4,5,6,7,8,11,12,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,33,34,35,36,37,38,40,41,42,43,45,46,47,58,59,60,61,62,63,64,65,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251
DB  252,253,254,255

no 0x00 and 0x1A because fasm doesn't support the two symbols

Both use newline but one uses \n while another use \r

source: Stack Exchange

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

sort: votes


text:
Tetration: (Very) Hard Mode
This question is inspired by this one
Your task
Make a program or function that calculates the Tetration of 2 numbers. Tetration is what "comes next after addition, multiplication, and exponents".
For example, passing in 3 and 3, this is calculated:
3 ^ (3 ^ 3)

yielding this:
7625597484987

Simple, right?
WRONG.
Rules
The rules are taken from this question's inspiration.

Rules:

An integer is 64 bits, signed, two's complement. This is the only data type you may work with.
You may only use the following operations. Each of these counts as one operation.

n << k, n >> k: Left/right shift n by k bits. Sign bit is extended in right shift.
n >>> k: Right shift but do not extend sign bit. 0's are shifted in.
a & b, a | b, a ^ b: Bitwise AND, OR, XOR.
[removed], a - b [removed]: [removed], subtract [removed]
~b: Bitwise invert.
-b: Two's complement negation.
a / b, a % b: Divide (integer quotient, rounds towards 0), and modulo.

Comparison operators (<=, >=, >, <, etc.) are allowed but count as one operation.

   - Modulo of negative numbers uses the rules [specified in C99](http://stackoverflow.com/a/11720841/616460): `(a/b) * b + a%b`

shall equal a. So 5 % -3 is 2, and -5 % 3 is -2:
         - 5 / 3 is 1, 5 % 3 is 2, as 1 * 3 + 2 = 5.
         - -5 / 3 is -1, -5 % 3 is -2, as -1 * 3 + -2 = -5.
         - 5 / -3 is -1, 5 % -3 is 2, as -1 * -3 + 2 = 5.
         - -5 / -3 is 1, -5 % -3 is -2, as 1 * -3 + -2 = -5.
         - Note that Python's // floor division operator does not satisfy the "round towards 0" property of division here.
      - Assignments do not count as an operation. As in C, assignments evaluate to the value of the left-hand side after the assignment: a =
  (b = a + 5) sets b to a + 5, then sets a to b, and counts as
  one operation.
      - Compound assignments may be used a += b means a = a + b and count as one operation.
  - You may use integer constants, they do not count as anything.
  - Parentheses to specify order of operations are acceptable.
  - You may declare functions. Function declarations can be in any style that is convenient for you but note that 64 bit integers are the
  only valid data type. Function declarations do not count as operations, but a function call counts as one. Also, to be clear:
  Functions may contain multiple return statements and returns from
  any point are allowed. The return itself does not count as an
  operation.
  - You may declare variables at no cost.
  - You may use while loops, but you may not use if or for. Operators used in the while condition count towards your score.
  while loops execute as long as their condition evaluates to a
  non-zero value (a "truthy" 0 in languages that have this concept is not a valid outcome). Since early-return is allowed, you are allowed
  to use break as well
  - Overflow/underflow is allowed and no value clamping will be done. It is treated as if the operation actually happened correctly and was
  then truncated to 64 bits.
Scoring / Winning Criteria:

...

This is atomic-code-golf. Your score is the total number of
  operations present in your code (as defined above), not the total
  number of operations that are executed at run-time. The following
  code:
function example (a, b) {
    return a + ~b;
}

function ispowerofnegtwo (input) {
    y = example(input, 9);
    y = example(y, 42);
    y = example(y, 98);
    return y;
}

Contains 5 operations: two in the function, and three function calls.
It doesn't matter how you present your result, use whatever is
  convenient in your language, be it ultimately storing the result in a
  variable, returning it from a function, or whatever.
The winner is the post that is demonstrably correct (supply a casual
  or formal proof if necessary) and has the lowest score as described
  above.
Note: If you'd like to provide a solution in a language that only
  supports 32-bit integers, you may do so, provided that you
  sufficiently justify that it will still be correct for 64-bit integers
  in an explanation.
Also: Certain language-specific features may be permitted at no-cost
  if they do not evade the rules but are necessary to coerce your language into behaving according to the rules above. For example
  (contrived), I will permit a free not equals 0 comparison in while
  loops, when applied to the condition as a whole, as a workaround for a
  language that has "truthy" 0's. Clear attempts to take advantage of
  these types of things are not allowed -- e.g. the concept of "truthy"
  0 or "undefined" values does not exist in the above ruleset, and so
  they may not be relied on.

breaks are allowed, but they count as an operation.
Also, if your language has no concept of 64-bit ints, you may use any other form of number.
Note that you are not allowed to use multiplication, exponentiation, or addition.

what prevents just using a - -b?

what prevents using while(condition) { things; break; } as an if statement?

@Alt-F4 1: Allowed, just takes 2 operations. 2: Not allowed by the rules.

Oh, sorry, didn't see that.

What if the language has no concept of 64 bit integers? (e.g. all numbers are floats, or all integers are infinite precision)

@Alt-F4 "Also, if your language has no concept of 64-bit ints, you may use any other form of number."

I think you need to change the "you can't use the while like an if", or else the allowance for break. As far as I can tell, that bans break altogether (unless you allow multilevel break), as a break anywhere inside the body of a while loop, that's not conditionalised with an if statement or the like (all possible conditionalising statements are banned), will cause the while to be equivalent to an if. I'd recommend just allowing it but counting it as 1 opcode.

@ais523 Added in.

I think it would have been better to wait longer before posting this. The original challenge is only 3 hours old. I find challenges tend to feel less exciting when you've just solved a very similar one. Also, we've had way too many challenge to implement some arithmetic operation without using some more basic operation(s).

are loops operations?

@programmer5000 I agree with xnor. You should definitely wait a couple days before posting a challenge based on another one. Maybe even use the Sandbox first. It's already feeling like it's getting old, simply because this is 2 in one day.

@mbomb007 I did not even see the first challenge...

Are comparison operators allowed?

Will I ever recieve negative input?

@Alt-F4 yes and no.

@mbomb007 fixed.

Ruby, 13 operations
def tetr(a, b)
  def exp(a, b)
    def mult(a, b)
      c = 0; i = 0; while(i > -b) do c -= a; i -= 1; end
      return -c
    end
    c = 1; i = 0; while(i > -b) do c = mult(c, a); i -= 1; end
    return c
  end
  c = a; i = -1; while(i > -b) do c = exp(a, c); i -= 1; end
  return c
end

OP has stated that comparison is allowed.

There's an explicit list of operations that are allowed. A "repeat n times loop" isn't one of them; you'll need to maintain a loop counter explicitly.

@ais523 fixed...

Wise, 31 29
:::[:^|>::>^]|[:^?-!]^
::^? [::><^[-~!~-?]^>?->!]^
!:-~[:^&:]^?-&

When I saw this question I thought it would be the perfect question to answer in Wise.  The way Wise is set up it is impossible to make an answer that does not qualify for this challenge because all of Wise's operations are bitwise.

:, !, and ? are all stack operations which I am considering to be variable assignments so they do not count towards the score

[] constitute a while loop so they don't count towards the score.

^,|, and & are bitwise XOR, OR, and AND respectively

>,< are the bitshifts,

~ is bitwise negation and - is regular negation.

Explanation
First we want to take the absolute value of the number so that we can check if the number is a power of 2.
:[:^|>::>^]|

is a program I wrote a while ago to get the sign bit of a number.
[:^?-!]^
will negate the number if the top of the stack is -1, that is if our input was negative.
Now that we have a positive number we want to check if it is a power of 2.  to do this we take the sum of the digits (in base 2) and check if it is one.  To do that we set up a zero on the bottom of the stack:
::^?

and loop through adding the last digit and dividing by 2 (bit-shifting once)
[::><^[-~!~-?]^>?-!]^!

While we are doing this we divide a copy of our original input by -2 (->) each time we loop.  If the result -1 and the absolute value of the input was a power of 2 it is a power of -2.
Now we subtract one -~ and take the logical not of the digit sum.
[:^&:]^

We roll this result to the bottom with ? and finish up with a logical and with -&

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


text:
Do a BackFlip for ais523!
This challenge is a prize for ais523 for winning the "Rookie of the Year" category in "Best of PPCG 2016". Congratulations!

BackFlip is an esoteric programming language made by user ais523, who has created well over 30 other interesting esolangs.
BackFlip is a 2D language like Befunge or ><> where the instruction pointer traverses a grid of text (the program), moving up, down, left, and right, changing direction depending on the character it's on. Critically, the grid in a BackFlip program changes as it is being traversed, a bit like Langton's Ant.
For this challenge you may assume that a BackFlip program is always a rectangular grid of text (all lines the same length), 1×1 in size at minimum, only containing the characters ./\<>^V. (. is used for visibility rather than space.) Semantically the BackFlip we'll use here is identical to the original spec.
The instruction pointer (IP) in BackFlip always starts just left of the top-left corner of the program, heading right. There are three types of commands it can encounter:

. is a no-op. The IP continues on in the direction it was going. The no-op stays a no-op.
/ and \ are mirrors. They reflect the IP in the direction indicated by their angle, then they change into the other type of mirror.

For example, if the IP heads left into a \, it starts moving upward instead of left and the \ becomes a /.

<, >, ^, and V are arrows. They redirect the IP to the direction they point in, then they change into an arrow that points in the direction the IP came from (opposite the direction the IP was moving).

For example, if the IP heads downward into >, it starts moving right instead of downwards and the > becomes a ^ because that is the direction the IP came from.

A BackFlip program terminates when the IP moves out of bounds, i.e. goes off the grid. It turns out all BackFlip programs eventually end because infinite loops are impossible. (You may assume this is true.)
Your goal in this challenge is to write a program or function that takes in a BackFlip program and outputs the number of moves the instruction pointer takes before the program terminates. That is, how many steps does the IP take in the course of running a program? This includes the initial step onto the grid and the final step off of it.
For example, the instruction pointer takes 5 steps in the trivial grid ....:
 ....  <- empty 4×1 grid
012345 <- step number of the IP

So the output to .... is 5.
In the more complex 4×2 grid
\...
\.><

the IP exits the grid on its 9th step, so the output is 9:
step  grid  IP position (@)
0     \...  @....
      \.><   ....

1     \...   @...
      \.><   ....

2     /...   ....
      \.><   @...

3     /...   ....
      /.><   .@..

4     /...   ....
      /.><   ..@.

5     /...   ....
      /.<<   ...@

6     /...   ....
      /.<<   ..@.

7     /...   ....
      /.><   .@..

8     /...   ....
      /.><   @...

9     /...   ....
      \.><   ....
             @

The shortest code in bytes wins.
You may take input as an array of lines or matrix of characters instead of a multiline string if desired, but you must use the characters ./\<>^V (not integer opcodes). You may use space instead of . if preferred. It's fine if characters like \ need to be escaped in input. Output is always an integer more than one.
Test Cases
....
5

\...
\.><
9

.
2

..
3

.
.
2

\
2

^
2

.^.
3

<.
2

\\
\/
7

>V
^<
6

>\
>/
6

\><
2

\><
\><
7

\><
\><
\><
12

\.V.
\.\<
5

\.V.
\./<
9

V./\
V./\
>./<
..\/
14

\V..
.^..
\/><
.V..
.^..
20

\.V.V.
\./.\<
.>\<..
..^.^.
31

\.V.V.V.
\./>/.\<
.>\>\<..
..^.^.^.
69

\.V.V.V.V.
\./>/>/.\<
.>\>\>\<..
..^.^.^.^.
145

\.V.V.V.V.V.V.V.V.V.V.
\./>/>/>/>/>/>/>/>/.\<
.>\>\>\>\>\>\>\>\>\<..
..^.^.^.^.^.^.^.^.^.^.
9721

It's such a shame that you can't make a BackFlip solution to this...

Confused about the mirrors... does /  flips directions as left=>up and up=>left,?

@officialaimm Heading from the left into / will make the IP go up and heading up into / will make the IP go right, as if it is a ball bouncing off a wall. (But remember the / changes to backslash after the IP touches it.)

why '\''/' is 7 instead of 6?

@tsh Because the mirrors flip direction after each use, and also you count both entering and exiting the grid.

Looks like this is ais523's esolangs day

@ETH it changes to the direction the IP came from which is left.

Oh right, my bad. I guess I got that confused with the mirrors switching every time

JavaScript (ES6), 158 bytes
f=(a,x=0,y=0,d=3)=>a[x]&&(c=a[x][y])?(a[x][y]=c=='.'?c:c=='/'?(d^=3,'\\'):c=='\\'?(d^=1,'/'):'v>^<'[d][d='^<v>'.search(c),0],f(a,d<3?x+d-1:x,d?y+d-2:y,d)+1):1

Developed independently from @tsh's answer although strikingly similar.
The mapping of directions ^<v> to integers 0-3 is governed by the fact that .search('^') returns 0 since ^ is a regexp metacharacter.

I feel so soundly beaten. I was quite confused at the end there until I realized x and y were flipped compared to what I expected.

@ØrjanJohansen That's a good point; maybe I should swap x with y everywhere to make it easier to understand.

Haskell, 333 325 bytes
EDIT:

-8 bytes: Made f pointfree and merged into b.

b takes a list of Strings and returns an Integer.
data C a=C{c::a->(a,C a)}
b g=[0,0]#([0,1],map(maybe(C$m 1)C.(`lookup`zip"./^>V<"[n,m(-1),a[-1,0],a[0,1],a[1,0],a[0,-1]]))<$>g)
[y,x]#(d,g)|g&y||g!!0&x=1|n@([f,e],_)<-(($d).c)?x?y$g=1+[y+f,x+e]#n
l&i=i<0||i>=length l
(f?i)l|(p,a:r)<-splitAt i l=(p++).(:r)<$>f a
n d=(d,C n)
a v d=(v,C$a$(0-)<$>d)
m s[d,e]=([s*e,s*d],C$m(-s))

Try it online!
How it works

C a is a data type used because Haskell won't allow a type to be recursive without declaring it explicitly. C is also a wrapping constructor and c is its corresponding unwrapping function. It is only used with a=[Int].

The type C [Int] represents a cell command, as a function that takes a direction ([Int]) argument, and returns a pair of a new direction, and a new C [Int] value.

b is the main function. It converts each character into a C value, then it calls #.

g is the grid as a list of strings.
Since \  needs to be escaped and so is the longest character to mention, its result is instead used as the default value for the list lookup.

# runs the main simulation, checking bounds with & and generating new grids with ?. [y,x] is the current position, d the current direction, and g the current grid. [f,e] is the next direction, and n is a pair of it and the next grid.
l&i checks if the index i is out of bounds for the list l. (It returns True for out of bounds, since that avoids a dummy guard condition in #.)
When f(l!!i)==(d,x), (f?i)l==(d,m) where m is the list l with the ith element replaced with x.

Technically (?i) is a more general lens, focusing on the i'th element of a list, in this case used with the (,) [Int] functor instance.

n is the function representing a dot.
a v is a function representing an arrow in direction v.
m s is a function representing a mirror; s==1 for \\ and s==-1 for /.

Python 3, 286 bytes

[f() takes input in the form of {(0,0):'/',(0,1):'.'} so I have also written a function g() for converting an array of lines to that form]
def f(r):
 x=y=0;d='>';s=1
 while 1:
  try:c=r[y,x];m='>^<V'.find(d)
  except:break
  if(c=="\\"):d='V<^>'[m];r[y,x]="/"
  elif(c=="/"):d='^>V<'[m];r[y,x]="\\"
  elif(c!="."):r[y,x]='<V>^'[m];d=c
  x+=1if(d=='>')else-1if(d=='<')else 0;y+=1if(d=='V')else-1if(d=='^')else 0;s+=1
 return s

Try it online!

JavaScript, 172 bytes
f=(a,d=3,x=0,y=0,n=1)=>(p=a[y]||[],q=p[x])?(p[x]=~(t='^<V>'.indexOf(q))?'^<V>'[d^2]:q=='/'?(t=3-d,'\\'):q=='\\'?(t=d^1,'/'):(t=d,q),f(a,t,x+(t&1&&t-2),y+(~t&1&&t-1),n+1)):n

But i cannot test last testcase since i got stack overflow on my machine. (should work if there is a machine with larger ram)
We use a number for direction:

0: ^
1: <
2: V
3: >

Let d be the direction number...

if we meet a '/', we need d = 3 - d;
if we meet a '\' we need d = d ^ 1;
if we meet a '^<V>' we need d = '^<V>'.indexOf(note)

Let (x, y) be current position, the next position is: x+(t&1&&t-2), y+(~t&1&&t-1)
Note:
The function takes one paramter with the following format:
[ [ '\\', '.', 'V', '.', 'V', '.', 'V', '.', 'V', '.' ],
  [ '\\', '.', '/', '>', '/', '>', '/', '.', '\\', '<' ],
  [ '.', '>', '\\', '>', '\\', '>', '\\', '<', '.', '.' ],
  [ '.', '.', '^', '.', '^', '.', '^', '.', '^', '.' ] ]

Test it here

f=(a,d=3,x=0,y=0,n=1)=>(p=a[y]||[],q=p[x])?(p[x]=~(t='^<V>'.indexOf(q))?'^<V>'[d^2]:q=='/'?(t=3-d,'\\'):q=='\\'?(t=d^1,'/'):(t=d,q),f(a,t,x+(t&1&&t-2),y+(~t&1&&t-1),n+1)):n

    ;k=x=>x.split('\n').map(t=>t.split(''));
<textarea id=v>\.V.V.V.V.
\./>/>/.\<
.>\>\>\<..
..^.^.^.^.</textarea>
<button onclick="r.textContent=f(k(v.value))">Solve</button>

Result: <output id=r></output>

Just to document, I'm getting Uncaught RangeError: Maximum call stack size exceeded with 16GB RAM.

@ZebMcCorkle aha, just find out that "use strict" and some var declaration make it pass the last testcase (js interpreter do tail call optimize in strict mode)

C, 232 221 bytes
d,n,t,m[4]={1,-1};char*w="><^V/\\.",*P;main(o,v)char**v;{for(P=v[1],m[2]=-(m[3]=strchr(P,10)-P+1);P>=v[1]&&P<strchr(v[1],0)&&*P^10;++n)*P=w[((o=d,t=strchr(w,*P)-w)<4)?d=t,o^1:(t<6)?d^=t-2,9-t:6],P+=m[d];printf("%d",n+1);}

Takes input in first argument, prints result. Requires that input contains at least 1 newline (so if there's only 1 row, it must end with a newline)
Example usage:
./backflip '....
';

Breakdown:
d,                                          // Direction
n,                                          // Step counter
t,
m[4]={1,-1};                                // Movement offsets
char*w="><^V/\\.",                          // Command lookup
*P;                                         // Cursor location
main(o,v)char**v;{
    for(P=v[1],                             // Begin at 0,0
        m[2]=-(m[3]=strchr(P,10)-P+1);      // Find width of grid
        P>=v[1]&&P<strchr(v[1],0)&&*P^10;   // While inside grid:
        ++n)                                //  Increment step
        *P=w[                               //  Update the current cell
            ((o=d,t=strchr(w,*P)-w)         //  (store current direction & command)
              <4)?d=t,o^1:                  //   If <>^V, write backflip & set dir
            (t<6)?d^=t-2,9-t:               //   If / or \, write flip & bounce
            6],                             //   If ., write unchanged & continue
        P+=m[d];                            //  Move
    printf("%d",n+1);                       // Print result
}

206 bytes


text:
Count up by Syllables
Backstory
I've always found it quite annoying how some numbers in English don't have the same number of syllables even though they have the same number of digits. Example: seven has 2 syllables whereas all of the other digits have one (other than zero).
So, when I'm counting in time to something (like a drill cadence in cadets or in the military), it doesn't sound as nice because you have a random extra syllable.
But I appear to have found a solution to this!
Instead of counting the regular way, we omit the number eight. That way, the second syllable of seven carries into where eight would have been. So, we get the following:
1     2     3     4     5     6     7     8     9     10
one   two   three four  five  six   se   -  ven nine  ten

But, it's hard to count this way for higher numbers, so I need your help to make a program to help me figure out which numbers to count!
Challenge Details
Input
Input will be given as a single positive integer. For the purposes of this challenge, you may assume that all numbers are less than or equal to 999 999 999 999 999 (1 quadrillion - 1) This is because "quadrillion" has a different number of syllables than "million", "billion", and "trillion", and I needed to specify an upper bound somewhere. Since as @HelkaHomba pointed out most languages have a cap at 2^32 which is somewhere around 4 billion, you can use your language's integer bound as the limit (this must be at least 1 million to be considered valid).
Output
Output will be given as a list of integers (to be specified below). The exact formatting will not be specified, but as long as it is easy to see what the list is and it does not contain arbitrary numbers everywhere, it is pretty flexible.
What's in the list
Pretty much, starting from i = 1, append i to the list. Then, take the number of syllables in i (let this be s) and omit the next s - 1 numbers. Keep doing this until i > n where n is the input.
For the purposes of this challenge, assume that the word and is never present (so 101 is one hundred one).
Test Cases
Input -> Output
10 -> 1 2 3 4 5 6 7 9 10
7 -> 1 2 3 4 5 6 7
8 -> 1 2 3 4 5 6 7
25 -> 1 2 3 4 5 6 7 9 10 11 14 16 18 20 22 25

Additionally, since I need to be able to carry this around on a cue card when counting things in time, your program needs to be as short as possible (in bytes)!

Is the quadrillion limit required for language's whose usual integer maximum is 2^32 (~4 billion)?

@HelkaHomba Okay, so apparently 2^32 is a lot smaller than I thought it was. No, I will say that the limit is whatever your language can handle (must be at least 1 million) or 1 quadrillion - 1, whichever is higher. Thanks.

Mathematica, 117 bytes
For[t=1,t<=#,t+=Length[Join@@(#~WordData~"Hyphenation"&/@StringSplit[Echo@t~IntegerName~"Words",{"‐",", "," "}])]]&

Pure function taking a nonnegative integer as input; it echoes the appropriate integers to the standard output one at a time.
There might well be a shorter implementation in Mathematica, but this is the lazy one  :)  t~IntegerName~"Words" gives the English name of the integer t; then StringSplit[...,{"‐",", "," "}] divides this name into a list of individual words. (Mathematically annoyingly uses the 3-byte character ‐ (U+2010) for the hyphen in names of integers.) #~WordData~"Hyphenation"&/@ splits each of those words into a list of its syllables, and Length[Join@@(...)] counts these syllables.
Thus the function, after initializing t=1, loops as long as t doesn't exceed the input; each time, it prints t and then augments it by the number of syllables in the English name of t. In principle, this algorithm works up to 1036–1, at which point the hyphenation dictionary doesn't have an entry for "undecillion".

Nice answer! I was sort of expecting a Mathematica answer with some sort of syllable counting built in... :P

That's one thing I like about being on this site: it makes me discover things about Mathematica that I never knew before!

Certainly! I've learned a lot about various languages and I've never even used them before!


text:
Summing? That's my forte!
Introduction
Forte is a very peculiar esoteric language based on the concept of modifying the values of numbers. In Forte numbers are not constants but variables, you can use the LET instruction to assign new values to them.
For example, after executing LET 2=4-1 from now on 2 assumes the value of 3, which means that whenever the value 2 comes up in an expression it is instead "replaced" by 3. The expression (1+1)*2 would now evaluate to 9.
This instruction in Forte is used both for storing information and for flow control (lines are numbered and by changing the value of their numbers you can determine the order of their execution). In this challenge we will not deal with this second aspect.
The challenge
You are required to write an interpreter for a simplified subset of Forte's LET expressions.
You will receive as input a series of lines following this grammar:
<line>::= <number>=<expression>

<expression>::= <number>|<expression>+<number>

Note: this grammar is not valid Forte because it lacks line numbers, LET, and parentheses (which are always mandatory)
That is, you will only need to deal with computing summations and assigning values to numbers. Parentheses won't be present in the input, and each expression will need to be evaluated from left to right: beware that partial results are affected by redefinitions!
Numbers will always be non-negative integers, up to the limit of your language's native integer type (or 2^32, whichever is higher).
For each line you should output the result of the expression and assign this result to the (possibly reassigned) value of the first number, which will affect how the following lines will be interpreted.
This is code-golf, the shortest code (in bytes) wins!
Other rules

The input format is flexible, you can for example take a single string with newlines, a list of strings, a list of lists of numbers... The same goes for the output, as long as it's clear what's the result of each expression in the input.
You may submit either a function, a full program, or a solution to be run in a REPL environment calling it once for each line.
Standard loopholes are forbidden, in particular you can't call an external Forte interpreter in your code.

Examples
These are all part of the same input. After each line the expected output relative to that line is shown, sometimes with a comment indicating relevant reassignments (not part of the required output).
5=4
4
6=5
4        # 5 -> 4
7=1+2+5
7
7=5+2+1
4        # Order of operations matters! 5+2 -> 4+2 -> 6 -> 4
18=5+6+7
12
5=3
3        # Remember: 5 -> 4
10=6+4
3        # 6 -> 4 -> 3, 3+3 = 6 -> 3

Is 0 a valid number?

@orlp 0 is valid ("Numbers will always be non-negative integers")

Should we accept any arithmetic operators?

@bacchusbeale No, just summation.

Is there any particular maximum number, or is it as big as the language's native integer type is?
Also, it would be invalid output to return a list of numbers, one of which is the result, right? (such as printing the dictionary/map for which number goes to which number)

@zgrep the limit is as big as your language's native integer type, but at least 2^32 (to avoid loopholes for boolean-based languages). Your proposed output is invalid, you should return only the result for each line. I'll add these clarifications to the challenge.

Jelly, 28 bytes
®y$ÐL
ṪÇ+Ç¥/Ṅ;®⁸Ç¤;©
⁸©ḷƓÇ€¤

Try it online!
This is one of the few Jelly programs where it seems to be terser to take input from standard input. It's a full program (writing a function would have been shorter but is banned by PPCG rules, because it wouldn't run correctly the second time). The input format looks like this:
[[5,[4]],[6,[5]],[7,[1,2,5]],[7,[5,2,1]],[18,[5,6,7]],[5,[3]],[10,[6,4]]]

Explanation
Helper function 1Ŀ (translate an integer to its value)
®y$ÐL
   ÐL   Repeatedly, until there are no further changes,
  $       apply the following unary function to {the input}:
 y          replace values using the mapping table
®             stored in the register.
        {Then return the eventual result.}

Rather conveniently, this helper function will work correctly either on a single value, or a list of values, due to the way y is defined. If more than one mapping is given for a single value, we take the first mapping from the table. The mapping table is stored in the register (which is basically just a variable; Jelly only has one variable).
Helper function 2Ŀ (evaluate one LET instruction)
ṪÇ+Ç¥/Ṅ;®⁸Ç¤;©
Ṫ               On the last element of {the input},
 Ç              Run 1Ŀ,
     /          left fold it via
    ¥             the following binary function:
  +                 add {the two arguments}
   Ç                and run 1Ŀ on {the result},
      Ṅ         write {the result} (and a newline) to standard output,
       ;®       append the value of the register,
            ;   prepend
           ¤      the following value:
         ⁸          {the input, without its last element}
          Ç         with 1Ŀ run on it
             ©  and store that value in the register {and return it}.

We don't really want a return value here; we're just running this for its side effects (updating the register and outputting the assigned value). Jelly functions always return a value, though, so we just let the mapping table get returned, as that's tersest.
Main program
⁸©ḷƓÇ€¤
 ©       Initialize the mapping table
⁸        with the empty string (which is also the empty list)
  ḷ      then evaluate and discard
      ¤  the following value:
   Ɠ       a line from standard input, parsed into a data structure
    Ç€     with each element transformed via 2Ŀ
         {and leave the empty string to be printed implicitly}

Normally, ⁸ would give us the first command-line argument when run in this context, but there isn't one (we're taking input from standard input), so it runs in an alternative mode that gives us the null string. The need to initialise the register (from its default value of 0, which crashes y) means that we can't mention the user's input implicitly, meaning that it's as cheap to take it from standard input (Ɠ) as it would be to take it from a command line argument (³ or ⁸), and being able to access the alternative use of ⁸ means that the unusual (for Jelly) form of input is actually a byte shorter.
It's possible this is improvable. I still haven't figured out why the second line needs to say ⁸Ç¤; rather than just ;@Ç – the two should be equivalent, as far as I understand Jelly, given the lack of use of µ/ð/ø – but the latter crashes for some reason. Likewise, there are various other ways to rearrange the program without losing bytes, so it's possible that I've missed a way to make things a bit shorter.
Incidentally, changing the ḷ in the last line to ; gives you an interesting look into the internal workings of the program, as it'll then output the "history of the register" that's implicitly output by the return values of 2Ḷ.

Perl 5, 92 bytes
90 bytes of code + -pl flags.
sub f{($b=$h{$a=pop}//$a)!=$a?f($b):$a}s%(\d+)\+(\d+)%f($1)+f$2%e&&redo;/=/;$_=$h{f$`}=f$'

Try it online!
I use the hashtable %h to store the mapping between numbers.
The function (sub) f returns the number to which its input map (or its input if it's mapped to no number): $h{$a=pop} retrieves the number toward which the input maps. If it's none, thanks to //$a, the value of ($b=$h{$a=pop}//$a) is the input ($a). We make sure that this values isn't the input itself to not loop infinitely (!=$a). Then, we either recursively call f or return the input.
The main program consists of two steps:
  - s%(\d+)\+(\d+)%f($1)+f$2%e&&redo evaluates the first addition on the right side, while there is still an addition: it replaces x+y by the result of the evaluation of f(x)+f(y).
  - /=/;$_=$h{f$`}=f$' does the assignment: /=/ allows to access the left side with $` and the right side with $', then $h{f$`}=f$' does the assignment. And we also assign it to $_ that is implicitly printed after each line.

JavaScript (Node.js), 81 bytes
v=x=>(v[x]=v[x]||x,v[x]-x?v(v[x]):x)
f=x=>l=>v[v(x)]=l.reduce((p,x)=>v(v(x)+p),0)

Try it online!
Receives input by calling f with the value to assign to, then calling the
result of that with an array of values to add together. (i.e. f(5)([4]))
Repeat for multiple lines.
v is used as a function to compute the actual current value of a number, and also as an object to store the actual values. First v[x]=v[x]||x ensures that v[x] is defined. v[x]-x performs a comparison to determine whether this is the actual number or not. If the number does not map to itself, v(v[x]) recursively tries again, otherwise return x.
f performs the calculation and assignment, curried to save one byte, where the second call returns the computed value.

Haskell, 116 113 108 106 bytes
(#)=until=<<((==)=<<)
e?((n,s):r)|m<-foldl1(\a b->e#(e#a+e#b))s=m:(\x->last$m:[e#x|x/=e#n])?r
e?r=[]
(id?)

Try it online!
Each equation 4=3+1+5 is notated as tuple (4,[3,1,5]). The anonymous function (id?) takes a list of such tuples and returns a list of all intermediate results.
# is a function to find a fixpoint of a given function e and a start value x.
The function ? takes an evaluation function e and recursively solves each equation.foldl1(\a b->e#(e#a+e#b))s evaluates the right hand side of an equation and saves the result to m, e.g. for 4=3+1+5 it computes eval(eval(eval 3 + eval 1) + eval 5), where each eval is a fix point application of e. Then the eval function is modified to take the new assignment of n into account: (\x->last$m:[e#x|x/=e#n]) which is the same as \x -> if x == eval n then m else eval x.
The initial evaluation function is id which maps each integer to itself.

Thanks to Ørjan Johansen for a shorter fixpoint function, saving 2 bytes!

Nice job! By the way you are required to return all intermediate results, so you can drop last.

(#)e=until((==)=<<e)e or (#)=until=<<((==)=<<) is shorter.

@ØrjanJohansen Thanks alot!

Python 3, 146 132 130 bytes
14 bytes saved thanks to @Dada
2 bytes saved thanks to @mbomb007
d={}
g=lambda x:d.get(x)and x!=d[x]and g(d[x])or x
def f(t):
 for n,(s,*r)in t:
  for b in r:s=g(g(s)+g(b))
  d[g(n)]=s;yield g(n)

Try it online!
Receives input as tuples of equations [x = y + z + w as (x, (y, z, w))], outputs via generator.

Can you show an invocation example so it can be tested?

@Leo added TIO.

g could probably be written g=lambda x:d.get(x)and d[x]!=x and g(d[x])or x. And I think you can use 1 space to indent instead of 2. That should get you to [132 bytes](Try it online!).

@Dada thanks! too bad they don't have half-space indent :P

No half-space indent, but another neat trick is using a single tab instead of two spaces. As long as indentations are different, Python is happy (you could for example use space-tab and tab-space as indentations on additional nested levels). This can save you two bytes :)

And you can remove the space in *r) in, and use and x!=d[x]and for two more bytes saved.

@Leo The code currently requires Python 3, and Python 3 doesn't allow inconsistent indentation.

@mbomb007 Oh, you're right... That's strange, I could swear I had tried it an it worked, but now it doesn't...

oK, 48 bytes
a:[];s:{*(a@x;x)^0N}/;f:{a[s@x]:y:{s@x+y}/s'y;y}

Usage: f[5;1 2 3] / 5=1+2+3
Try it online!

If you don't mind having an upper limit to the numbers you can use, such as only using numbers 0 through 998, then the following suffices (41 bytes ± a few depending on the maximum):
a:!999;s:(a@)/;f:{a[s@x]:y:{s@x+y}/s'y;y}

Explanation:
; separates three definitions.
a is a dictionary/map of numbers. In the first case, it's an actual, empty dictionary [], in the second case it's a list of the numbers 0 to 998.
s is a function that finds the "resulting" number when given a number. The / on the end of the function means that it will apply itself to its own output until the output stops changing.
The last bit, f, means that:
f:{                      } /function called f, input number x, list y
                    s'y    /apply s to every number in the list
                   /       /fold through the list
            {s@x+y}        /    sum the two numbers, apply s
   a[s@x]:                 /set the s(x) to map to the final sum
          y:           ;y  /redefine y to be the final sum, then return it


text:
Plan your Sundays!
Who doesn't like to chill on a Sunday morning in summer with a chilled beer and TV or in winter playing badminton or ultimate with friends?
I always think knowing how many days you have to chill in a month keeps you well-informed and helps you plan what you want to do. Be it sitting in front of your pc and solving a code-golf problem or going out to play football.
So, help me write a program or function which takes as input 2 positive integers, Y and M and outputs the number of Sundays in that particular year(Y) and month(M) (according to the Gregorian Calendar), followed by the date of each Sunday.
Also, do keep in mind that the shortest code wins.
Input Constraints
1000 <= Y <= 9999
1 <= M <= 12
Output
These test cases will have output will have the dates of each Sunday of that month in that year in the format DD-MM-YYYY.
Sample Test Cases
Test Case 1
Sample Input
2017 1

Sample Output
5
01-01-2017
08-01-2017
15-01-2017
22-01-2017
29-01-2017

Test Case 2
Sample Input
2018 2

Sample Output
4
04-02-2018
11-02-2018
18-02-2018
25-02-2018

Test Case 3
Sample Input
2016 11

Sample Output
4
06-11-2016
13-11-2016
20-11-2016
27-11-2016

I recommend allowing any date format, including a Date() object, and any output format, including [4, [<dateobj>, <dateobj>, <dateobj>, <dateobj>]] (where <dateobj> is an actual date object, and [] is an actual array).

Wont that make it too easy?
The least number of bytes can probably be achieved in PHP, regardless of format.
I'm looking for the most clever solution in any other language (read: Python, Java, Scala, Perl, C++, JavaScript)

When the output format is the defining part of a challenge, community consensus is that it's boring. In future I recommend using the Sandbox, but as nobody's answered yet you could get away with changing it.

I'm new to making questions. Can you help me out here and change the question to make it better? @wizzwizz4

I'll make an edit. You can roll it back if you think it damages the challenge.

I doubt it'll damage the challenge. Thanks for the help. :)

So how flexible is the output format? For example, can it have / instead of -? Or can it be month, then day, then year?

Any particular locale? Note that prior to 1582, the Julian calendar was in common use, with countries transitioning to Gregorian as late as 1952 for Greece. In England they jumped the calendar ahead 11 days in the month of September, 1752, leading to mass riots. Recommendation is to use something called the "Proleptic Gregorian Calendar" which pretends the current calendar was in use for as far back as you need.

Read the question. I've clearly mentioned Gregorian Calendar. Even the range of years is given

Would you please answer my question (previous comment) about output format? In comments you seem to agree that the format is flexible, but the challenge doesn't clarify this

DD-MM-YYYY. Feel free to use ".", "-" or "/".

Thanks for answering. You should incorporate that into the challenge text. People are not expected to read the comments

MATL, 46 45 42 35 bytes
8BhtYOw47B~+YOq&:t8XO!s310=)tnw24XO

Input is an array of the form [2017 1]. Output format is 29/01/2017.
Try it online! Or verify all test cases.
Explanation
8B       % Push [1 0 0 0] (8 in binary)
h        % Implicit input. Concatenate. Gives something like [2017 1 1 0 0 0],
         % corresponding to the first day of input year and month
tYO      % Duplicate. Convert to serial date number
w        % Swap
47B~     % Push [0 1 0 0 0 0] (47 in binary, then negated)
+        % Add. Gives something like [2017 2 1 0 0 0]: first day of next month
YO       % Convert to serial number
q        % Subtract 1. This corresponds to last day of input month
&:       % Binary range. Gives an array with 28, 29, 30 or 31 days
t8XO     % Duplicate. Convert each number to three letters telling day of the week
!s       % Transpose, Sum of each column
310=     % True for values that equal 310, which is the sum of 'Sun' in ASCII
)        % Apply as a logical index
tnw      % Duplicate, number of elements, swap. This is the first part of output
24XO     % Convert to date format 'dd/mm/yyyy'. Gives 2D char array. Implicit display

Does this work with older dates (like year 1217)?

@titus Apparently yes https://tio.run/nexus/matl#@2/hlFES6V9uYu5Upx3pX6hmVWIR4a9YbGxoYKtZklduZBLh//9/tKGRobmCYSwA http://henry.pha.jhu.edu/calendarDir/julianDir/julianHTML/1217.html

Woops didn´t see the TiO.

JavaScript (ES6), 107 bytes

f=
(y,m,a=[...Array(32)].map((_,i)=>new Date(y,m-1,i)).filter(d=>d.getMonth()==m-1&!d.getDay()))=>[a.length,a]
<div oninput=o.textContent=[].concat(...f(y.value,m.value)).map((d,i)=>i?d.toDateString():d).join`\n`><input id=y type=number min=1000 max=9999 value=2017><input id=m type=number min=1 max=12>

Edit: Adding an explicit count cost 15 bytes. Formatting the output would cost at least another 33 bytes depending on how strict the output format is.

outputs the number of Sundays in that particular year and month; looks like this doesn't currently output the number of Sundays.

You could use <input type='date'>.

@SIGSEGV Not yet supported in Firefox, which is what I use.

@Neil Use Chrome m8

@SIGSEGV I like Chrome even less than Internet Explorer.

Python 2, 150,148,145 bytes
from calendar import*
y,m=map(int,input().split())
z=filter(None,zip(*monthcalendar(y,m))[6])
print len(z)
for i in z:print'%02d-%02d-%s'%(i,m,y)

Try it online!
-3 bytes making stuff more pythonic (using zip and filter!)

It'll be 150 if you bring the print statement up to the previous line and if you add '02' in the first %d in line 3.

'02' in the first %d ! huh. missed that. Thanks! anyways. saved two bytes though instead of increasing by two!

PowerShell, 91 bytes
param($y,$m)($a=(1..31|%{Date "$m/$_/$y"}|?{!$_.dayofweek})).count;$a|%{"{0:d-M-yyyy}"-f$_}

Try it online!
(Special note - this is locale and culture settings dependent. Since TIO is running as en-us, it works correctly there as-is. This code may need to be changed for different locales.)
Takes input as two integers $y and $m. Loops from 1 to 31, getting a new datetime object for each possible date (via the Get-Date cmdlet). Will toss errors to STDERR (ignored by default on code-golf challenges) for months with fewer than 31 days, but that doesn't affect output. We take each of those datetime objects and use a Where-Object (|?{...}) on them, with the clause of !$_.dayofweek. The property .dayofweek is a number from 0 to 6, with 0 conveniently corresponding to Sunday, so the ! of that is truthy, which saves a couple bytes compared to an equality check like -eq0.
The Sundays are then gathered in parens and stored into $a. We then take the .count thereof, and that's placed on the pipeline. Next, we loop through $a and use the -format operator to construct the correct output format. Note that this doesn't output leading zeros for days or months. Those date strings are also left on the pipeline, and an implicit Write-Output at program completion prints them with newline separators.

NB - if the output format was more flexible, we could just leave $a on the pipeline and not need to loop through it. That will stringify the datetime objects as the long-date format including time information, but gets us down to 69 bytes, which would (currently) only be beaten by Mathematica and MATL.

Octave, 72 bytes
@(y,m)cellfun(@disp,flip({datestr(x=nweekdate(1:6,1,y,m)(x>1)),nnz(x)}))

nweekdate returns the date number corresponding to the N-th occurrence of a particular weekday in the specified month/year. We use the array 1:6 in place of N to get all occurrences in a month. If there are fewer than N occurrences of that weekday in a month, then the resulting date number is 0. For this reason, we select only the valid dates using (x>1) and then convert them to strings using datestr.
Then to count the number of Sundays, we count the number of non-zero (nnz) date numbers in the result.
We then wrap the entire thing in cellfun to display each value.

Mathematica, 82 68 bytes
d=DateObject;{Length[x=DayRange[d@{#,#2,1},d@{#,#2+1,0},Sunday]],x}&

Anonymous function. Outputs a list of the number of days, followed by a list of the Sundays as DateObjects. Turns out, in Mathematica the 0th day of a month is interpreted as the last day of the previous month.

Ruby, 140 132 129 118 bytes
require'date'
d=Date.parse gets.split*?-+'-1'
s=(d...d>>1).select &:sunday?
puts s.size,s.map{|d|d.strftime'%d-%m-%Y'}

Excel – 103 characters
Put the year in cell A1, and month in cell A2.
The count is in cell D1, and Sundays in cells D2:D6.
Assumes D2:D6 are formatted DD-MM-YYYY.
   A      B       C              D
1  [year] [month] =DATE(A1,B1,1) =COUNTIF(D2:D7,">0")
2                                =C1+7-WEEKDAY(C1,2)
3                                =D2+7
4                                =D3+7
5                                =D4+7
6                                =IF(MONTH(D5+7)=MONTH(C1),D5+7,"")

C#, 183 bytes
y=>m=>{var s=new string[6];int i=1,n=0;for(DateTime d;i<=DateTime.DaysInMonth(y,m);)if((int)(d=new DateTime(y,m,i++)).DayOfWeek<1)s[++n]=d.ToString("dd-MM-yyyy");s[0]=n+"";return s;};

Anonymous method which returns an array of string, containing first the number of Sundays and then each Sunday in the specified format. If there are only 4 Sunday in a month, the last string is null.
Full program with ungolfed method and test cases:
using System;

class P
{
    static void Main()
    {
        Func<int, Func<int, string[]>> f =
        y=>m=>
        {
            var s=new string[6];
            int i=1,n=0;
            for(DateTime d;i<=DateTime.DaysInMonth(y,m);)
                if((int)(d=new DateTime(y,m,i++)).DayOfWeek<1)
                    s[++n]=d.ToString("dd-MM-yyyy");

            s[0]=n+"";
            return s;
        };

        // test cases:
        var result = f(2017)(1);
        foreach (var x in result)
            Console.WriteLine(x);

        result = f(2018)(2);
        foreach (var x in result)
            Console.WriteLine(x);

        result = f(2016)(11);
        foreach (var x in result)
            Console.WriteLine(x);
    }
}

REXX, 168 bytes
arg y m
signal on syntax
do d=1 to 31
  m=right(m,2,0);d=right(d,2,0)
  if date(w,y||m||d,s)='Sunday' then queue d'-'m'-'y
  end
syntax:n=queued()
say n
do n
  pull a
  say a
  end

I guess this does not work with smaller years. Have you tried 1217?

Bash + bsdmainutils, 94 bytes
a=(`for i in $(cal $2 $1|cut -b1-2);{ echo $i-$2-$1;}`);echo $[${#a[@]}-1];fmt -1 <<<${a[@]:1}

Uses the command cal which prints a calendar, is installed by default in several UNIX/LINUX/BSD (unfortunately not in TIO).
To try it save to file, chmod +x file, and run ./file 2017 9
Saves to array a the first two bytes of cal output appended with the string "MM-YYYY" passed as second and first parameters (needs change if your locale does not starts weeks on sundays).
Next echoes array length substracted by one (first element is the word representing sunday) and the array without the first elemet, one per line fmt -1

It handles special case 1752 9

SAS, 182 bytes
%macro s(y,m);%let c=%eval(%sysfunc(intck(week,%sysfunc(nwkdom(1,1,&m,&y)),%sysfunc(nwkdom(5,1,&m,&y))))+1);%put&c;%do i=1%to&c;%put%sysfunc(nwkdom(&i,1,&m,&y),ddmmyy10.);%end;%mend;

T-SQL, 316 311 bytes
DECLARE @ DATE=DATEADD(ww,-52*(2017-@y),'20170101')IF DATEPART(d,@)>7SET @=DATEADD(ww,-1,@);WITH c(d)AS(SELECT d FROM(SELECT DATEADD(ww,ROW_NUMBER()OVER(ORDER BY name)-1,@)d FROM sys.stats)a WHERE @y=DATEPART(yy,d)AND @m=DATEPART(m,d))SELECT CAST(COUNT(*)AS CHAR(1))FROM c UNION SELECT CAST(d AS CHAR(10))FROM c

I don't know if it is a valid answer though, since it outputs the number of sundays after the dates
Try it here
ungolfed:
DECLARE @m INT = 1,@y INT = 2017

DECLARE @ DATE=DATEADD(ww,-52*(2017-@y),'20170101')

IF DATEPART(d,@)>7
    SET @=DATEADD(ww,-1,@)

;WITH c(d)
AS
(SELECT d
 FROM (SELECT DATEADD(ww,ROW_NUMBER()OVER(ORDER BY name)-1,@)d
       FROM sys.stats) a
 WHERE @y = DATEPART(yy,d)
   AND @m = DATEPART(m,d)
)

SELECT CAST(COUNT(*) AS CHAR(1))
FROM c
UNION
SELECT CAST(d AS CHAR(10))
FROM c

PHP, 127 118 112 107 bytes
for([,$y,$m]=$argv;$d++<date(t,($t=strtotime)($y.-$m));)date(w,$t($s="
$d.$m.$y"))?:$r.=$s.!++$c;echo$c,$r;

takes input from command line arguments; run with -r or test it online.
breakdown
for([,$y,$m]=$argv;                     # import arguments to $y and $m
    $d++<date(t,strtotime($y.-$m))      # loop while ($d < number of days in that month)
    ;)
    date(w,strtotime($s="\n$d.$m.$y"))?:    # if date(w) is falsy (0 == sunday)
        $r.=$s.!++$c;                       # then append date to $r and increment $c
echo$c,$r;                              # print result

Excel VBA, 190 bytes
Function p(y, m)
d = CDate("1/" & m & "/" & y)
e = DateAdd("m", 1, d)
Do While d < e
    If Weekday(d) = 1 Then Debug.Print d: i = i + 1
    d = d + 1
Loop
Debug.Print i
End Function

Sample Output for p(2000, 1) (not sure if this qualifies)

02-01-2000
09-01-2000
16-01-2000
23-01-2000
30-01-2000
 5