Last active
July 4, 2016 01:33
-
-
Save vilterp/9966fd18de8d9b282ade to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sierpinski where | |
import Diagrams.Core exposing (..) | |
import Diagrams.Align exposing (..) | |
import Diagrams.FillStroke exposing (..) | |
import Diagrams.FullWindow exposing (..) | |
import Color | |
sierpinski n sl = case n of | |
0 -> eqTriangle sl (justSolidFill Color.blue) | |
_ -> let smaller = sierpinski (n-1) sl | |
in smaller | |
`above` | |
(smaller `beside` smaller |> alignCenter) | |
|> alignCenter | |
main = sierpinski 5 10 | |
|> alignCenter | |
|> fullWindowMain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made with elm-diagrams; compare haskell diagrams