Download:
child 18:9f635022d12d
parent 16:68f812e39f5a
17:f187ebbdcfb3
Anton Shestakov <engored@ya.ru>, Sat, 01 Mar 2014 15:32:16 +0900
Replace modules name by ?MODULE macro.

1 файлов изменено, 5 вставок(+), 5 удалений(-) [+]
rps.erl file | annotate | diff | comparison | revisions
--- a/rps.erl Wed Feb 26 19:36:35 2014 +0900
+++ b/rps.erl Sat Mar 01 15:32:16 2014 +0900
@@ -30,16 +30,16 @@
end.
go() ->
- register(lobby, spawn(rps, lobby, [])),
- register(counter, spawn(rps, counter, [])),
- register(printer, spawn(rps, printer, [])),
- [spawn(rps, Bot, []) || Bot <- ?BOTS].
+ register(lobby, spawn(?MODULE, lobby, [])),
+ register(counter, spawn(?MODULE, counter, [])),
+ register(printer, spawn(?MODULE, printer, [])),
+ [spawn(?MODULE, Bot, []) || Bot <- ?BOTS].
lobby() ->
lobby([]).
lobby(Players) when length(Players) =:= length(?BOTS) ->
- Room = spawn(rps, room, [Players]),
+ Room = spawn(?MODULE, room, [Players]),
lists:foreach(fun(Player) -> Player ! {room, Room} end, Players),
lobby([]);