view 5-Erlang/roulette.erl @ 77:7bab4843aec6

Add roulette with auto-restarting process (And black-magic auto-registering of atoms)
author IBBoard <dev@ibboard.co.uk>
date Sat, 03 Feb 2018 20:42:51 +0000
parents
children
line wrap: on
line source

-module(roulette).
-export([loop/0]).

loop() ->
    receive
        3 -> io:format("bang.~n"), exit({roulette, die, at, erlang:time()});
        _ -> io:format("click~n"), loop()
end.