Anton Shestakov <engored@ya.ru>, Sun, 02 Mar 2014 18:00:14 +0900
Bots must know rules of current room (only rps3 at the moment).
src/rps3.erl
Permissions: -rw-r--r--
-export([get_rules/0, winning_hand/1]). get_rules() -> [rock, paper, scissors]. beats(H, lists:reverse(get_rules())). % rock, rock, rock -> rock % rock, paper, scissors -> undefined % rock, paper, paper -> paper % rock, rock, paper -> paper HSet = sets:from_list(Hands), case sets:is_element(loses(Hand), HSet) of