You are viewing a single comment's thread. Return to all comments →
def square_of_sum (my_array, proc_square, proc_sum) sum = proc_sum.call(my_array) proc_square.call(sum) end proc_square_number = proc { |num| num * num } proc_sum_array = proc { |my_array| my_array.sum } my_array = gets.split().map(&:to_i) puts square_of_sum(my_array, proc_square_number, proc_sum_array)
Seems like cookies are disabled on this browser, please enable them to open this website
Procs
You are viewing a single comment's thread. Return to all comments →