Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

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

Merged
lineargraph merged 1 commit intoNotEnoughUpdates:masterfrom
IamMusavaRibica:contestestimatefix
Jul 11, 2024
Merged

Fix Jacob's Contest Estimate giving incorrect values when the score number is cut off#1239
lineargraph merged 1 commit intoNotEnoughUpdates:masterfrom
IamMusavaRibica:contestestimatefix

Conversation

@IamMusavaRibica
Copy link
Copy Markdown
Contributor

Bug:
image
image

Fix:
image
image

Copy link
Copy Markdown
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
Copy Markdown
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

@lineargraph lineargraph merged commit d16616f into NotEnoughUpdates:master Jul 11, 2024
@IamMusavaRibica IamMusavaRibica deleted the contestestimatefix branch July 11, 2024 14:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants