Module rpsls_cabra_player

This player detects predictable patterns such as: alternating pattern, repeating pattern (like bart, spock) and copycat pattern.

Copyright © (C) 2014, Carlos Andres Bolaños R.A.

Behaviours: rpsls_player.

Authors: Carlos Andres Bolaños R.A. (candres@niagara.io).

Description

This player detects predictable patterns such as: alternating pattern, repeating pattern (like bart, spock) and copycat pattern. In other cases the logic applied is: if the opponent wins, then pick the thing that beats what the opponent just played. If my player wins, then pick the thing that beats the possible things which can beat the thing that my player just played. The main idea is obtaining a significant advantage over those predictable pattern, and to unpredictable patterns like random and others, try to be as much balanced as possible

Function Index

play/2 1.

Function Details

play/2

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