Ski Jump
Description:
You are a skier (marked below by the X
). You have made it to the Olympics! Well done.
\_\_\_X\_
\*\*\*\*\*\
\*\*\*\*\*\*\
\*\*\*\*\*\*\*\
\*\*\*\*\*\*\*\*\
\*\*\*\*\*\*\*\*\*\\.\_\_\_\_/
Your job in this kata is to calculate the maximum speed you will achieve during your downhill run. The speed is dictated by the height of the mountain. Each element of the array is a layer of the mountain as indicated by the diagram above (and further below). So for this example the mountain has a height of 5 (5 rows of stars). Speed
is mountain height * 1.5
.
The jump length is calculated by (mountain height * speed * 9) / 10
. Jump length should be rounded to 2 decimal places.
You must return the length of the resulting jump as a string in the following format:
- when less than 10 m:
"X metres: He's crap!"
- between 10 and 25 m:
"X metres: He's ok!"
- between 25 and 50 m:
"X metres: He's flying!"
- when more than 50 m:
"X metres: Gold!!"
So in the example case above, the right answer would be "33.75 metres: He's flying!"
Sadly, it takes a lot of time to make arrays look like mountains, so the tests wont all look so nice. To give an example, the above mountain would look as follows in most cases:
[*****, ******, *******, ********, *********]
Not as much fun, eh?
p.s. if you think "metre" is incorrect, please read this
Similar Kata:
Stats:
Created | Sep 29, 2016 |
Published | Oct 24, 2016 |
Warriors Trained | 2025 |
Total Skips | 23 |
Total Code Submissions | 4264 |
Total Times Completed | 1145 |
JavaScript Completions | 658 |
Ruby Completions | 77 |
Crystal Completions | 9 |
CoffeeScript Completions | 10 |
Python Completions | 430 |
Total Stars | 21 |
% of votes with a positive feedback rating | 84% of 257 |
Total "Very Satisfied" Votes | 191 |
Total "Somewhat Satisfied" Votes | 51 |
Total "Not Satisfied" Votes | 15 |
Total Rank Assessments | 18 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |