--- a/rps.erl Sun Feb 23 00:04:28 2014 +0900
+++ b/rps.erl Sun Feb 23 00:17:17 2014 +0900
--export([lobby/0, room/1, beats/1, winner/1, go/0, fool/1]).
+-export([lobby/0, room/1, beats/1, winner/1, go/0, fool/0]).
-define(RULES, [rock, paper, scissors]).
- Lobby = spawn(rps, lobby, []),
- [spawn(rps, fool, [Lobby]) || _ <- lists:seq(1, 3)].
+ register(lobby, spawn(rps, lobby, [])),
+ [spawn(rps, fool, []) || _ <- lists:seq(1, 3)].
- Lobby ! {join, self()},
- fool(Lobby, undefined).
+ lobby ! {join, self()},
-fool(Lobby, undefined) ->
Choice = lists:nth(random:uniform(length(?RULES)), ?RULES),