use_logging("test", stdout=False, fout=False, fpath="test.log", mode='w') simulator = EvasionSimulator("ROUND-01") team1 = MyTeam1("Team#1") team2 = MyTeam2("Team#2") print(team1) print() print(team2) # Observe how the positions of team2 changes for i in range(5): team2.arrange(team1) print(team2) examiner = TeamExaminer() examiner.check(team1, "ROUND-01") examiner.check(team2, "ROUND-01") n_team1, n_team2, n_draws = simulator.play(team1, team2, 20, 10) print("Number of Team1 wins:", n_team1) print("Number of Team2 wins:", n_team2) print("Number of draws:", n_draws) print() if n_team1 > n_team2: print("Team #1 wins!") elif n_team1 < n_team2: print("Team #2 wins!") else: print("Two teams draw...")
class MyTeam2(Team): def initialize(self): for i in range(10): unit = Defender1(self, "A-Unit%02d" % (i + 1), i) self.units.append(unit) def arrange(self, enemy: Team): pass class MyTeam3(Team): def initialize(self): for i in range(10): unit = Defender3(self, "A-Unit%02d" % (i + 1), i) self.units.append(unit) def arrange(self, enemy: Team): pass if __name__ == "__main__": team1 = MyTeam1("Team#1") team2 = MyTeam2("Team#2") team3 = MyTeam3("Team#3") examiner = TeamExaminer() examiner.check(team1, "ROUND-02") examiner.check(team2, "ROUND-02") examiner.check(team3, "ROUND-02")
def test_team(self): team = get_team() examiner = TeamExaminer() self.assertTrue(examiner.check(team, "ROUND-03"))
def test_team(self): team = MyTeam("👑") examiner = TeamExaminer() examiner.check(team) examiner.check(team)
def test_team(self): team = RAKSTeam("RAKSTeam") examiner = TeamExaminer() examiner.check(team, "ROUND-02") examiner.check(team, "ROUND-02")
def test_team(self): team = hunsu("MyTeam") examiner = TeamExaminer() examiner.check(team) examiner.check(team)
def test_team(self): team = NoobTeam("Hello LOA") examiner = TeamExaminer() examiner.check(team)