fizzbuzz.erl

master
Jason Staten 5 years ago
parent 9127ef1273
commit 3700af5fdd

@ -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)).
Loading…
Cancel
Save