~statianzo/sevenlangs

3700af5fddf85e6263d69b228779eacb0367175a — Jason Staten 1 year, 11 months ago 9127ef1
fizzbuzz.erl
1 files changed, 11 insertions(+), 0 deletions(-)

A erlang/fizzbuzz.erl
A erlang/fizzbuzz.erl => erlang/fizzbuzz.erl +11 -0
@@ 0,0 1,11 @@
-module(fizzbuzz).

-export([run/0]).
-import(lists, [map/2, seq/2]).

check(N) when N rem 15 == 0 -> "fizzbuzz";
check(N) when N rem 5 == 0 -> "buzz";
check(N) when N rem 3 == 0 -> "fizz";
check(N) -> N.

run() -> map(fun check/1, seq(1, 100)).
\ No newline at end of file