Created
          January 17, 2024 12:33 
        
      - 
      
- 
        Save evdokimovm/73536400c76fe1d04e3738140c7a5da1 to your computer and use it in GitHub Desktop. 
    get rainbow six siege r6s rank by rp mmr ranked points
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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