~statianzo/sevenlangs

ref: 3700af5fddf85e6263d69b228779eacb0367175a sevenlangs/erlang/fizzbuzz.erl -rw-r--r-- 245 bytes
3700af5fJason Staten fizzbuzz.erl 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
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)).