Skip to main content
Commonmark migration
Source Link

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

Ruby, 71 66 bytes

###ungolfed:

a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

ungolfed:

a = b = 1 #starting values
100.times{
  # create an array, and selects a value depending on the current number
  puts([b, 'Fibo', 'Nacci', 'Fibo', b, 'FiboNacci'][~b%6])
  a=b+b=a # magic
}

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

###ungolfed:

a = b = 1 #starting values
100.times{
  # create an array, and selects a value depending on the current number
  puts([b, 'Fibo', 'Nacci', 'Fibo', b, 'FiboNacci'][~b%6])
  a=b+b=a # magic
}

Ruby, 71 66 bytes

a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

ungolfed:

a = b = 1 #starting values
100.times{
  # create an array, and selects a value depending on the current number
  puts([b, 'Fibo', 'Nacci', 'Fibo', b, 'FiboNacci'][~b%6])
  a=b+b=a # magic
}
added 238 characters in body
Source Link
MegaTom
  • 4.3k
  • 1
  • 21
  • 24

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

###ungolfed:

a = b = 1 #starting values
100.times{
  # create an array, and selects a value depending on the current number
  puts([b, 'Fibo', 'Nacci', 'Fibo', b, 'FiboNacci'][~b%6])
  a=b+b=a # magic
}

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

###ungolfed:

a = b = 1 #starting values
100.times{
  # create an array, and selects a value depending on the current number
  puts([b, 'Fibo', 'Nacci', 'Fibo', b, 'FiboNacci'][~b%6])
  a=b+b=a # magic
}
added 5 characters in body
Source Link
MegaTom
  • 4.3k
  • 1
  • 21
  • 24

#Ruby, 7171 66 bytes f,n=%w[Fibo Nacci];a=b=1;100a=b=1;100.times{puts [f+n,b[b,ff='Fibo',nn='Nacci',f,b][b%6];a=b+(b=a)b,f+n][~b%6];a=b+b=a}

#Ruby, 71 bytes f,n=%w[Fibo Nacci];a=b=1;100.times{puts [f+n,b,f,n,f,b][b%6];a=b+(b=a)}

#Ruby, 71 66 bytes a=b=1;100.times{puts [b,f='Fibo',n='Nacci',f,b,f+n][~b%6];a=b+b=a}

Source Link
MegaTom
  • 4.3k
  • 1
  • 21
  • 24
Loading