This file contains hidden or 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
class Song | |
def initialize | |
@bottles = 99 | |
end | |
def sing | |
@bottles.downto(0) do |bottle| | |
if bottle > 1 | |
puts "#{bottle} bottles of beer on the wall, #{bottle} bottles of beer." | |
puts "Take one down and pass it around, #{bottle - 1} bottles of beer on the wall.\n" |
This file contains hidden or 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
require 'net/http' | |
class Song | |
def initialize | |
end | |
def sing | |
end | |
end |
This file contains hidden or 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
#!/usr/bin/env ruby -wKU | |
puts `ps -o rss= -p #{$$}`.to_i | |
current_fib = 1 | |
fib_numbers = [] | |
for i in 1..4000000 do | |
if i == current_fib * 2 | |
fib_numbers << i |