made pitchers have to field outs too

This commit is contained in:
Sakimori 2020-12-29 20:25:41 -05:00
parent 7e2c275b6a
commit e5cd6ed65d

View File

@ -175,9 +175,12 @@ class game(object):
batter = self.get_batter() batter = self.get_batter()
if self.top_of_inning: if self.top_of_inning:
defender = random.choice(self.teams["home"].lineup) defender_list = self.teams["home"].lineup.copy()
else: 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["batter"] = batter
outcome["defender"] = "" outcome["defender"] = ""