Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main exposing (..)
- import Html exposing (..)
- depth : number
- depth =
- 10
- main : Html msg
- main =
- div [] (pascal 1 1 1)
- pascal : Int -> Int -> Int -> List (Html msg)
- pascal c line i =
- let
- message =
- text <| toString c ++ " "
- next =
- if i == line then
- 1
- else
- c * (line - i) // i
- in
- if line > depth then
- []
- else if i == line then
- message :: [ div [] (pascal 1 (line + 1) 1) ]
- else
- message :: pascal next line (i + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement