diff --git a/aufgaben/src/Pflichtuebung_01/Pu01.elm b/aufgaben/src/Pflichtuebung_01/Pu01.elm index 7dfeb91..4aee1c2 100644 --- a/aufgaben/src/Pflichtuebung_01/Pu01.elm +++ b/aufgaben/src/Pflichtuebung_01/Pu01.elm @@ -17,11 +17,11 @@ type alias Date = -- 1 Punkt: year : Date -> Year ---year (a, b, c) = c +year (a,b,c) = c month : Date -> Month ---month (a,b,c) = b +month (a,b,c) = b day : Date -> Day ---day (a,b , c) = a +day (a,b,c) = a -- 1 Punkt: lt : Date -> Date -> Bool @@ -30,6 +30,14 @@ gt : Date -> Date -> Bool -- 1 Punkt: toString : Date -> String +toString (a,b,c) = (if a < 10 then "0" ++ String.fromInt(a) else String.fromInt(a)) + ++ (if b < 10 then "0" ++ String.fromInt(b) else String.fromInt(b)) + ++ (if c < 10 then "000" ++ String.fromInt(c) + else if c < 100 then "00" ++ String.fromInt(c) + else if c < 1000 then "0" ++ String.fromInt(c) + else String.fromInt(c)) +-- TT.MM.YYYY + -- 2 Punkte: next : Date -> Date