Exemple #1
0
    def testRandom(self):
        """

        """
        env = SevenKingEnv()
        env.num_normal_players = 2
        players = [roomai.common.RandomPlayer() for i in range(2)]

        for i in range(100):
            SevenKingEnv.compete(env, players)
Exemple #2
0
    def testScores(self):
        """

        """
        env = SevenKingEnv()
        env.num_normal_players = 3

        print("aaa")
        players = [
            AlwaysFoldPlayer(),
            AlwaysFoldPlayer(),
            AlwaysNotFoldPlayer()
        ]
        scores = env.compete(env, players)
        print(scores)

        self.assertEqual(scores[0], -1)
        self.assertEqual(scores[1], -1)
        self.assertEqual(scores[2], 2)