def deal(self): self.handtype = htypes[htype] if self.handtype == "all": types = ('soft', 'hard', 'split') self.handtype = random.choice(types) h = cards.playerhand(self.handtype) d = cards.dealercard() c1 = h.c1.display c2 = h.c2.display logging.info("Value is %s", h.lookup) self.correct = chart.get_correct(h.lookup, d.value) logging.debug("%s %s" , c1, c2) self.dcard.SetLabel(d.display) self.pcard1.SetLabel(c1) self.pcard2.SetLabel(c2) if options.getboolean('main-opts', 'btn_disable'): self.ButtonDisable(h.lookup)
''' Created on Jun 19, 2012 @author: sharvey3 ''' import cards import strategy chart = strategy.table() for i in range(1,200): h = cards.playerhand() d = cards.dealercard() correct = chart.get_correct(h.lookup, d.value) print "XX", d.display print h.display #print h.lookup print correct print "---" #print i += 1