コード例 #1
0
ファイル: example_02.py プロジェクト: junsoo08/loa
    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...")
コード例 #2
0
            
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")

コード例 #3
0
ファイル: balance.py プロジェクト: junsoo08/loa
 def test_team(self):
     team = get_team()
     examiner = TeamExaminer()
     self.assertTrue(examiner.check(team, "ROUND-03"))
コード例 #4
0
ファイル: team.py プロジェクト: daew0n/cau-osp2020-game
 def test_team(self):
     team = MyTeam("👑")
     examiner = TeamExaminer()
     examiner.check(team)
     examiner.check(team)
コード例 #5
0
 def test_team(self):
     team = RAKSTeam("RAKSTeam")
     examiner = TeamExaminer()
     examiner.check(team, "ROUND-02")
     examiner.check(team, "ROUND-02")
コード例 #6
0
ファイル: team.py プロジェクト: junsoo08/cau-osp2020-game
 def test_team(self):
     team = hunsu("MyTeam")
     examiner = TeamExaminer()
     examiner.check(team)
     examiner.check(team)
コード例 #7
0
 def test_team(self):
     team = NoobTeam("Hello LOA")
     examiner = TeamExaminer()
     examiner.check(team)