Skip to content

Instantly share code, notes, and snippets.

@vinimonteiro
Created November 24, 2020 12:27
Show Gist options
  • Save vinimonteiro/a8471cde569ac5c335456b5427d86701 to your computer and use it in GitHub Desktop.
Save vinimonteiro/a8471cde569ac5c335456b5427d86701 to your computer and use it in GitHub Desktop.
Logic responsible for handling away-from-the-ball-rule
if bad_ft_shooter_with_ball >= random.randint(0,100):
if opp_bad_ft_pc >= random.randint(0,100):
points_down += 1
if opp_bad_ft_pc >= random.randint(0,100):
points_down += 1
have_ball = True
elif ft_rb_pc >= random.randint(0,100):
have_ball = True
else:
# RULE: one free throw and no option for rebound and the ball remains with winning team.
if opp_ft_pc >= random.randint(0,100):
points_down += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment