Your formula is close, but not quite (based on your description). Your formula always awards 100 points for 1st place, but your description says 1st place gets 90 points if only 9 players enter. Here's a formula that adjusts based on entries:

`(n - r + 1) * 10 + numberOfHits`

or

`position * 10 + numberOfHits`

The above formulas will also award points to players beyond 10th place. If you want to limit points to the top 10 (which your formula does), wrap it in the `if()` function, like you did:

`if(rank <= 10, position * 10 + numberOfHits)`