I want to traverse list of lists and check every element if its equal a char or not. How can I do this? I get an error even when I write if statement. I would be glad if you can help.
example list that I want to traverse:
maze = [ ['E','#','#','#'],
[' ','#',' ',' '],
[' ',' ',' ',' '],
['#','#','#','S'] ]
If statement:
checkElement :: Char -> Bool
checkElement x = if x == '#'
then False
else True
Aucun commentaire:
Enregistrer un commentaire