From: James Gray Date: 2008-01-28T01:00:01+09:00 Subject: Fwd: [Ruby Forum] Message from user iberci Begin forwarded message: > From: coder68@yahoo.com > Date: January 25, 2008 12:01:54 PM CST > To: james@grayproductions.net > Subject: [Ruby Forum] Message from user iberci > > iberci sent you the following message: > > ==================================== > First entry! Lurked since the beginning however and really appreciate > the time and effort you put into them > > ilan > > ============== make_change.rb ============================ > > #!/usr/bin/env ruby > > def make_change(amount, vals) > vals.sort.reverse.map {|v| f = amount/v; amount %= v; Array.new(f){v} > }.flatten > end > > p make_change(ARGV[0].to_i, ARGV[1].split(',').map {|a| a.to_i}) > ====================================