diff --git a/HelloWorld.lhs b/HelloWorld.lhs index 5c38e0c..5dfcb8c 100644 --- a/HelloWorld.lhs +++ b/HelloWorld.lhs @@ -5,23 +5,8 @@ > import Diagrams.Prelude > import Diagrams.Backend.SVG.CmdLine > -> myCircle :: Diagram B -> myCircle = circle 1 -> -> example :: Diagram B -> example = circle 1 # fc blue -> -> twoCircles :: Diagram B -> twoCircles = circle 1 # fc green ||| circle 1 # fc red -> -> twoShapes :: Diagram B -> twoShapes = square 1 # fc aqua `atop` circle 1 -> -> vectorShape :: Diagram B -> vectorShape = fromOffsets . map r2 $ [(0,0), (1,1), (-2,1), (-1,-4)] -> > stepsOrigins :: [Point V2 Double] -> stepsOrigins = map p2 $ [(x, y) | x <- [0], y <- [0, (-1), (-2)]] +> stepsOrigins = map p2 $ [(x, y) | x <- [0..1], y <- [0, (-1), (-2)]] > > step :: Int -> Diagram B > step x = fromOffsets @@ -34,7 +19,10 @@ > # lw veryThin > # named x > -> main = mainWith $ -> atPoints stepsOrigins [step x | x <- [0..]] -> # connectOutside (0 :: Int) (1 :: Int) -> # connectOutside (1 :: Int) (2 :: Int) \ No newline at end of file +> numberOfSteps :: Int +> numberOfSteps = length stepsOrigins +> +> main = +> mainWith $ +> atPoints stepsOrigins [step x | x <- [0 .. ]] +> # applyAll [lw veryThin . connectOutside x (x + 1) | x <- [0 .. numberOfSteps - 2]] diff --git a/hello-world.svg b/hello-world.svg index 25c9441..f873bf5 100644 --- a/hello-world.svg +++ b/hello-world.svg @@ -1,3 +1,3 @@ \ No newline at end of file + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> \ No newline at end of file