Beta

League Player Rank

Description:

There is a Sports League, where the committee is recording the scores of each player in every game.

The objective of this Kata is to determine who is the player on a particular given rank from the provided Player Standing List.

The rank criteria is determined depending who has the heighest score with the least number of games. In cases when there are multiple players having the same score and number of games, the rank will be determined on their position on the Players Standing List.

Example:

Player Standing List: 'Mike', 'Chris', 'Arnold'
Record Game Score: 'Mike' - 2
Record Game Score: 'Arnold' - 5
Record Game Score: 'Chris' - 5
Record Game Score: 'Mike' - 3

$player1 = playerRank(1, $this->standings);  

In this example, The Players Standing List is shown as follows, Mike, Chris, Arnold. All players have the same score (which is 5). Only Arnold and Chris had played only 1 game. The given rank is 1 in playerRank(1, $this->standings) and since Chris is 2nd and Arnold is 3rd in the Players Standing List, Chris is Rank 1.

Sorting
Arrays
Algorithms

More By Author:

Check out these other kata created by adromil

Stats:

CreatedJul 26, 2018
PublishedJul 27, 2018
Warriors Trained132
Total Skips31
Total Code Submissions124
Total Times Completed4
PHP Completions4
Total Stars0
% of votes with a positive feedback rating50% of 2
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes0
Total Rank Assessments3
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • adromil Avatar
Ad