From 52001a23e58da8041306bae9e7e7bf1104bd3340 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 4 May 2020 16:50:01 -0700 Subject: [PATCH] Add some sample cows. --- src/Cdl/SampleCows.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/Cdl/SampleCows.hs diff --git a/src/Cdl/SampleCows.hs b/src/Cdl/SampleCows.hs new file mode 100644 index 0000000..8d42101 --- /dev/null +++ b/src/Cdl/SampleCows.hs @@ -0,0 +1,11 @@ +module Cdl.SampleCows where +import Cdl.Cow + +regularPolygonCow :: Int -> CowBehavior () +regularPolygonCow n = repeatTimes n $ move 10 >> return (360 `div` n) + +squareCow :: CowBehavior () +squareCow = repeatTimes 4 $ move 10 >> turn 90 + +pacingCow :: CowBehavior () +pacingCow = move 10 >> turn 180 >> move 10