Download:
child 5:0f9f2e3d2609
parent 3:8bbf038c39cc
4:c9defefe5dd9
Anton Shestakov <engored@ya.ru>, Sun, 23 Feb 2014 00:29:31 +0900
Rename for clarity.

1 файлов изменено, 4 вставок(+), 4 удалений(-) [+]
rps.erl file | annotate | diff | comparison | revisions
--- a/rps.erl Sun Feb 23 00:23:54 2014 +0900
+++ b/rps.erl Sun Feb 23 00:29:31 2014 +0900
@@ -61,14 +61,14 @@
room(Players, []).
room(Players, Choices) when length(Players) =:= length(Choices) ->
- Best = winner(Choices),
+ Winner = winner(Choices),
Msg = if
- Best =:= undefined ->
+ Winner =:= undefined ->
io:format("draw: ~w.~n", [Choices]),
draw;
true ->
- io:format("the winner is ~w.~n", [Best]),
- {winner, Best}
+ io:format("the winner is ~w.~n", [Winner]),
+ {winner, Winner}
end,
lists:foreach(fun(Player) -> Player ! Msg end, Players),
room(Players);