From: Victor Reyes Date: 2008-05-06T04:06:01+09:00 Subject: Help with array ------=_Part_18598_28186957.1210014345786 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Team, On my never ending saga to learn Ruby, I am trying to write a program to solve Sudoku puzzles. Given a multidimensional array (9x9) I am trying to inspect each row and each column as follows: Assume the following represents a typical row in my 9x9 array: *Row*** 23 689 7 12345689 1359 9 2468 359 235 Row 23 689 7 12345689 1359 9 2468 359 235 Row 23 689 7 12345689 1359 9 2468 359 235 Row 23 689 7 12345689 1359 9 2468 359 235 Furthermore, assume the following is a typical column: *Column*** 23 689 7 12345689 1359 9 2468 359 235 I would like to be able to count the frequency of each digit on either row or column, separate of course! *Number*** 1 2 3 4 5 6 7 8 9 *Frequency*** 2 4 5 2 4 3 1 3 5 I can do this with some ugly looking and probably inefficient loop. However, Ruby has so many tools and "tricks" that perhaps there might be some way of doing this quicker and easy to understand. Any help will be greatly appreciated! Thank you Victor ------=_Part_18598_28186957.1210014345786--