internal void UserInput(Gestures g) { Gestures aiGesture = ai.MakeDecision(g); figure1.text = GestureToString(g); figure2.text = GestureToString(aiGesture); result.text = "UNKNOWN"; if (RPSRules.FirstBeatsSecond(g, aiGesture)) { result.text = "WON"; score.addP1(); } else if (RPSRules.FirstBeatsSecond(aiGesture, g)) { result.text = "LOST"; score.addP2(); } else if (RPSRules.IsDraw(aiGesture, g)) { result.text = "DRAW"; } gameObject.SetActive(true); }
static void Main() { Logic rules; Player player1, player2; Game game; rules = new RPSRules(); RulesInfo(rules); player1 = CreatePlayer(Player1Prompt, rules); player2 = CreatePlayer(Player2Prompt, rules); game = new Game(player1, player2, rules); for (int i = 0; i < 10; i++) { NewRound(player1, player2, game); } rules = new RPSLSRules(); RulesInfo(rules); player1 = CreatePlayer(Player1Prompt, rules); player2 = CreatePlayer(Player2Prompt, rules); game = new Game(player1, player2, rules); for (int i = 0; i < 10; i++) { NewRound(player1, player2, game); } }
public Gestures MakeDecision(Gestures gOpponent) { //TODO: make not so clever return(RPSRules.GetWinGesture(gOpponent)); }
public Gestures MakeDecision(Gestures gOpponent) { return(RPSRules.GetRandomGesture()); }
public Gestures MakeDecision(Gestures g) { return(RPSRules.GetWinGesture(g)); }