From: 7stud -- Date: 2011-03-22T09:09:27+09:00 Subject: Re: Counting values in an array, storing in a hash then making an array of hashes? 3) totals = [] boards = [ [ [1,1,1], [1,1,1], [1,1,1] ], [ [2,2,2], [2,2,2], [2,2,2] ] ] board_totals = [] boards.each do |this_board| this_board_totals = Hash.new(0) this_board.each do |row| row.each do |val| this_board_totals[val] += 1 end end board_totals << this_board_totals end p board_totals --output:-- [{1=>9}, {2=>9}] -- Posted via http://www.ruby-forum.com/.