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

Feat/ai #82

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Feat/ai #82

wants to merge 2 commits into from

Conversation

redice44
Copy link

Goal

  • Allow players to be controlled by simple AI logic

Notes

AI Toggle
Screen Shot 2020-10-11 at 6 41 07 AM

AI Logic

  • Determines number of dice rolls to attempt based on how "risky" it wants to be.

Resolves: #80

Player 1 cannot be AI :)
For every turn, the AI determines how "risky"
it will be.

How many times the AI will roll is based on the
probability of losing, its risk score, and a hard
modifier. I found that with no modifier the AI was
losing a lot.
@NicholasACTran
Copy link
Collaborator

Please provide documentation on how this AI works

@redice44
Copy link
Author

It calculates how many times it should roll based on the probability that it can successfully make that many rolls (how many times can it successfully not roll a 1 in a row). For example, if it randomizes a 10% "risk", then it will calculate how many rolls it can make before the risk of losing is too great.

The math risk = probability ^ numRolls. In the example it would be 0.1 = (5/6)^x. Since dice rolls are independent events, we just use the probability formula.

@NicholasACTran
Copy link
Collaborator

@redice44 Yes, but where is that documentation for any of that in the PR? I don't see any documented comments or changes to the README on how the AI is supposed to work

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

Successfully merging this pull request may close these issues.

Play agains AI
2 participants