示例#1
0
def play(n):
	for i in range(1,n+1):
		#creates a new deck for every iteration
		a=deck()
		a.shuffle()
		print('\n')
		print('hand number', i)
		c=hand(a)
		print(c)
		c.processHand(S,R)
		print(c.evaluateHand())
示例#2
0
    def start(self, silent = False, hands = None):
        self.generation = 0
        
        if hands is None:
            self.hands = []
            for i in range(0, self.population):
                self.hands.append(hand())
                self.hands.sort(key=lambda x: x.score, reverse=True)
        else:
            self.hands = list(hands[:self.population])
        self.handscreated = self.population

        self.initialstats = cardevolution.calcstats(self.hands)
        self.lateststats = self.initialstats
        if not silent:
            self.printsimulationproperties()
            
            print(" ")
            print("Generation 0 results:")
            cardevolution.printstats(self.initialstats)
            if self.verbose: cardevolution.printscores(self.hands)
示例#3
0
 def makeabud(self, parent):
     return hand(parent.cards, self.mr)