From e5cd6ed65dcc80050fcd9d0f1e660abe1bcc6f8a Mon Sep 17 00:00:00 2001 From: Sakimori Date: Tue, 29 Dec 2020 20:25:41 -0500 Subject: [PATCH] made pitchers have to field outs too --- games.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/games.py b/games.py index 2a75145..c692aa2 100644 --- a/games.py +++ b/games.py @@ -175,9 +175,12 @@ class game(object): batter = self.get_batter() if self.top_of_inning: - defender = random.choice(self.teams["home"].lineup) + defender_list = self.teams["home"].lineup.copy() else: - defender = random.choice(self.teams["away"].lineup) + defender_list = self.teams["away"].lineup.copy() + + defender_list.append(pitcher) + defender = random.choice(defender_list) #make pitchers field outcome["batter"] = batter outcome["defender"] = ""