Write A Program That Outputs Its Mirror Level
GolfScript, 10 bytes

!:{)::(}:!


Try it online with Web Golfscript: N = 0, N = 1, N = 2, N = 3, N = 41

Web GolfScript has a 1024 character limit, but the Ruby interpreter handles N = 32767 perfectly:

$ curl -Ss http://www.golfscript.com/golfscript/golfscript.rb &gt; golfscript.rb
$ echo '"!:{):"32768*":(}:!"32768*' | ruby golfscript.rb &gt; mirror-level-32767.gs
$ ruby golfscript.rb mirror-level-32767.gs
32768


How it works

Without any input, GolfScript initially has an empty string on the stack.

In the first left half, the following happens:


! applies logical NOT to the empty string. This pushes 1.
:{ saves the integer on the stack in the variable {.

Yes, that is a valid identifier, although there's no way to retrieve the stored value.
) increments the integer on the stack.
: is an incomplete instruction.


The the subsequent left halves, the following happens:


:! (where : is a leftover from before) saves the integer on the stack in the variable !.

Yes, that is also a valid identifier. This breaks the ! command, but we don't use it anymore.
:{, ) and : work as before.


In the first right half, the following happens:


:: (where : is a leftover from before) saves the integer on the stack in the variable :.

Yes, even that is valid identifier. As with {, there's no way to retrieve the stored value.
( decrements the integer on the stack, yielding the number of left halves.
}, since it is unmatched and terminates execution immediately.

This is an undocumented feature. I call them supercomments.


The remaining code is simply ignored.