Ocean of Code - Puzzle discussion

You should try using the </> button on the formatting toolbar. Also, posting the full code is usually discouraged on the forum, especially for multi-player games.

Please be specific about what you mean by “it doesn’t work”. An error message pops up? Your calculation is different from actual outcome? Or what? If relevant, please provide the link to one of the replays as well.

Ok the part I think is broke is:

if opp_life < startLife and my_Order[1] == 'TORPEDO':
      if startLife - 2 == opp_life:
            startLife -= 2
            possible_locations = [my_Order[0]]
        else:
            possible_locations = []
            startLife -= 1
            for num in range(0, 15):
                for num2 in range(0, 15):
                    if str(num)+' '+str(num2) == my_Order:
                        possible_locations.append(str(num)+' '+str(num2))
                    else:
                        wait = True

This is suppose to figure out if I hit the enemy. The first part works but when I get an Indirect hit that part of the code does not work. startLife is a variable I created that is equal to 6. my_Orders is a list with A: a location and B: wether or not it was a torpedo.

Here is a replay. I changed my code a little so that It should print the list possible_locations when I get an indirect hit.
Game Replay - CodinGame

Have you tried adding some debug statements in your code to see if anything deviates from what you expect it to be?

Guys is it still possible to advance to higher leauge in Ocean of code? I’m rank #1 in Wood 1… I would like to test my code in bronze leaugee but I cannot advance beyond my current ranking :confused:

If your score is higher than that of the boss of the league, you should be promoted. Sometimes there is a bug that prevents a promotion, and it may help if you re-submit your code. If that still doesn’t help, you may have to post a bug report in the CG Discord channel to ask the staff to help you fix it.

Next day or so after my post i advanced to bronze leage. But now I’m stuck at rank 1 in bronze leage. Scoring system doesn’t wanna let me pass to the silver xD

hi, I’m noticing some issues with the way the game is set up.
Often times, I will lose due to breaking some condition (such as going outside of the map), but there is no feedback on what condition I broke. This makes it hard to debug. The only condition I see an alert for is if I fire a torpedo too far.

Also, while running the trial, I will pause a game and look at the game info. It shows my Error messages, but applied to the other opponent instead of me.