30 Fibonacci Numbers Without Using Numbers In Ruby(58)

/ Published in: Ruby
Save to your folder(s)

Cut down another 4 characters due to requirement dropping :
space ascii code is 32, b = 32/32 => 1 and that modulo 1 is zero.
It's just question of iterating through after that.

Copy this code and paste it in your HTML
  1. s=' '.ord;a=s%b=s/s
  2. b.upto(s-b-b){|x|p "#{x} #{a=b+b=a}"}

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.