Write a square program that outputs the number of times it has been "unrolled"
Golfscript, N &lt;- [5,7..]

.   .
 . . 
 ..  
.  .#
],9\-


Fully unrolled:

],9\-#  .   .  .  . . ...


Explanation:


. (multiple times) - duplicate the input
] - collect the stack into a single array
, - take its length
9\- - subtract it from 9
# - line comment


Whitespace is a NOP, but any other NOP would have worked just as well.

Fully rolled up, it uses nine copies of the input (contents ignored) as the stack; 9 - 9 = 0; it has not been unrolled.

Each unroll hides one more dot (duplicate) behind the comment, shrinking the stack once, incrementing the output.

Fully unrolled, it uses only the input (contents ignored) as the stack; 9 - 1 = 8; it has been unrolled 8 times.

The same approach works for any N > 4: Change 9 to the appropriate value of 2*N+1, then extend the pattern of dots (duplicate) using the same spiral pattern that ensures exactly one dot gets unrolled during each unroll.