Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

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
  • 22
  • 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
  • 22
  • 24

#Ruby, 71(削除) 71 (削除ここまで) 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
  • 22
  • 24
Loading

AltStyle によって変換されたページ (->オリジナル) /