The function labyrinth takes two numbers(x and y) as an argument and returns a char. Those chars represent a field in the labyrinth. With the code I wanted to calculate the width of a entered labyrinth.HoweverI alwas get this error:
error: parse error on input ‘if’
if (labyrinth x y == "0") ^^
breite labyrinth x y = if (labyrinth x y == "X")
then do
y <- return(y+1)
breite labyrinth x y
if (labyrinth x y == "0")
then labyrinth x y
Aucun commentaire:
Enregistrer un commentaire