Skip to content

Instantly share code, notes, and snippets.

@JacobFischer
Last active March 26, 2020 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobFischer/00febcc809e42c95f172d93c6f0698b6 to your computer and use it in GitHub Desktop.
Save JacobFischer/00febcc809e42c95f172d93c6f0698b6 to your computer and use it in GitHub Desktop.
AC: NH bells gained by chances
import matplotlib.pyplot as plt
# all bells are in thousands (k)
CHANCES = [0.20, 0.25, 0.30, 0.333, 0.35, 0.40] # some nice round %s to plot
MAX_AMOUNT = 10
MAX_BELLS = 100
for chance in CHANCES:
all_bells = []
for bells in range(MAX_BELLS):
prob = chance if bells > MAX_AMOUNT else 1
expected_bells = 3 * bells * prob + MAX_AMOUNT * 3 * (1 - prob) - bells
all_bells.append(expected_bells)
plt.plot([r for r in range(MAX_BELLS)], all_bells)
if chance == CHANCES[0]:
maximized = max(all_bells)
plt.text(all_bells.index(maximized), maximized,'{}k bells'.format(all_bells.index(maximized)))
plt.title('Animal Crossing New Horizons\nexpected bells gained by chances'.format(MAX_AMOUNT))
plt.legend(['prob {:.1%}'.format(c) for c in CHANCES])
plt.ylabel('Expected Bells Gained (in thousands)')
plt.xlabel('Bells Planted (in thousands)')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment