Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The variable "isDiapason" is really confusing. I think it should name "isNotDiapason", isn't it?
C-style solution
The only problem I see is that you´re constantly recalculating the score of the topword unecessarily ;)
Although one of the longest answers, this is the truly the best practice. Code is understandable and easy to modify if needed.
Thank you for your comment. I will correct my answer.
I just looked over it quickly, but it looks like you are also checking if it is near interesting when it is already past an interesting number.
It should only check if an interesting number is within the next 2 mileage. It is not interesting anymore when it is past it.