[Question]
  [
Write a program fragment so that, when repeated N times it prints the Nth Fibonacci number. For example, if your program is `print(x)` then:
* `print(x)` should print `1`
* `print(x)print(x)` should print `1`
* `print(x)print(x)print(x)` should print `2`
* `print(x)print(x)print(x)print(x)` should print `3`
* `print(x)print(x)print(x)print(x)print(x)` should print `5`
* etc.
First 2 items are 1 then each consecutive item in the sequence is the sum of the previous two.
You may include a non-repeated header and footer, but a smaller header and footer will always beat an answer with a larger sum of header+footer. For example, a 1000 byte answer with no header wins from a 20 byte answer with a 1 byte footer. However, a 0 byte header 20 byte body will win from both.
With header length being equal, smallest number of bytes, in each language, wins.
### Tips
Output in unary  
Use shell escape codes like `\r` to erase the previous print.  
Use your languages implicit output feature
### Example Submission
> 
> # [Python](https://www.python.org), 0 header/footer, 97 body
> 
> 
> 
> ```
> if"k"not in globals():k=["","x"];print("x",end="")
> else:k.append(k[-1]+k[-2]);print(k[-3],end="")
> 
> ```
> 
> Output in unary
> 
> 
> [Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vwYKlpSVpuhY3EzPTlLKV8vJLFDLzFNJz8pMSc4o1NK2ybaOVlHSUKpRirQuKMvNKNIBMndS8FFslJU2u1JziVKtsvcSCAqCIRna0rmGsNpA0itWEKgZyjGNhyiEWQe2D2QsA)
> 
> 
> 
Comments are entirely valid, but solutions that don't use comments are extra impressive.
  
[Answer]
# [R](https://www.r-project.org/), 12 bytes, no header/footer
```
+(F=+T)->T;F
```
[Try it once online!](https://tio.run/##K/r/X1vDzVY7RFPXLsTa7f9/AA "R ‚Äì Try It Online")
[Try it twice](https://tio.run/##K/r/X1vDzVY7RFPXLsTaDZn9/z8A)
[Try it three times](https://tio.run/##K/r/X1vDzVY7RFPXLsTaDRf7/38A)
[Try it five times](https://tio.run/##K/r/X1vDzVY7RFPXLsTajVT2//8A)
[Try it \$n\$ times](https://tio.run/##K/qfV5obX5RakJpYUqxgo6tg@j@1LDFHoyCxqDhVo8S2uKQIKKmhpK3hZqsdoqlrF2LtpqSDpEdTU/P/fwA)
Right-hand assignment `->` is useful for suppressing output. Paging [Robin Ryder](https://codegolf.stackexchange.com/users/86301/robin-ryder) and his [various](https://codegolf.stackexchange.com/questions/191393/i-multiply-the-source-you-probably-multiply-the-output/191416#191416) [solutions](https://codegolf.stackexchange.com/questions/196864/i-shift-the-source-code-you-shift-the-input/196869#196869) involving `->`.
## Why this works
`F` and `T` are automatically assigned as variables for the constants `FALSE` and `TRUE`, and happily are coerced to `0` and `1` in arithmetic expressions.
The shortest R answer to the canonical [Fibonacci challenge](https://codegolf.stackexchange.com/questions/85/fibonacci-function-or-sequence/248102#248102) uses `F<-T+(T=F)` as the body of a loop, using the fact that assignment returns the assigned value (right-hand side for `<-` and `=`) **invisibly**, so the updates to the values happen in the right order (and are made visible by `show`). In that challenge, `F` holds the leading value \$F\_n\$ and `T` holds \$F\_{n-1}\$.
A few adjustments are required here:
1. `F` now holds the *trailing* value \$F\_{n}\$, and `T` is updated on each loop as `F+(F=T)->T` to be \$F\_{n+1}\$, on every iteration.
2. We use `F=+T` so that the first copy prints out `1` instead of `TRUE`.
3. Leading `+` and the infrequently-used right-hand assignment `->` operator to satisfy the concatenation requirement.
4. Trailing `;F` to use implicit output to print out the required value.
[Answer]
# [Piet](https://www.dangermouse.net/esoteric/piet.html) + [ascii-piet](https://github.com/dloscutoff/ascii-piet), 19 bytes (12√ó4=48 codels)
```
_TLDJdAaAQIbcr_cc _
```
[Try Piet online!](https://piet.bubbler.one/#eJxdzD0KgDAMBeC7vDkFI1pqr1IcRCsI_kF1Eu9uqoPVkCEfL8mBduk8rHNsiKuna3JZCp2C81TmH-lXOlXxWfy8Z8lKklsTUUbE6Fb1LtaE4FdYKKVAGIdJZs6kRD60sH0zBk8Y5nXfJMN5AR3WNAg)
[Try Piet online! (x6)](https://piet.bubbler.one/#eJyrVkrOT0lVsoqONrTQMbSEoFidaANkjhkyx9AImWeBLmWG4Jkh80xQFKIYbwiUM9UB6rUAcUxBHJAUmDfqqFFHjQhHWSIUxuooFacWKFkp6erqKuko5WTmAtmGBkAA5KUWJytZpSXmFKfqKGXmFZSWAOWUagEOzNYu)
![](https://piet.bubbler.one/api.svg?12,4,18,19,19,19,0,19,19,19,6,19,19,19,12,19,19,19,8,19,19,19,12,16,19,19,16,16,19,19,4,19,19,19,10,19,19,19,14,15,2,18,15,15,19,18,19,19,19,19)
```
A1      nop
B1-F1   1 1 ! roll       `1 0 roll`; an overall no-op if there were some values
                         on the stack, but leaves 1 0 if empty
                         (therefore pushes 1 0 on the first iteration only)
F1-K1   dup 3 1 roll +   apply Fibonacci to the top two values
                         [a b] -> [b a+b]
```
When the program is repeated, the grid is concatenated vertically, putting A1's white cell on L1 and so on. At K1, two things can happen:
* If there are more repetitions below, the IP keeps going down, running more iterations of Fibonacci.
* Otherwise, it heads east, prints the top value as integer (J2-J3) and halts (J4-K4).
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 4 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md) (no header/footer)
```
∆Å+1|
```
[Try it online!](https://Not-Thonnu.github.io/run#aGVhZGVyPSZjb2RlPSVDNiU4MSUyQjElN0MmZm9vdGVyPSZpbnB1dD0mZmxhZ3M9)   
[2x](https://Not-Thonnu.github.io/run#aGVhZGVyPSZjb2RlPSVDNiU4MSUyQjElN0MlQzYlODElMkIxJTdDJmZvb3Rlcj0maW5wdXQ9JmZsYWdzPQ==)   
[3x](https://Not-Thonnu.github.io/run#aGVhZGVyPSZjb2RlPSVDNiU4MSUyQjElN0MlQzYlODElMkIxJTdDJUM2JTgxJTJCMSU3QyZmb290ZXI9JmlucHV0PSZmbGFncz0=)   
#### Explanation
```
∆Å+    # Without popping, add top two values
  1|  # Replace a 0 with a 1
      # Implicit output
```
[Answer]
# [Python](https://www.python.org), 34 bytes
```
a='x';b=''
print(end=a);a,b=b,a+b#
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vwdJkW3V19aWlJWm6FjeVEm3VK9Stk4BCXAVFmXklGql5KbaJmtaJOkm2STqJ2knKUJUGQE3Rhla6hrFcaflFClkKmXkKRYl56akahjqGBppWqRWpyRpZWsma1hBzNCH6FiyA0AA)
Outputs in unary.
### How?
Streamlined version of OP's example code
[Answer]
# T-SQL ~~171~~ ~~160~~ 159 bytes (no header or footer)
*-1 byte thanks to @MickyT*
```
/*
WHERE 1=0--*//*
--*/Select 0 x,1 y into T;EXEC('create trigger X on T for delete as if @@rowcount>0select x from DELETED')
UPDATE T SET x=y,y=x+y;DELETE T--
```
[Try it online (use MS SQL)](https://sqliteonline.com/)
The trick is using comments to have the initial select and trigger creation on only the first repeat, and the `WHERE` clause preventing the deletion of the fibbonacci record on all except the final repeat. Selecting from `DELETED` then outputs it.
[Answer]
# [Itr](https://github.com/bsoelch/OneChar.js/blob/main/ItrLang.md), ~~5~~ 4 bytes (no header or footer)
`√¢+1w`
[online interpreter](https://bsoelch.github.io/OneChar.js/?lang=Itr&src=4isxdw)
[2x](https://bsoelch.github.io/OneChar.js/?lang=Itr&src=4isxd-IrMXc=)
[3x](https://bsoelch.github.io/OneChar.js/?lang=Itr&src=4isxd-IrMXfiKzF3)
[Nx](https://bsoelch.github.io/OneChar.js/?lang=Itr&src=RrviKzF3qw==&in=NQ==)
(uses `F` operator to repeat sequence input number of times)
## Explanation
```
√¢+1w ; implicitly start with 0,0 on stack
√¢    ; push top value below second value a,b -> b,a,b
 +   ; add top two values -> b,a+b
  1w ; maximum of 1 and top stack value
     ; implicit output
```
[Answer]
# [Cascade](https://github.com/GuyJoKing/Cascade), 6 bytes
```
#|
\?
```
[Try it online!](https://tio.run/##S04sTk5MSf3/X7mGK8ae6/9/AA "Cascade ‚Äì Try It Online") (prints `0`)
[Try it online!Try it online!Try it online!](https://tio.run/##S04sTk5MSf3/X7mGK8aeC5n8/x8A "Cascade ‚Äì Try It Online") (prints `00`)
[Try it online!Try it online!Try it online!Try it online!Try it online!Try it online!](https://tio.run/##S04sTk5MSf3/X7mGK8aeCz/5/z8A "Cascade ‚Äì Try It Online") (prints `00000000`)
Outputs in unary with zeros. Uses the fact that \$f\_n = 1 + \sum\_{i=0}^{n-2} f\_{i}\$.
```
#|   Start evaluating at the first `#`; prints 0 once (acting as 1+)
\?   `\` Move to the second column; skip evaluating f(n-1)
#|   `|` Pass through
\?   `?` Evaluate both columns; the left column evaluates f(n-2) (by induction)
#|   and the right passes through, eventually evaluating all branches
...  down to f(1)
```
---
# [Cascade](https://github.com/GuyJoKing/Cascade), 10 bytes
```
#1
\+/
\||
```
[Try it online!](https://tio.run/##S04sTk5MSf3/X9mQK0Zbnyumpub/fwA "Cascade ‚Äì Try It Online") (outputs 1)
[Try it online!Try it online!Try it online!](https://tio.run/##S04sTk5MSf3/X9mQK0ZbnyumpgYb6/9/AA "Cascade ‚Äì Try It Online") (outputs f3 = 2)
[Try it online!Try it online!Try it online!Try it online!Try it online!Try it online!](https://tio.run/##S04sTk5MSf3/X9mQK0ZbnyumpoZ01v//AA "Cascade ‚Äì Try It Online") (outputs f6 = 8)
After repeating, the code looks like this:
```
#1
\+/
\||#1
\+/
\||#1
\+/
\||#1
\+/
\||
```
The 3 columns on the left are relevant. Read the explanation from bottom to top:
```
#      Print the value as number
\
 |     Ignore one iteration and fetch fn
 +/    Iterate n-1 times (when n is the number of repetition):
\||      (a, b) = (a+b, a)
 10    Initialize to a = 1 (column 2) and b = 0 (column 3)
```
# [Cascade](https://github.com/GuyJoKing/Cascade), 3 bytes footer, 3 bytes body
body:
```
\?
```
footer:
```
 #
```
[Try it online!](https://tio.run/##S04sTk5MSf3/P8aeS0GZ6/9/AA "Cascade ‚Äì Try It Online") (outputs `0`)
[Try it oTry it oTry it online!](https://tio.run/##S04sTk5MSf3/P8aeC4IUlLn@/wcA "Cascade ‚Äì Try It Online") (outputs f3 = 2 = `00`)
[Try it oTry it oTry it oTry it oTry it oTry it online!](https://tio.run/##S04sTk5MSf3/P8aeCw0pKHP9/w8A "Cascade ‚Äì Try It Online") (outputs f6 = 8 = `00000000`)
Outputs in unary with zeros. `?` evaluates the center (of the next row), and then evaluates the left (of the next row) because the center always evaluates to 0. This certainly achieves better encoding of fibonacci loop, ~~but I couldn't figure out how to include "print 0" in the loop~~.
[Answer]
# [Piet](https://www.dangermouse.net/esoteric/piet.html) + [ascii-piet](https://github.com/dloscutoff/ascii-piet), 53 bytes (15√ó7=105 codels), no header/footer
```
ttlddtN ub?fnNssSkKCVrTtTLcfkdtlElt?l??T   lL sdD S??
```
Program as picture:
![](https://piet.bubbler.one/api.svg?15,7,0,0,6,12,12,0,7,19,5,14,18,13,7,7,3,3,3,19,19,19,19,9,9,19,19,19,19,19,15,19,19,19,19,19,19,1,19,19,19,19,19,19,2,0,19,19,19,19,19,0,0,19,19,19,19,19,6,19,19,19,19,19,19,15,13,9,12,0,6,17,6,0,18,6,18,18,0,19,19,19,6,6,19,19,19,3,12,12,19,19,19,19,3,19,19,19,19,19,18,18,19,19,19,19,19)
Output in unary.
[Try Piet online!](https://piet.bubbler.one/#eJxtj8EOgjAQRP9lz9NkV6TQ_grhYLAmJKgk6Mnw725bjIi0e2jfbqczL-ru50C-aRgMCznEYlQtGnEoIUdIDSlQJVYgbu18SpmDW5MMpdywBe_S-OMf5D1o91XL6NBl6zpSpUmOzm2yX4NzoFwW9vvWxUAp9lrR_cZcaJLa4BY0hZE8GWMINPRXPQvr0luYOvKX0zAFUH8bnw_t0fwG5WBSOQ)
[Try Piet online! x2](https://piet.bubbler.one/#eJztkEEOwiAQRe8y608C1tLCVUgXpmLSpGoTdGW8uwOtaa1tl66En8DwYIb5D6qvR0_WOQkJDbWLkiigDKuC4zWH2kOVUBmfjyRDnCmaionB_HBMly-SAW6w-KsVJNeR3qqWx45M3zBfLCavZOxXp6bLd_bejF4aep7NRDOSfd-VzJJRAxtKfLj_9_1Hvi_CChR8R5aEEARqmzPvleTBkQ812dOhDR7UXLr7jRk9X2YrsRI)
[Try Piet online! x3](https://piet.bubbler.one/#eJztkEEOgyAQRe8y608CtaJwFeOisTQxsa0J7arx7h3URmvRAzTCT2B4MMP8F1X3syNbFBISGuoQJJFBGVaJgtcU6giVQyV8PpEEYfbRXEwMlodTujRKRrjBwq9WkFxHeqtaGjoyQ8N8MZu9kqFf3Tedf7IPZgzS0MtsJpjR2_dbycSMGtlY4sv93ffd97_2PQpLkHctWRJCEKipr7xXkgdHzldkL6fGO1B9a58PZtS9AXzV_lc)
[Try Piet online! x5](https://piet.bubbler.one/#eJztkFEOgjAMhu_S559kExmMqxAeDM6EBJUEfTLc3W7MgDg4gBk0Gd23tfR7UXM_GyqrSkBAQR5sCOSQmqNGxWsGeYQsIFPen0kK-7psGUw01ptzuSxIPNxh9q82kNhGaq9bZifS08B8MF_cEnZe5YYuPtUnGVMoqHU1bWU4fb-ddEiUZ77Fl_3oPXqP3qP36P1PvAdhDRpMTyUlSUKgrr3ytxT8cGaGhsrLqRsMqL31zwczGt82LJjw)
[Try Piet online! x10](https://piet.bubbler.one/#eJztkFEOgjAMhu_S559kExmMqxAeDM6EBJUEfTLe3Q5mwAmcoNBkdN_W0u9Fzf3sqKwqBQUDffChkENbjhoVrxn0EbqATnl_Jin8O2bLYGIRb87lslUS4A7zf7WB1DYye90yP5GdBuaD-eKW8vOacejiW32SMYWBiatZL2PU99_JrokKLLT4sS_exbt4F-_iXbyLd_Eu3sW7eBfv4j3yvgpr0OB6KilJEgJ17ZW_teKHMzc0VF5O3eBA7a1_PpjR-wOLYBtn)
This is so bad but my brain is completely fried rn, this will do for now. Definitely can be golfed though ~~(watch @Bubbler get some insane 30 byte answer lmao).~~ Bruh ain't no way, Bubbler just post some insane [19 bytes answer](https://codegolf.stackexchange.com/a/264538/96039). Just move on and go upvote Bubbler's answer lmao.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 84 bytes (no header/footer)
```
t
#ifndef A
,b;main(a){
#define At
#define A printf("%d",a);}
#endif
t=a;a=a+b;b=t;A
```
[Try it online!](https://tio.run/##Rcg7CoAwDADQPacoLUKL9QShQ4@S/iSDQSSbePbq5vZ4ddtrnVPB8ZDWh8kQCx7E4inc4L5i6SbrT3NeLDq8XZqNFPAB16XxAE2ElGgtWJJinvMF "C (gcc) ‚Äì Try It Online")
This really shows the power of the preprocessor üí™
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 4 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) (no header/footer)
```
¬º¬æ√Öf
```
[Try it online](https://tio.run/##yy9OTMpM/f//0J5D@w63pv3/DwA) or [verify the first ten iterations](https://tio.run/##ASsA1P9vc2FiaWX/VEUi/8K8wr7DhWb/IsK2S07Dl0Q/IiDihpIgIj8uViwuwrX/).
**Explanation:**
```
¬º     # Increase counter variable `¬æ` by 1 (which is 0 by default)
 ¬æ    # Push counter variable `¬æ`
  √Öf  # Pop and push the 0-based ¬æ'th Fibonacci value
      # (after which the top of the stack is output implicitly as result)
```
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), 16 bytes
```
(()[[]]({})<>{})
```
[Try it online!](https://tio.run/##SypKzMzTTctJzP7/X0NDMzo6NlajulbTxg5I/P8PAA "Brain-Flak ‚Äì Try It Online")
```
(                       # Push...
 ()                     #   One
   [[]]                 #   Minus the current stack height
       ({})             #   Plus peek the value on top of the stack
           <>           #   Move to the other stack
             {}         #   Plus pop the value on top of the stack
               )        #
```
The `(()[[]]({})` trick is a convenient way to initialize the first stack to a '1' if it's empty, and leave it unmodified if it's non-empty. Also it's not everyday that a brain-flak solution has an odd number of `<>`s!
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~26~~ 21 bytes
```
[a=$.+$.=a||1];p *[a]
```
[Try it online!](https://tio.run/##KypNqvxfUJSfbqukpPQ/OtFWRU9bRc82sabGMNa6QEErOjH2P1BGr7ikKLOAy9BAryQzN7W4uqaihksl0VYRqNSAK7UsMUcBZIZWBVftfwA "Ruby ‚Äì Try It Online")
Thanks Value Ink, Jo King and Sisyphus for the improvements.
### In short
When it's repeated, it will just increase the number and print nothing:
```
[a=$.+$.=a||1] # -> initializes a with 1
#N times:
p *[a][a=$.+$.=a||1] # -> update a then print the non-existing a-th element of [a]
p *[a] # -> print all elements of [a]
```
I didn't know that the splat operator could be used like this.
[Answer]
# [Uiua](https://www.uiua.org/), ~~89~~ ~~36~~ ~~25~~ 19 bytes, no header/footer/`tag`
```
:try(+,e)(1 0;)
e=
```
[Try it online!](https://www.uiua.org/pad?src=4oi24o2jKCssZSkoMSAwOykKZSDihpA=)
[Try it online!Try it online!](https://www.uiua.org/pad?src=4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpA=)
[Try it online!Try it online!Try it online!](https://www.uiua.org/pad?src=4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpA=)
[Try it online!Try it online!Try it online!Try it online!Try it online!Try it online!](https://www.uiua.org/pad?src=4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpAK4oi24o2jKCssZSkoMSAwOykKZSDihpA=)
The programs look a bit different in the links thanks to the auto-formatter; if you paste the program in as given it turns into that then works. Note the trailing newline.
Although `tag` is the only non-random way to make an expression stateful, this exploits the ability to repeatedly shadow built-in constant `e`, as well as to catch empty-stack errors with `‚ç£ try`.
For the first copy, the stack is empty, so:
```
 try(   )          Try:
       e           Push Euler's constant,
      ,            then push the nonexistent stack element under it.
 try     (    )    That errors, so
             ;     discard the error message
          1 0      and push 0 and 1.
:                  Swap to 1 and 0.
e=                 Pop the 0 to redefine e as 0.
                   The stack now contains only 1
```
which prints `1` as the only value on the stack if no further copies are appended.
For the second copy, the stack is non-empty, so:
```
 try(   )          Try:
       e           Push e (now 0),
      ,            then push the value under it (1),
     +             and add them.
 try     (    )    That doesn't error, so nothing weird happens to it.
:                  Swap, so the old result (1) is on top
                   and the sum (also 1) is on the bottom.
e=                 Pop the old result to re-redefine e as 1.
                   The stack now contains only 1
```
then
```
 try(   )          Try:
       e           Push e (now 1),
      ,            then push the value under it (1),
     +             and add them.
 try     (    )    That doesn't error, so nothing weird happens to it.
:                  Swap, so the old result (2) is on top
                   and the sum (1) is on the bottom.
e=                 Pop the old result to re-redefine e as 1.
                   The stack now contains only 2
```
and so on.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), no headers, no footers, just 3 bytes
```
!‚àÜf
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyIiLCIiLCIh4oiGZiIsIiIsIiJd)
[or a test suite of the first 1 to 9 repetitions](https://vyxal.pythonanywhere.com/?v=2#WyJEIiwiYCIsIiHiiIZmIiwiYFxcXG4tXG4xIDEwIHIqxJYiLCIiXQ==)
Hello to everyone who ports this in another stack language or independently discovers it. :p
## Explained
```
!‚àÜf
!   # Push the length of the stack
 ‚àÜf # Push the lengthth fibonacci number, starting from f(0) = 1
```
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata), 4 bytes (no header/footer)
```
À£+1I
```
* [Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHHBgqWlJWm6FktPL9Y29FxSnJRcDBWByQAA)
* [Attempt This Online!√ó2](https://ato.pxeger.com/run?1=m70iLzU7PzexJHHBgqWlJWm6FqtOL9Y29AQTS4qTkouhwjBpAA)
* [Attempt This Online!√ó3](https://ato.pxeger.com/run?1=m70iLzU7PzexJHHBgqWlJWm6FutPL9Y29EQQS4qTkouhcjA1AA)
* [Attempt This Online!√ó4](https://ato.pxeger.com/run?1=m70iLzU7PzexJHHBgqWlJWm6FltOL9Y29EQjlhQnJRdDFcAUAgA)
A port of [@The Thonnu's Thunno 2 answer](https://codegolf.stackexchange.com/a/264509/9288).
```
À£+1I
À£+      Add without popping; fails if length of stack is less than 2
  1I    Replace failure with 1
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 38 bytes, 0 Header/Footer
Creates a anonymous function
```
(a=>a?b=>b?f=c=>c?c(f)(a):a()+b():1:1)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=jdE9CgIxFARgbPcg8h5iMP6uK0musknMihA3shstvIpNQD2UHsMTKAQ7i1dNMV81c723YevSrRf14xSbcfkcghZSKyOkUY2wQlploUHQWGnAkQGseMUx69fgXbPY7Q-Am6Kwoe2Dd8yHHcBFuLP20CMCfsu_Hevc0ekIU6SoGUnNSWpBUkuSWpFUSVJrkuITGuM0Rpuf__bP16eU8wM)
Lambda Calculus go brr
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~29~~ 23 bytes
Dug around for a bit until I found this magical function called `at_exit`/`END` that could be used to ensure the number is printed once at the end. `$.` is 0 by default, which saves some bytes.
Someone else can port the Unary solution if they want to.
*-6 bytes from dingledooper.*
```
a=1;END{p$.}
$.=a+a=$.#
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboW2xNtDa1d_VyqC1T0arlU9GwTtRNtVfSUIbJQRTDFAA) [x3](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN10TbQ2tXf1cqgtU9Gq5VPRsE7UTbVX0lEkThhgGNRNmNgA) [x5](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN4sTbQ2tXf1cqgtU9Gq5VPRsE7UTbVX0lGkpDLEa6gKYSwA)
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 41 bytes, not unary solution
```
for i in(1,a:=0):
 i,a=i+a,i or+print(a)#
```
[Try it online!](https://tio.run/##K6gsycjPM7YoKPqfnJ@SqmCroKSk9D8tv0ghUyEzT8NQJ9HK1kDTikshUyfRNlM7USdTIb9Iu6AoM69EI1FT@T9QdbShla5hLBdXakVqsgbYEC0Fc83/AA "Python 3.8 (pre-release) ‚Äì Try It Online")
[Answer]
# [vim](https://github.com/DJMcMayhem/V), 10 bytes
```
0py$"_cla
```
Note that the above ends with an ASCII "escape" character which, at least in my browser, is invisible. Basically, this is `0py$"_cla<ESC>`.
This produces the letter "a" once when run once, once when run twice, twice when run 3 times, 3 times when run 4 times, 5 times when run 5 times, 8 times when run 6 times, and so on.
[Try it online!](https://tio.run/##K/v/36CgUkUpPjknUfr/fwA "V (vim) ‚Äì Try It Online")
Here is an explanation, along with equivalent Python code, where `L` and `R` denote the text to the left and the right of the cursor, and `Y` denotes the contents of the current register:
* `0`: move the cursor to the beginning of the line (Python: `L, R = '', L + R`)
* `p`: paste the contents of the default register, and put the cursor at the end of it (Python: `L, R = L + R[:1] + Y[:-1], Y[-1:] + R[1:]`)
* `y$`: set the default register to all the text after the cursor (Python: `Y = R`)
* `"_`: when running the following command, do *not* set the default register to the deleted text
* `cla<ESC>`: delete the character after the cursor (if there is one) and insert an "a" (Python: `R = 'a' + R[1:]`)
Near miss: the program `y$0pcla<ESC>` would be an 8-byte solution, except that it generates the sequence at the wrong offset: running it twice produces "aa," running it three times produces "aaa," running it four times produces "aaaaa," and so on. The program `0py$cla<ESC>` doesn't work because the command `cla<ESC>` sets the default register to the deleted text (unless it's preceded with `"_`).
[Answer]
# Swift 5.8, no header/footer, 43 bytes
```
var x=0,y=1;defer{print(x)}
(x,y)=(y,x+y)//
```
Port of [Value Ink's Ruby answer](https://codegolf.stackexchange.com/a/264529/106545). [Try it on SwiftFiddle!](https://swiftfiddle.com/3oetst3zlrfppnm7xwia3io3om)
## Swift 5.6, no header/footer, 106 bytes
This was the original answer. Even though the other one is shorter and also works in 5.6, I'm leaving this one here for the absurdity of it.
```
var x = -1,y=1//"
print(String(repeating:"1",count:y),terminator:"")
(x,y)=(y,x+y)
#if swift(<4)
(#endif
"
```
This abuses a bug (patched in 5.7) where, if an inactive `#if swift` block contains unmatched parentheses, the `#endif` may be followed by an ill-formed string literal, including one with no close quote. I want to elaborate on why this is so strange:
When a `#if` block is inactive due to `os()`, `arch()`, `canImport()`, a `-D` flag, or `#if false`, it's still parsed, but not compiled: [example](https://swiftfiddle.com/qbhhzc2bpzbpnbzhoiwkoc4m2e). However, if it's inactive due to `swift()`, it isn't parsed. It's tokenized so that the compiler knows where the correct `#endif` is, but it's not fully parsed: [example](https://swiftfiddle.com/azuhx4cbvzbxpdd3vgmd5l73iy). So, the fact that mismatched parentheses inside an inactive `#if swift()` do *anything* is bizarre, to say the least.
When this code is appended to itself, the redeclaration of the variables becomes an unused string:
```
var x = -1,y=1//"
print(String(repeating:"1",count:y),terminator:"")
(x,y)=(y,x+y)
#if swift(<4)
(#endif
"var x = -1,y=1//"
print(String(repeating:"1",count:y),terminator:"")
(x,y)=(y,x+y)
#if swift(<4)
(#endif
"
```
The lack of space before the line comment throws off SwiftFiddle's syntax highlighting; SE's highlighting is correct. With that out of the way,
* [Try it on SwiftFiddle!](https://swiftfiddle.com/ls2tw2fyj5hkrdctoac5ynhmiy)
* [x2](https://swiftfiddle.com/n2jjq4serffbxawn6clbm6nq7m)
* [x3](https://swiftfiddle.com/bq7kcle4brh2jkj2uuzdbdcide)
* [x4](https://swiftfiddle.com/piuscsb7i5b2dn3yfl7ue7fob4)
* [x10](https://swiftfiddle.com/djiyatejlff7nlui4o3hyvuc3i)
[Answer]
# [Backhand](https://github.com/GuyJoKing/Backhand), 9 bytes
```
~+~:rO!:@
```
[Try it online!](https://tio.run/##S0pMzs5IzEv5/79Ou86qyF/RyuH/fwA "Backhand ‚Äì Try It Online")
[Try it online! (x6)](https://tio.run/##S0pMzs5IzEv5/79Ou86qyF/RyoEkxv//AA "Backhand ‚Äì Try It Online")
Backhand's IP jumps by three cells by default, bouncing off at edges. This code makes use of this property to the max. Since the length of the base program is a multiple of 3, any amount of repetition will run as follows:
```
~  :  !  ~  :  !   ...    (forward) set up the initial stack
 +  r  :  +  r  :  ...    (backward) compute Fibonacci
  ~  O  @                 (forward) print the number and halt
set up the initial stack:
~    pop off one element; no op on first iteration
:    dup; pushes two zeros on first iteration
!    not; change the top zero to one
~    pop off one
:    dup 0
!    not to make it 1
...
compute Fibonacci: [a b]
:    dup [a b b]
r    reverse stack [b b a]
+    add [b a+b]
print and halt:
~    pop off b
O    print a as num
@    halt
```
[Answer]
# [Node.js](https://nodejs.org), 36 bytes, no header/footer
Returns the result in the exit code.
The highest possible value depends on the operating system. I *think* that's 8-bit/unsigned on Linux and at least 32-bit/signed on (recent versions of) Windows.
```
a=0;b=1
process.exitCode=a=b+(b=a)//
```
See the exit code in the debug section:
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/0dbAOsnWkKugKD85tbhYL7Uis8QZKGObaJukrZFkm6ipr///PwA "JavaScript (Node.js) ‚Äì Try It Online") x1  
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/0dbAOsnWkKugKD85tbhYL7Uis8QZKGObaJukrZFkm6iprz@qhnI1//8DAA "JavaScript (Node.js) ‚Äì Try It Online") x10
[Answer]
# [Haskell](https://www.haskell.org), 30 bytes, 0 bytes header, 0 bytes footer
```
q=0:scanl(+)1q;f=(q!!)$0
 +1--
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ8GCpaUlaboW-wptDayKkxPzcjS0NQ0LrdNsNQoVFTVVDLgUtA11dSGKbmrmJmbmKdgqpORzKSgUFGXmlSioKJQkZqcqGBoAWYVw0TSIBpjpAA)
# [Haskell](https://www.haskell.org), 44 bytes, 0 bytes header, 0 bytes footer, no comments
```
f where q=(0,1);qf@(f,g)=(g,f+g)where(f,g)=q
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ2W0km6Ec0CAUuzSdAVbhZilpSVpuhY3ddIUyjNSi1IVCm01DHQMNa0L0xw00nTSNW010nXStNM1wbIQkUKInnW5iZl5QCMKijLzShTSIYILFkBoAA)
[Answer]
# [Labyrinth](https://github.com/m-ender/labyrinth), 14 bytes
```
 #
-(
:
=+{!@
```
[Try it online!](https://tio.run/##y0lMqizKzCvJ@P9fQZlLV4PListWu1rRgev/fwA "Labyrinth ‚Äì Try It Online")
[Try it online! (6x)](https://tio.run/##y0lMqizKzCvJ@P9fQZlLV4PListWu1rRgYs6vP//AQ "Labyrinth ‚Äì Try It Online")
The "repeat the source" requirement is extremely hard in Labyrinth (maybe easier than Hexagony, where it can be rightout impossible, but still), especially to golf it down, mainly due to the IP routing across source boundaries.
I experimented with many layouts for two full days, only to find that the second simplest layout can be golfed by 1 byte (the simplest being the one below).
```
 #        #    push stack height [0 | ]
-(        (-   decrement and subtract from below [1 | ] (implicit zeros are used)
:         :=+  duplicate, swap the tops of two stacks, add [1 | 1]
=+{!@          (one step of fibonacci)
 #        the top is not zero, so turn right at the junction
-(        #(-  push stack height(1), decrement, subtract (becomes noop) [1 | 1]
:         so repeat running fibonacci until it hits the bottom row
=+{!@
 #
-(
:
=+{!@     {!@  print the previous fibonacci and exit
```
# [Labyrinth](https://github.com/m-ender/labyrinth), 15 bytes
```
:1
;
:
=
+
_=!@
```
[Try it online!](https://tio.run/##y0lMqizKzCvJ@P/fypDLmsuKy5ZLmyveVtHh/38A "Labyrinth ‚Äì Try It Online")
[Try it online! (6x)](https://tio.run/##y0lMqizKzCvJ@P/fypDLmsuKy5ZLmyveVtGBitz//wE "Labyrinth ‚Äì Try It Online")
The "simplest layout" that uses `_` "push 0" at the junction to skip to the next iteration.
[Answer]
# [Headass](https://esolangs.org/wiki/Headass), 56 bytes
```
U+O[+O[ORO[]]+E.U-):R-OU[UO]OUO[]]+E;U({])UU+O[]]E:?-(}.
```
Prints the word `debug` fib(n) times, where n is the number of copies, separated by newlines. This relies on the fact that DSO doesn't actually provide any debug info when the debug operation is called. it just prints the word 'debug'. Pretty funny stuff!
Linking up to 6 copies because that's how many it took to convince myself:
[Try It Online!](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS4iLCIiLCIiLCIiXQ==), [Try It Online!x2](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LiIsIiIsIiIsIiJd), [Try It Online!x3](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LlUrT1srT1tPUk9bXV0rRS5VLSk6Ui1PVVtVT11PVU9bXV0rRTtVKHtdKVVVK09bXV1FOj8tKH0uIiwiIiwiIiwiIl0=), [Try It Online!x4](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LlUrT1srT1tPUk9bXV0rRS5VLSk6Ui1PVVtVT11PVU9bXV0rRTtVKHtdKVVVK09bXV1FOj8tKH0uVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS4iLCIiLCIiLCIiXQ==), [Try It Online!x5](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LlUrT1srT1tPUk9bXV0rRS5VLSk6Ui1PVVtVT11PVU9bXV0rRTtVKHtdKVVVK09bXV1FOj8tKH0uVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LiIsIiIsIiIsIiJd), [Try It Online!x6](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LlUrT1srT1tPUk9bXV0rRS5VLSk6Ui1PVVtVT11PVU9bXV0rRTtVKHtdKVVVK09bXV1FOj8tKH0uVStPWytPW09ST1tdXStFLlUtKTpSLU9VW1VPXU9VT1tdXStFO1Uoe10pVVUrT1tdXUU6Py0ofS5VK09bK09bT1JPW11dK0UuVS0pOlItT1VbVU9dT1VPW11dK0U7VSh7XSlVVStPW11dRTo/LSh9LlUrT1srT1tPUk9bXV0rRS5VLSk6Ui1PVVtVT11PVU9bXV0rRTtVKHtdKVVVK09bXV1FOj8tKH0uIiwiIiwiIiwiIl0=)
## Explanation:
Overall strategy: Each repeat of the code (we will call them "chunks") just aims to print enough 'debug's to reach the next fibonacci number. So the first chunk needs to print 1, since fib(1) = 1, but chunk two doesn't want to print anything, since chunk one already got us to fib(2) = 1, but then chunk three wants to print one more, since fib(3) = 2... etc etc etc. Luckily, there is a sequence which describes exactly this phenomenon:
`1 0 1 1 2 3 5 8 13 21...`
It is the fibonacci sequence.
Each chunk increments a global variable (called `i` in the explanation below) and runs a short loop to get fib(i) but with fib starting with 1, 0. Then, it prints 'debug' that many times before moving on to the next chunk.
```
U+O[+O[ORO[]]+E.   code block 0 (and 2, and 4...)
U+O                if i exists, i++, else let i = 1
   [+O             let a = 1
      [O           let b = 0
        RO         dont worry about it
          []]+E    go to code block 2*(i-1)+1
                   with these values
               .   end code block
U-):R-OU[UO]OUO[]]+E;U({])UU+O[]]E:?-(}.   code block 1 (and 3, and 5...)
U-)                 ;                      if i == 0
                     U({])        :   }      while(a != r0){
                                   ?           print('debug')
                                    -(         a-- (effectively)
                                             }
                          U                  dont worry about it
                           U+O               i++
                              []]E           go to code block 2*i
                                             with the new i value
   :                                       }else{
    R-O                                      i--
       U[                                    r2 = a
         UO                                  a = b
           ]O                                b = b + r2 
             UO                              dont worry about it
               []]+E                         go to code block 2*i+1
                                             with these new values
                                       .   end code block
```
all those parts where i say not to worry about it are just things that have to do with the specific ways im shuffling values around on the queue, and it would take up too much space to explain while not adding much clarity. Like and subscribe
## [Headass](https://esolangs.org/wiki/Headass), 27 bytes + 7 byte footer, outputs numerically
```
U+O[]]E.U)UP:R-OU^[U]ODONE.
```
### Footer:
```
UODONOE
```
This one doesn't score as well, but overall it is much shorter and actually outputs numerically rather than with debug messages, so I thought it'd be worth including here.
[Try It Online!](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd), [Try It Online!x2](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd), [Try It Online!x3](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd), [Try It Online!x4](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd), [Try It Online!x5](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd), [Try It Online!x6](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuVStPW11dRS5VKVVQOlItT1VeW1VdT0RPTkUuIiwiVU9ET05PRSIsIiIsIiJd)
### Explanation:
Overall strategy: iterate through all of the even code blocks to count how many copies there are, ending up at the footer, which then uses this count to initialize a loop on code block 1 which just gets fib(n) in a normal way. I want to believe it's possible to have something similar to this with no header/footer, but I don't have any ideas for that yet.
```
U+O[]]E.  code block 0 (and 2, and 4...)
U+O       if i exists, i++, else let i = 1
   []]E   go to code block 2*i
       .  end code block
UODONOE  code block 2*(number of copies + 1)
UO       save i on the queue
  DO     a=0
    NO   b=1
      E  go to code block b (1)
U)UP:R-OU^[U]ODONE.  code block 1
U)  :           NE   while(i){
     R-O               i--
        U^             r1 = a
          [            r2 = a
           U]O          a = b + r2
              DO        b = r1
                NE   } (go to code block 1)
  UP                 print a
                  .  end code block
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
·πõ$‚Äò√Ü·∏û
```
[Try it online!](https://tio.run/##y0rNyan8///hztkqjxpmHG57uGPef@tHDXMUdO0UHjXMtQ7jAnIgsnPAskDBLCAGKn64q/vRxnWGBofbHzWtifwPAA "Jelly ‚Äì Try It Online")
A niladic link that as shown outputs 1 but when concatenated n times outputs the nth member of the Fibonacci sequence.
## Explanation (example for n = 2)
```
·πõ$‚Äò√Ü·∏û·πõ$‚Äò√Ü·∏û
·πõ$         | Within a monadic chain, right argument (will be zero)
  ‚Äò        | Increment by 1
      $    | Following as a monad:
   √Ü·∏û      | - Member of the Fibonacci sequence
     ·πõ     | - Right argument, restoring the original argument of this monadic chain
       ‚Äò   | Increment by 1
        √Ü·∏û | Member of the Fibonacci sequence
```
[Answer]
# [Fortran (GFortran)](https://gcc.gnu.org/fortran/), ~~77~~ 58 bytes body, ~~42~~ 13 bytes header and footer
```
!mandatory header
program x
!repeatable code
if(j<1)i=1;l=i;if(l>0)write(*,'(A)')('x',k=1,l);i=j;j=j+l
!mandatory footer
end
```
Output is unary and printed vertically. The code depends on the compiler to initialize local variables to zero, e.g. with `-finit-local-zero` for [GFortran](https://gcc.gnu.org/fortran/).
Try it online:
[1x](https://tio.run/##JcdBCkIhEADQfadop5ZCrm2CjiI/R8YmjflCnw7fFLR7D4dMyT1U/EOfMqrkx35TQtvO0RHExEDpV76c3EtoFnvwxl6dcdZsxt8henaJoKUG7cg7Lf2mnwU511UDUqcZeCyZw7vI@AI "Fortran (GFortran) ‚Äì Try It Online"),
[2x](https://tio.run/##nctBCkIhEIDhfadop1MKubYJOoq8VMYmjUno0eGbgm7Q7v8WfxkyJXVfyy/0LqNKum1XpWLbMQBhiIwUv@TTAZ5CM9udM/YMBqxZjbticAyRsMWGbc@b/0/N/aLvpXCqD/WFOk3PY0nsX1nGBw "Fortran (GFortran) ‚Äì Try It Online"),
[4x](https://tio.run/##1ctBCkIhEIDhfadop1MKubYJOoq8VMYmjUno0eGbgk7R7v8WfxkyJXVfyy/0LqNKum1XpWLbMQBhiIwUv@TTAZ5CM9udM/YMBqxZjbticAyRsMWGbc@b/zo194u@l8KpPtQX6jQ9jyWxf2UZHw "Fortran (GFortran) ‚Äì Try It Online"),
[8x](https://tio.run/##7csxDgIhEEDR3lPYAQqJ1DgmHoXsAhkcwcySuPHwzpp4CQu7/4uXOw@OzZX8DXlwLxzv@1Uw63r2BsEHAgyfpcvJPBlH0ger9NUoo9Wq7A28JRMQaqhQj7T7y1@Uktos7ylTLIu4jA2Hoz5Fcq/EfQM "Fortran (GFortran) ‚Äì Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 10 bytes (no header/footer)
```
eaYfgTs>2Y
```
[Try it online!](https://tio.run/##K6gsyfj/PzUxMi09pNjOKPL/fwA "Pyth ‚Äì Try It Online")
[2x](https://tio.run/##K6gsyfj/PzUxMi09pNjOKBLB@v8fAA)
[3x](https://tio.run/##K6gsyfj/PzUxMi09pNjOKBIb6/9/AA)
[4x](https://tio.run/##K6gsyfj/PzUxMi09pNjOKBI/6/9/AA)
[10x](https://tio.run/##K6gsyfj/PzUxMi09pNjOKJJ2rP//AQ)
```
              # implicitly assign Y=[]
   f          # find the lowest number starting at 1 for which lambda T is true
       >2Y    # the last two elements of Y
      s       # summed
    gT        # is less than or equal to T
 aY           # append to Y
e             # return the last element of Y
```
[Answer]
# [Nim](https://nim-lang.org/), 60 bytes (no header/footer, outputs in decimal)
```
var a,b=0;b=1;addQuitProc do{.noconv.}:echo a
(a,b)=(b,a+b)#
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m704LzN3wYKlpSVpuhY3bcoSixQSdZJsDayTbA2tE1NSAkszSwKK8pMVUvKr9fLyk_PzyvRqrVKTM_IVErk0gEo1bTWSdBK1kzSVIWZAjYIZCQA)
## Without using comments, 82 bytes
Includes a trailing newline.
```
when not declared a:
 var a,b=0;b=1;addQuitProc do{.noconv.}:echo a
(a,b)=(b,a+b)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m704LzN3wYKlpSVpuhY3g8ozUvMU8vJLFFJSk3MSi1JTFBKtuBTKEosUEnWSbA2sk2wNrRNTUgJLM0sCivKTFVLyq_Xy8pPz88r0aq1SkzPyFRK5NIBKNW01knQStZM0uSAmQy2AWQQA)
## Unary output, 46 bytes
Port of loopy wait's Python answer.
```
var a,b="x";b=""
stdout.write a
(a,b)=(b,a&b)#
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m704LzN3wYKlpSVpuhY39coSixQSdZJslSqUrIGkEldxSUp-aYleeVFmSapCIpcGUFLTViNJJ1EtSVMZoguqGWYIAA)
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 13 bytes
```
\\n;
1:
0@
 +
```
[Try it online!](https://tio.run/##S8sszvj/PyYmz5rL0IrLwIFLQfv/fwA "><> ‚Äì Try It Online")
When repeated, it looks like this:
```
\\n;
1:
0@
 +\\n;
1:
0@
 +\\n;
1:
0@
 +
```
The first column sets up the stack, the second runs the Fibonacci loop, and the horizontal path prints and exits. Extra copies of `1 0`s are ignored.
]