Exemplo n.º 1
0
 def execute(self, options: argparse.Namespace) -> None:
     self.game_path = Path(options.game_file)
     if 'seed' in options:
         self.seed = options.seed
     data = ch13_r05.roll_iter(options.games, self.seed)
     ch13_r05.write_rolls(self.game_path, data)
     print(f"Created {str(self.game_path)}")
Exemplo n.º 2
0
 def execute(self, options: argparse.Namespace) -> None:
     if 'seed' in options:
         self.seed = options.seed
     if 'games' in options:
         self.games = options.games
     data = ch13_r05.roll_iter(self.games, self.seed)
     game_statistics = ch13_r06.gather_stats(data)
     print(game_statistics)
Exemplo n.º 3
0
 def execute(self, options: argparse.Namespace) -> None:
     self.game_path = Path(options.game_file)
     data = ch13_r05.roll_iter(options.games, self.seed)
     ch13_r05.write_rolls(self.game_path, data)
     print("Created", self.game_path)
Exemplo n.º 4
0
def summarize_games(
        total_games: int, *, seed: int = None
    ) -> Counter[Outcome]:
    game_statistics = gather_stats(
        roll_iter(total_games, seed=seed))
    return game_statistics