- -- if under == Sand
- -- then (ground', [here])
- -- else if rightWards == Clay
- -- then (ground', [])
- -- else if (under == Water) && (rightWards == Sand)
- -- then (ground', [])
- -- else floodRight ground' (left here)
- -- where ground' = (M.insert here Water ground)
- -- under = M.findWithDefault Sand (down here) ground
- -- rightWards = M.findWithDefault Sand (right here) ground
--- floodRight ground here =
- -- case under of
- -- Sand -> (ground', [here])
- -- Water -> (ground', [])
- -- otherwise -> if (right here) `M.notMember` ground
- -- then floodRight ground' (right here)
- -- else if ground!(right here) == Water
- -- then floodRight ground' (right here)
- -- else (ground', [])
- -- where ground' = (M.insert here Water ground)
- -- under = M.findWithDefault Sand (down here) ground