Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def simularPartido( lineup ):
carreras_partido = 0
aparicion = 0
for inning in range( 0, 9 ):
outs = 0
estado = '---'
while outs < 3:
bateador_en_turno = lineup[aparicion % 9]
evento = simularAparicion( bateador_en_turno )
if evento == 'out':
outs += 1
else:
estado = const.transicion[evento][estado]
carreras_partido += const.carreras[evento][estado]
aparicion += 1
return [ carreras_partido, aparicion ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment