
22 Mar
2012
22 Mar
'12
1:45 p.m.
Hey, I have the following problem. I have an 2D array of letters, like this: b w y l a i l q h w r a o q e d Now I am searching for all occurrences of a specific word in this array. The word can be horizontal, vertical or diagonal, like "bird" is in the example above. I am a beginer at haskell and I do not know where to start ... OK, I would represent the word as an String == [Char] and my array as [[Char]] (or would some kind of fixed size array make more sense?). In an imperative program, I would just search for the first letter and than check the rest of the word in all directions. If I do this, I need direct indexing of the array. Any advise in which direction to think? Thanks! Nathan