6 kyu

RPS Knockout Tournament Winner

104 of 256FrankK

Description:

A rock-paper-scissors robo player paticipates regularly in the same knockout tournament but almost always without succes. Can you improve this robo player and make it a tournament winner?

Task

  • A match is between 2 players. The first that wins 20 games of Rock-Paper-Scissors is the winner of the match and continues to the next round. The other player is eliminated from the tournament.
  • If your bot wins 5 rounds, the final included, it has won the tournament.
  • The number of opponents is limited. Each opponent has its own strategy that does not change.
  • The tournament is played on the preloaded RockPaperScissorsPlayground:
RockPaperScissorsPlayground playground = new RockPaperScissorsPlayground();
boolean result = playground.playTournament(myPlayer);
RockPaperScissorsPlayground playground = new RockPaperScissorsPlayground();
bool result = playground.PlayTournament(myPayer);
playground = RockPaperScissorsPlayground()
result = playground.play_tournament(myPlayer)

This kata starts with a working bot, altough it plays with a poor random strategy. It can compete on the RockPaperScissorsPlayground because it implements:

interface RockPaperScissorsPlayer {
    // Your name as displayed in match results.
    String getName();
    
    // Used by playground to notify you that a new match will start.
    void setNewMatch(String opponentName);
    
    // Used by playground to get your game shape (values: "R", "P" or "S").
    String getShape();
    
    // Used by playground to inform you about the shape your opponent played in the game. 
    void setOpponentShape(String shape);
}
public interface IRockPaperScissorsPlayer
{
    // Your name as displayed in match results.
    string Name { get; }    
    
    // Used by playground to notify you that a new match will start.
    void SetNewMatch(string opponentName);
    
    // Used by playground to get your game shape (values: "R", "P" or "S").
    string GetShape();
    
    // Used by playground to inform you about the shape your opponent played in the game. 
    void SetOpponentShape(string shape);
}
class RockPaperScissorsPlayer:
    # Your name as displayed in match results.
    def get_name(self):
        pass
    # Used by playground to get your game shape (values: "R", "P" or "S").
    def get_shape(self):
        pass
    # Used by playground to notify you that a new match will start.
    def set_new_match(self, opponentName):
        pass
    # Used by playground to inform you about the shape your opponent played in the game. 
    def set_opponent_shape(self, shape):
        pass

Note

The best way to solve this kata is:

  • Extend methods get shape and set opponent shape to make the patterns of your opponents visible to you and analyse their strategies and weaknesses.
  • If the strategy of an opponent is clear to you, adapt your bot to the opponent.
  • Continue until your bot can beat all opponents by skill instead of sheer luck.
Games
Algorithms
Game Solvers
Design Patterns
Object-oriented Programming

Similar Kata:

More By Author:

Check out these other kata created by FrankK

Stats:

CreatedJan 1, 2017
PublishedJan 1, 2017
Warriors Trained1222
Total Skips42
Total Code Submissions4624
Total Times Completed256
C# Completions97
Java Completions65
Python Completions104
Total Stars47
% of votes with a positive feedback rating77% of 49
Total "Very Satisfied" Votes32
Total "Somewhat Satisfied" Votes11
Total "Not Satisfied" Votes6
Total Rank Assessments6
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • FrankK Avatar
  • smile67 Avatar
  • Admiraal Avatar
Ad