--- a/rps.erl Sun Feb 23 00:19:13 2014 +0900
+++ b/rps.erl Sun Feb 23 00:23:54 2014 +0900
-export([lobby/0, room/1, beats/1, winner/1, go/0, fool/0]).
-define(RULES, [rock, paper, scissors]).
+-define(BOTS, [fool, fool, fool]).
register(lobby, spawn(rps, lobby, [])),
- [spawn(rps, fool, []) || _ <- lists:seq(1, 3)].
+ [spawn(rps, Bot, []) || Bot <- ?BOTS].
-lobby(Players) when length(Players) =:= 3 ->
+lobby(Players) when length(Players) =:= length(?BOTS) ->
Room = spawn(rps, room, [Players]),
lists:foreach(fun(Player) -> Player ! {room, Room} end, Players),