~statianzo/sevenlangs

sevenlangs/erlang/fizzbuzz.erl -rw-r--r-- 245 bytes
2fcd4511Jason Staten day one logic style 1 year, 2 months 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)).