Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Array
- mineLocation :: Array (Int, Int) Int -> Maybe (Int, Int)
- mineLocation arr = if mineIndex == []
- then Nothing
- else Just $ head mineIndex
- where mineIndex = [ind | ind <- indices arr, arr ! ind == 1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement