Sha256: 7cef5a1ee13e15d39107d439ceaaf366f21915cef48aab03828dbe53ed807581
Contents?: true
Size: 385 Bytes
Versions: 74
Compression:
Stored size: 385 Bytes
Contents
module Triangle exposing (rows) import List nextRow : List Int -> List Int nextRow row = List.map2 (+) (0 :: row) (row ++ [ 0 ]) rows : Int -> List (List Int) rows n = let loop i row = if i == n then [] else row :: loop (i + 1) (nextRow row) in if n < 0 then [] else loop 0 [ 1 ]
Version data entries
74 entries across 74 versions & 1 rubygems