Skip to content
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

How can I test your code? #3

Open
alexandreag82 opened this issue Dec 14, 2018 · 1 comment
Open

How can I test your code? #3

alexandreag82 opened this issue Dec 14, 2018 · 1 comment

Comments

@alexandreag82
Copy link

I need thing like this, but I'm beginner in python.
How can I test your code?

I need print new rating (Player A have 2162 and will play 6 games)
exp += expected(2162, 2395)
exp += expected(2162, 2334)
exp += expected(2162, 2311)
exp += expected(2162, 2323)
exp += expected(2162, 1600)
exp += expected(2162, 1600)

@phecdaDia
Copy link

Is this a general question about how to print something with python or how to use the functions this provides?
If you just want to print anything you can use the print function.

print('Some text')
print(123)

If you want to use the functions, look at the readme.
Here's a full example.

# import both functions
from elo import expected, elo

# calculate exp
exp = expected(2162, 2395)
exp += expected(2162, 2334)
exp += expected(2162, 2311)
exp += expected(2162, 2323)
exp += expected(2162, 1600)
exp += expected(2162, 1600)

# win_score is determined by giving 0 points for a lost, 0.5 for a drawn, and 1 for a won match
win_score = 2.5 # I just set it to a dummy value

# now calculate the new elo for your player
new_elo = elo(2162, exp, win_score, k=32)
# and print it
print(new_elo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants