I´m trying to understand the Syntax of Haskell but i just dont seem to get it and im not finding the answers im looking for in the forum so im gonna ask myself.
flossaufFeld x y z =
if z == "spielfeldA"
then if spielfeldA x y == 1 then putStrLn("True")
else if spielfeldA x y == 2 then putStrLn("True")
else if spielfeldB x y == 1 then putStrLn("True")
else if spielfeldB x y == 2 then putStrLn("True")
else putStrLn("False")
-- 2.
flossaufFeld x y z =
| z == spielfeldA
| spielfeldA x y == 1 = putStrLn("True")
| spielfeldA == 2 = putStrLn("True")
| z == spielfeldB
| spielfeldB x y == 1 = putStrLn("True")
| spielfeldB == 2 = putStrLn("True")
| otherwise = putStrLn("False")
spielfeldA is a matrix.
010
002
120
Thanks :)
Aucun commentaire:
Enregistrer un commentaire