Created
September 16, 2019 19:27
-
-
Save spraints/eba32f745ed40ef3b77cea579aebd2ca to your computer and use it in GitHub Desktop.
golden ratio converges quickly! https://en.wikipedia.org/wiki/Golden_ratio https://www.youtube.com/watch?v=dTWKKvlZB08
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show(x, y) | |
puts "#{y} #{y.to_f / x.to_f}" | |
end | |
a, b = ARGV.map(&:to_i) | |
c = a + b | |
puts a | |
show a, b | |
show b, c | |
50.times do | |
a = b | |
b = c | |
c = a + b | |
show b, c | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment