<commit_before><commit_msg>Add simple terminal-based version of rock-paper-scissors.<commit_after>from random import choice

class RPSGame:
    shapes = ['rock', 'paper', 'scissors']
    draws = [('rock', 'rock'), ('paper', 'paper'), ('scissors', 'scissors')]
    first_wins = [('rock', 'scissors'), ('scissors', 'paper'), ('paper', 'rock')]
    
    def _evaluate(self, player_move, computer_move):
        if (player_move, computer_move) in RPSGame.draws:
            return "Draw!"
        elif (player_move, computer_move) in RPSGame.first_wins:
            return "Player wins!"
        else:
            return "Computer wins!"

    def play(self, rounds=1):
        for i in range(rounds):
            player_move = input("[rock,paper,scissors]: ")
            computer_move = choice(RPSGame.shapes)
            winner = self._evaluate(player_move, computer_move)
            print(20 * "-")
            print("You played: %s" % player_move)
            print("Computer played: %s" % computer_move)
            print(winner)
            print(20 * "-")

if __name__ == '__main__':
    game = RPSGame()
    game.play(rounds=10)

{'fraction_non_alphanumeric': 0.14638447971781304, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 2.661290322580645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1898114', 'n_tokens_mistral': 360, 'n_tokens_neox': 346, 'n_words': 83}