Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions utils/rngdle.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get_tier_color(tier: Tier):

def get_score_percent(score: int):
# Find the index to the highest know score that is lower than given score
score_idx = bisect.bisect_left(KNOWN_COMPRESSED_SCORES, score) - 1
score_idx = bisect.bisect_right(KNOWN_COMPRESSED_SCORES, score) - 1
score_idx = max(score_idx, 0)
percent_score = KNOWN_COMPRESSED_SCORES[score_idx]
# Return it's percent
Expand Down Expand Up @@ -377,6 +377,12 @@ async def fetch_user_rolls(
action="store_true",
)

arg_parser.add_argument(
"--get-score-info",
help="Give an overview of informations that can be deduced from the given score",
type=int,
)

args = arg_parser.parse_args()

if args.compress_score_table:
Expand All @@ -385,4 +391,8 @@ async def fetch_user_rolls(
store_compressed_score_to_percent_table(compressed_score_to_percent)

if args.update_score_table:
update_compressed_score_to_percent_table()
asyncio.run(update_compressed_score_to_percent_table())

if args.get_score_info is not None:
score = typing.cast(int, args.get_score_info)
print(f"Score: {score}, Tier: {get_score_tier(score)}, Percent: {get_score_percent(score)}")
Loading