Sha256: 0900a14f387961fd5f4d43c4a83a288779f45ea53cd8d1b79243857ca9ad746f
Contents?: true
Size: 401 Bytes
Versions: 61
Compression:
Stored size: 401 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
61 entries across 61 versions & 1 rubygems