Largest Product in MxN grid
J, 26 chars

&gt;./,4*/\"1(,|:,]/.,]/.@|.)


Just an expression to which a rank 2 array could be appended.

,|:,]/.,]/.@|. takes the rank 2 array and concatenates 4 intermediate rank 2 arrays, the input's identity, transposition, and obliques, respectively. Here I feel like there's an uncomfortable amount of redundancy, because there are 2 ]s, 3 ,s, and 2 /.s... I can't think of a way to refactor those out.

&gt;./,4*/\"1 is just a straightforward maximum of each length 4 subsequence of each row of the newly made array, which of course corresponds to rows/columns/diagonals of the original.