Copyright © (C) 2014, Carlos Andres Bolaños R.A.
Behaviours: rpsls_player.
Authors: Carlos Andres Bolaños R.A. (candres@niagara.io).
play/2 | 1. |
play(History::[{You::rpsls_player:choice(), Rival::rpsls_player:choice()}], State::term()) -> {rpsls_player:choice(), NewState::term()}
1. First case in the random initialization 2. Match Alternating pattern 3. Match Repetitive pattern (bart, spock, ..) 4. Match Copycat pattern 5. Default behavior: This applies to both cases. In case to lose, applying "who_defeat(who_defeat(Me))", the first result from nested call returns possible things that can defeat me, including the opponent thing, and then applying again the same function over the returned result, will give me the thing that can defeat them. In case of win, well this case is pretty much obvious.
Generated by EDoc