New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winning: make someone's chance of winning proportional to points #73

Merged
merged 1 commit into from Jan 25, 2019

Conversation

Projects
None yet
4 participants
@jeffkaufman
Copy link
Owner

jeffkaufman commented Jan 24, 2019

Currently, each player had a 0.01% chance of winning per PR merged to master.

This PR changes chances to be proportional to points. Currently points are:

  jeffkaufman: 17
  pavellishin: 11
  shaunagm:    10
  sligocki:    10
  tnelling:    12
  vesche:      10

So this PR, today, would give chances of winning of:

  jeffkaufman: 0.017%
  pavellishin: 0.011%
  shaunagm:    0.010%
  sligocki:    0.010%
  tnelling:    0.012%
  vesche:      0.010%

Also fix a bug where I wrote RuntimeException instead of Exception. Too much Java!

Here's what it looks like if you run it until it hits someone:

./run.sh
TRAVIS_REPO_SLUG='jeffkaufman/nomic'
TRAVIS_PULL_REQUEST='false'
TRAVIS_PULL_REQUEST_SHA=''

validate.py:
Points:
  jeffkaufman: 17
  pavellishin: 11
  shaunagm: 10
  sligocki: 10
  tnelling: 12
  vesche: 10
Traceback (most recent call last):
  File "validate.py", line 305, in <module>
    start()
  File "validate.py", line 300, in start
    determine_if_winner()
  File "validate.py", line 295, in determine_if_winner
    raise Exception('%s wins!' % user)
Exception: tnelling wins!

@vesche vesche assigned vesche and unassigned vesche Jan 24, 2019

@vesche vesche self-requested a review Jan 24, 2019

@vesche

vesche approved these changes Jan 24, 2019

@vesche

This comment has been minimized.

Copy link
Contributor

vesche commented Jan 24, 2019

This is neat 👍

@pavellishin

This comment has been minimized.

Copy link
Collaborator

pavellishin commented Jan 24, 2019

If my understanding is right, this means that the first person to 100,000 points wins?

@jeffkaufman

This comment has been minimized.

Copy link
Owner Author

jeffkaufman commented Jan 24, 2019

@pavellishin yes, though someone could win before getting that many points

@jeffkaufman jeffkaufman merged commit 27f5d24 into master Jan 25, 2019

@jeffkaufman jeffkaufman deleted the points-winning-chance branch Jan 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment