elm/exercises/grains/Grains.example.elm
2017-05-28 14:47:33 -04:00

9 lines
138 B
Elm

module Grains exposing (..)
square : Int -> Maybe Int
square n =
if n < 1 then
Nothing
else
Just <| 2 ^ (n - 1)