
8 Mar
2006
8 Mar
'06
1:05 p.m.
On 3/8/06, zell_ffhut
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 that element) Or how about: getCharFromGrid (row,col) g = g !! row !! col /S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862