Skip to main content
added 32 characters in body
Source Link
Cyoce
  • 3.4k
  • 25
  • 29

Cy, 33 31 30 bytes (non-competing)

  

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - $&+ times} &if :<
0 1 :>i {1 - $&+ times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)
0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 30 bytes (non-competing)

 

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - $&+ times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 30 bytes (non-competing)

 

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - $&+ times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)
added 9 characters in body
Source Link
Cyoce
  • 3.4k
  • 25
  • 29

Cy, 33 3131 30 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - {&+}$&+ times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - {&+} times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 30 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - $&+ times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)
added 5 characters in body
Source Link
Cyoce
  • 3.4k
  • 25
  • 29

Cy, 33 31 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - {&+} times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
  {
  1 -    
    {&+}      # add the last two values
  times }    # repeat N-1 times ^
&if } &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - {&+} times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
  { 1 -    
    {&+}      # add the last two values
  times }   # repeat N-1 times ^
&if       # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)

Cy, 33 31 bytes (non-competing)

This is going for the function option (takes N, outputs F(N))

0 1 :>i {1 - {&+} times} &if :<

Ungolfed/explanation:

0 1       # first two fibs are 0, 1
:>i       # read input as integer (let's call it N)
{
  1 -    
    {&+}      # add the last two values
  times     # repeat N-1 times ^
} &if     # if N is non-zero ^
:<        # output the last calculated value (if N is 0, that would be 0)
added 21 characters in body
Source Link
Cyoce
  • 3.4k
  • 25
  • 29
Loading
added 16 characters in body
Source Link
Cyoce
  • 3.4k
  • 25
  • 29
Loading
Source Link
Cyoce
  • 3.4k
  • 25
  • 29
Loading