コード例 #1
0
    def next(self, fight_history: List[Fight]):
        n = len(fight_history) + 1
        if n % 3 == 1:
            return card.random()

        last = fight_history[-1]
        return card.next(last.player)
コード例 #2
0
    def nextcard(self, fight_history) -> Card:
        n = (len(fight_history) + 1) % 100
        if n == 1 or n == 34 or n == 67:
            self.current_logic = self.next_logic()

        return self.current_logic.next(fight_history) \
            if self.current_logic is not None else card.random()
コード例 #3
0
    def next(self, fight_history: List[Fight]):
        n = len(fight_history) + 1
        if n % 3 == 0 and n % 5 == 0:
            return Card.Choki
        elif n % 3 == 0:
            return Card.Gu
        elif n % 5 == 0:
            return Card.Pa

        return card.random()
コード例 #4
0
ファイル: player.py プロジェクト: mh-northlander/procon
 def random_from_deck(self):
     if (self.deck[Card.Gu] == 0) and (self.deck[Card.Pa] >
                                       0) and (self.deck[Card.Choki] > 0):
         return Card.Pa
     if (self.deck[Card.Gu] > 0) and (self.deck[Card.Pa]
                                      == 0) and (self.deck[Card.Choki] > 0):
         return Card.Choki
     if (self.deck[Card.Gu] > 0) and (self.deck[Card.Pa] >
                                      0) and (self.deck[Card.Choki] == 0):
         return Card.Gu
     return card.random()
コード例 #5
0
    def next(self, fight_history: List[Fight]):
        n = len(fight_history) + 1
        if n % 3 == 1:
            return card.random()

        if self.prev_card is None:
            self.prev_card = Card.Gu
            return Card.Gu

        self.prev_card = card.next(self.prev_card)
        return self.prev_card
コード例 #6
0
ファイル: fighter.py プロジェクト: mh-northlander/procon
 def nextcard(self, fight_history) -> Card:
     return card.random()