Skip to content

Instantly share code, notes, and snippets.

@evdokimovm
Created January 17, 2024 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evdokimovm/73536400c76fe1d04e3738140c7a5da1 to your computer and use it in GitHub Desktop.
Save evdokimovm/73536400c76fe1d04e3738140c7a5da1 to your computer and use it in GitHub Desktop.
get rainbow six siege r6s rank by rp mmr ranked points
def value_to_rank(RP):
titles_list = ['Copper', 'Bronze', 'Silver', 'Gold', 'Platinum', 'Emerald', 'Diamond', 'Champion']
min_value = 1000
rank_interval = 500
increment = 100
if RP <= 1000:
return 'Copper 5'
if RP >= 4500:
return 'Champion'
rank = (RP - min_value) // increment
title_index = (RP - min_value) // rank_interval
rank_index = 5 - (rank % 5)
return (title_index, rank_index, f'{titles_list[title_index]} {rank_index}', RP)
print(value_to_rank(2500))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment