<commit_before>import random





class Dice(object):
#add the business rules to this class
    def __init__(self):
        self.score = 0
        self.set_aside = []
        self.remaining = [Die(), Die(), Die(), Die(), Die(), Die()]

    def get_score(self):
        return self.score

    def get_set_aside(self):
        return [die.get_value() for die in self.set_aside]

    def get_remaining(self):
        return [die.get_value() for die in self.remaining]

    def roll(self):
        for die in self.remaining:
            die.roll()

    def move_to_set_aside(self, dice_values):
        if !self.is_valid_set_aside(dice_values):
            raise InvalidSetAsideException()

        for i in reversed(sorted(dice_indices)):
            self.set_aside.append(self.remaining[i])
            del(self.remaining[i])


class InvalidSetAsideException(Exception):
    pass

class Die(object):
    def __init__(self):
        self.value = 0

    def roll(self):
        self.value = random.randint(1,6)

    def get_value(self):
        return self.value




class Player(object):
    def take_turn(self, dice):
        pass

class HumanPlayer(Player):
    def take_turn(self, dice):
        while True:
            dice.roll()
            remaining = ' '.join([str(die) for die in dice.get_remaining()])
            set_aside = ' '.join([str(die) for die in dice.get_set_aside()])

            print "\n\nSet Aside:\n", set_aside
            print "Turn score: ", dice.get_score()
            print "\nYou roll the dice:\n", remaining
            choices = raw_input("\nIndicate the dice you want to set aside by entering their nuumbers separated by spaces, or enter nothing to stop.\n")
            if choices != '':
                try:
                    dice.move_to_set_aside([int(choice) for choice in choices.split()])
                except InvalidSetAsideException as e:
                    print "That set aside is not valid."
            else:
                return dice


class AIPlayer(Player):
    def take_turn(self, dice):
        pass
<commit_msg>Human command line interface almost done<commit_after>import random


class Dice(object):
    def __init__(self):
        self.score = 0
        self.set_aside = []
        self.remaining = [0, 0, 0, 0, 0, 0]

    def get_score(self):
        return self.score

    def get_set_aside(self):
        return [die for die in self.set_aside]

    def get_remaining(self):
        return [die for die in self.remaining]

    def roll(self):
        self.remaining = [random.randint(1,6) for die in self.remaining]

    def is_valid_set_aside(self, dice_values):
        for die_value in dice_values:
            found = False
            for die in self.remaining:
                if die == die_value:
                    found = True
            if found == False:
                return False
        return True

    def dice_combination_value(self, dice_values):
        return 100

    def move_to_set_aside(self, dice_values):
        if not self.is_valid_set_aside(dice_values):
            raise InvalidSetAsideException()

        value = self.dice_combination_value(dice_values)
        if value == 0:
            raise InvalidSetAsideException()

        for die_value in dice_values:
            self.set_aside.append(die_value)
            self.remaining.remove(die_value)


class InvalidSetAsideException(Exception):
    pass


class Player(object):
    def take_turn(self, dice):
        pass

class HumanPlayer(Player):
    def take_turn(self, dice):
        while True:
            dice.roll()
            choices = self.farkle_prompt(dice)
            if choices != '':
                try:
                    dice.move_to_set_aside([int(choice) for choice in choices.split()])
                    print "\n"*64
                except InvalidSetAsideException as e:
                    print "\n"*64
                    print "That set aside is not valid."
            else:
                return dice


    def clear_screen(self):
        print "\n"*64

    def farkle_prompt(self, dice):
        remaining = ' '.join([str(die) for die in dice.get_remaining()])
        set_aside = ' '.join([str(die) for die in dice.get_set_aside()])
        print "\n\nSet Aside:\n", set_aside
        print "Turn score: ", dice.get_score()
        print "\nYou roll the dice:\n", remaining
        return raw_input("\nIndicate the dice you want to set aside by entering their numbers separated by spaces, or enter nothing to stop.\n")


class AIPlayer(Player):
    def take_turn(self, dice):
        pass

{'fraction_non_alphanumeric': 0.09720401922236785, 'fraction_numerical': 0.005024027959807776, 'mean_word_length': 2.0486018641810917, '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': '6766093', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1315, 'n_words': 374}