Beispiel #1
0
class WinotaTester:
    def __init__(self):
        self.hand = Hand("decklists/winota.txt")
        self.trials = 0
        self.castWinotaHits = 0
        self.noWinotaTrigger = 0
        self.castWinotaMiss = 0
        self.iterations = 100000
        self.cardsDrawn = 7
        self.AllHits = 0

    def checkWinotaTrigger(self):
        winotaTrigger = []
        for i in range(6):
            winotaTrigger.append(self.hand.deck[self.hand.draw_card()])
        return 'human' in winotaTrigger

    def run(self):
        for i in range(self.iterations):
            if i % 5000 == 0:
                print(str(i) + " of " + str(self.iterations))
            self.trials += 1
            self.hand.new_hand(self.cardsDrawn)
            numLands = self.hand.count_of('land')
            winotaDrawn = self.hand.contains('winota')
            goblinDrawn = self.hand.contains('goblin')
            
            wouldHit = self.checkWinotaTrigger()
            if numLands < 4 or not winotaDrawn or not goblinDrawn:
                self.noWinotaTrigger += 1
            elif wouldHit:
                self.castWinotaHits += 1
            else:
                self.castWinotaMiss += 1
            
            if wouldHit:
                self.AllHits += 1
        self.printResults()
    
    def printResults(self): 
        print("Trials " + str(self.trials))
        misses = self.trials - self.AllHits
        hitRate = self.AllHits / self.trials
        print ("All Hits: " + str(self.AllHits) + " All Miss: " + str(misses) + " All Hit rate: " + str(hitRate))
        realHitRate = self.castWinotaHits / (self.castWinotaHits + self.castWinotaMiss)
        print ("Real Hits: " + str(self.castWinotaHits) + " Real Miss: " + str(self.castWinotaMiss) + " Real Hit rate: " + str(realHitRate))
Beispiel #2
0
hand_counts = np.zeros(((starting_size + 1) - mullto, len(hand_types)))
totals = np.zeros((starting_size + 1) - mullto)

land_names = [
    "Cavern of Souls", "Sea Gate Wreckage", "Wastes", "Eldrazi Temple",
    "Urza's Mine", "Urza's Power Plant", "Urza's Tower", "Ghost Quarter"
]

for i in range(iterations):
    flag = False
    early_flag = False
    for j in range(0, (starting_size + 1) - mullto):
        hand.new_hand(starting_size - j)

        tron = hand.has_tron()
        lands = hand.count_of(land_names)
        has_TKS = hand.contains("Thought-Knot Seer")
        has_Reshaper = hand.contains("Matter Reshaper")
        has_Chalice = hand.contains("Chalice of the Void")
        temples = hand.count_of("Eldrazi Temple")
        has_Map = float(hand.count_of("Expedition Map") > 0 and lands >= 2)
        has_Stone = hand.contains("Mind Stone")

        t3_TKS = has_TKS * (((has_Map or (temples > 0)) * (lands >= 2)) or
                            (has_Stone * (lands >= 3)))
        # tron, Chalice + lands, t3 TKS, t2 Reshaper, 2 temples and any spell
        results = np.array([
            tron, has_Chalice * (lands >= 2), t3_TKS,
            has_Reshaper * (temples > 0) * (lands >= 2),
            (temples + has_Map * (lands >= 2) >= 2) * (lands < (7 - j))
        ])
Beispiel #3
0
zero_creatures = ["Memnite", "Ornithopter"]
zero_others = "Welding Jar"
ones = ["Signal Pest", "Vault Skirge"]
twos = ["Arcbound Ravager", "Cranial Plating", "Steel Overseer"]
threes = ["Etched Champion", "Master of Etherium"]
lands = [
    "Darksteel Citadel", "Spire of Industry", "Glimmervoid", "Inkmoth Nexus",
    "Blinkmoth Nexus", "Island"
]

for i in range(iterations):
    for j in range(0, (starting_size + 1) - mullto):
        hand.new_hand(starting_size - j)

        count_opal = hand.count_of("Mox Opal")
        count_lands = hand.count_of(lands)
        has_drum = hand.contains("Springleaf Drum")
        count_zero_creatures = hand.count_of(zero_creatures)
        count_zeros = count_zero_creatures + hand.count_of(
            zero_others) + hand.contains("Darksteel Citadel")
        count_ones = hand.count_of(ones) + has_drum * 1
        has_two = hand.contains(twos)
        has_three = hand.contains(threes)

        t1_opal = (count_zeros >= 2) or (has_drum and
                                         (count_zero_creatures > 0) and
                                         (count_lands > 0))
        t1_pay_opal = (count_ones > 0) and (count_zeros > 0) and (count_lands >
                                                                  0)
        t1_mana = count_opal * t1_opal + (count_lands > 0) + (