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

Fix Jacob's Contest Estimate giving incorrect values when the score number is cut off #1239

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

IamMusavaRibica
Copy link
Contributor

Bug:
image
image

Fix:
image
image

Copy link
Member

@NopoTheGamer NopoTheGamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't test but the good looks good

@IamMusavaRibica
Copy link
Contributor Author

IamMusavaRibica commented Jul 11, 2024

Here's an explanation for those who don't want to spend time thinking about it:
A , is put before last group of digits. If lastComma = n, then indexes of the characters up to the comma are 0, 1, ..., n and the last digits have indexes n+1, n+2, n+3, therefore amount.length() should equal n+4, but if digits are missing, it's smaller, so amount.length() = n+1+visibleDigits, from where we can get visibleDigits = amount.length() - lastComma (n) - 1, and 3 - visibleDigits is how many zeroes we have to add. I tested it in a real contest
image
and it gave correct results. the (detected line: ) in this image shows the amount variable

@nea89o nea89o merged commit d16616f into NotEnoughUpdates:master Jul 11, 2024
6 checks passed
@IamMusavaRibica IamMusavaRibica deleted the contestestimatefix branch July 11, 2024 14:43
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.

3 participants