The Descent - Puzzle discussion


Small hint…you need to code something that will work with all tests, not hardcoding all solutions and comment innapropriate code for each test…


This game does not have a good explanation. I do not understand how it works this games. They are not a real programming situations. I mean it is not logic what you can do just with a print “index”. if you are a real programmer go to HackerRank. It has much better tests.


i did on the mountain puzzle then i had to click test all something. how are u suppost to make each puzzple peace work? 1-5


You need to read the inputs and process it before doing print.
The inputs in this puzzle are eight integers.
You need to store them and then find the max value from them.

But this puzzle is not asking for the max value. It asks for the index of the max value. How to handle it depends on what data structure you are using.


Ive done a bubble sort on list and reversed the order while printing out, but it didnt work , are sorting algorythms too big of a tool to use on this exercise? i cant find much other choice than doing select sort in naive way on first exercise.
Sure i could use faster algorythm ,but decided to go easy on this one.


You are sorting the height values, and then output the max height?
Of course wrong!

As mention in my previous post, this puzzle asks for NOT the max height, but the index of the max height.

If you choose to use sorting as the solution, you have to sort heights tied with IDs. It can be done by a self defined structure, a class, two arrays, or some other designs your language allows.

At the same time, you can also explore any other algorithms that does not need sorting?


Hello I am trying to solve this problem in Java with following commands:
while (true) {

        int imax = 0;
        int max = 0;
        for (int i = 0; i < 8; i++) {
            int mountainH = in.nextInt(); // represents the height of one mountain.
            if (mountainH > max) {
                max = mountainH;
                imax = i;
        System.out.println("Debug messages...");  

I pass 1st turn successfully with a mountain height at 9 and then the ship auto destructs without hurting a mountain! It gives me following reason:
“Invalid command sent. It should be an integer from 0 to 7.”

I am quite puzzled as I think the command is ok, anybody can give me a hint or advice please?

Thanks and good day to all!


This line caused error because “Debug mess…” became the second output to puzzle. “D…” is not an integer expected by server.

Besides, you should print output multiple times. Now you are printing once only because you print it after game loop


Thx! I confirm it is working now :wink:


I think there is a glitch in this game because a number i did not type kept on repeating and repeating

what should i do?



You should review your code before incriminating the game. There is no glitch.

The problem is often between the chair and the keyboard. :wink: