April 2020
Intermediate to advanced
380 pages
9h 24m
English
The file that's responsible for governing the facilitation of gameplay in the program is the util/arena.py file.
It defines the following two methods within the Arena class:
def fight(self, state, p1, p2, count): stats = [0, 0, 0] for i in range(count): print('==== EPS #{} ===='.format(i + 1)) winner = self._fight(state, p1, p2) stats[winner + 1] += 1 print('stats', stats[::-1]) winner = self._fight(state, p2, p1) stats[winner * -1 + 1] += 1 print('stats', stats[::-1])
The preceding fight() function manages the stats of victories/losses or ties for the players. It ensures that in each round, two games are played, where each player gets to play first only once.
The other _fight() function that was defined in this class ...
Read now
Unlock full access