Hi, I’ve been away from elm for a little bit and I’m having a lot of fun coding a little game in it to remember how it works. It was going swimmingly until I hit a silly algorithm roadblock, would anyone have an opinion on how I should progress?
It might be simple but for some reason I’ve been spending hours on it without a result Truth is I know how to proceed in an imperative manner (boo) but no amount of twisting foldl / foldr or coming up with my own little recursive attempts is helping. Is it actually hard or am I missing the forest for the tree?
Here is the data and what I would like to get back:
data : List (List Int)
data =
[ [ 1, 1, 0, 0, 1 ]
, [ 1, 1, 0, 0, 0 ]
, [ 0, 1, 0, 1, 1 ]
, [ 0, 0, 0, 1, 1 ]
]
goal : List (List (Int, Int))
goal =
[ [(0,0), (1,0), (1, 0), (1, 1), (2, 1)]
, [(4,0)]
, [(3,2), (4,2), (3,3), (4,3)]
]