[Haskell-cafe] Lists of Lists
sebastian.sylvan at gmail.com
Wed Mar 8 08:05:46 EST 2006
On 3/8/06, zell_ffhut <zell_ffhut at hotmail.com> wrote:
> I've tried using the Concat and ++ functions, but to no avail so far.
> Imagine the strings are set out in a 9x9 grid type way, and i have to find
> the value of a set position given 2 gird values.
> > getCharFromGrid (row,col) g = concat g !!(row * 9) + col
> The decleration is
> > getCharFromGrid :: Position -> Grid -> Char
> Any ideas why its not working?
Well, did you try:
getCharFromGrid (row,col) g = concat g !! (row * 9 + col)
(what you wrote would extract the col*9'th element and then add col to
Or how about:
getCharFromGrid (row,col) g = g !! row !! col
More information about the Haskell-Cafe