Skip to content

Commit

Permalink
add simple example
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Yorgey committed Sep 19, 2012
1 parent a4b4ce6 commit 1a26094
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions example/Sierpinski.hs
@@ -0,0 +1,21 @@
{- 1. Compile
2. Run with a size parameter, e.g.
./Sierpinski -w 400
3. Visit localhost:3000 in your browser
-}

{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.Canvas.CmdLine

sierpinski 1 = eqTriangle 1
sierpinski n = s
===
(s ||| s) # centerX
where s = sierpinski (n-1)

example = pad 1.1 $ sierpinski 7 # centerXY # lw 0 # fc black

main = defaultMain example

0 comments on commit 1a26094

Please sign in to comment.