Skip to content

Instantly share code, notes, and snippets.

@sunny
Created September 22, 2011 13:08
Show Gist options
  • Save sunny/1234719 to your computer and use it in GitHub Desktop.
Save sunny/1234719 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
abort("Usage: #{$0} width height") if ARGV.size != 2
w = ARGV[0].to_f
h = ARGV[1].to_f
d = w / h
while w > 0 do
h = w / d
puts "#{w.to_i}*#{h.to_i}" if h == h.to_i
w -= 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment