At the start of each game turn, you are given the height of the 8 mountains from left to right. By the end of the game turn, you must fire on the highest mountain by outputting its index (from 0 to 7).
Firing on a mountain will only destroy part of it, reducing its height. Your ship descends after each pass.