Onboarding - Puzzle discussion


Hey @ShadiMirza,

Rock should be the first one you kill. Aren’t you killing the farthest one, instead of the closest one?


Absolutely right. I figured it out a couple of days ago. Thanks for responding, though. :smile:


who can give me the correct pragram?thanks!


I think that I’ll be too expensive for you.


so, basically, i can win shooting one more distant enemy all the time? because from two closest every one is close enough? older variant with finding minimal distance in array of enemies i liked more


You have the choice between only two enemies, if you do not kill the closest one, you’ll not succeed the onboarding.

But you can avoid always killing the closest one. That can lead to really close games. I just did this one: https://www.codingame.com/replay/solo/60109970

The aim of the onboarding is to understand how the IDE works. Having a more complex game would just ruin this aim.


can anyone help me with the level Onboarding i am using the Python language thank you


We can help you. What is your problem?


Ok I’m not 100% new to programming languages. However I’m having a minor issue. There has to be a simpler way of coding out the enemy names vs. doing them 1 at a time in Console.WriteLine(“Name1”); and so forth. I’m just not seeing it.
Any pointers?


In onboarding, you have four variables:
dist1, dist2, enemy1, enemy2.

enemy1 and enemy2 are variables containing the name of your enemies so you should use them, instead of hard coding enemy name.


Oh, who can give me the answer for the first game “one enemy” in C language?


I can give it to you.


I have a problem in java language with this line :
int count = in.nextInt(); (line 23
he give me the error :
//Exception in thread “main” java.util.InputMismatchException
at java.util.Scanner.throwFor on line 864
at java.util.Scanner.next on line 1485
at java.util.Scanner.nextInt on line 2117
at java.util.Scanner.nextInt on line 2076
at Player.main on line 23 //
if I delete the line my program works for the first test but not for the rest


Hey, any help would be awesome.
I’m doing it in C, not C#. I’m sure it’s something obvious, but I can help but feel like this just needs a simple if/else , but the game wont recognize “enemy2” as ship.
Here is the code:


Any help would be awesome. Thanks.


See here. It’s another language, but you are making the same mistake.

Is that comment from the auto generated template?

// printf("name of the enemy\n"); // You have to output a correct ship name to shoot ("Buzz", enemy1, enemy2, ...)

No wonder this mistake comes up so often. :slight_smile:


That did help. Thanks.



Can you pls teach me the first things to know in editing the script there? I want to learn how to program.


CodinGame is the gaming platform for programmers. Solve programming puzzles, improve your skills, share, have fun.

Codingame is a great place to improve your coding skills, not so much to actually learn how to code (except maybe as a teaching material). I don’t know if Google agrees with me, but sites such as CodeCombat are better suited to learn the bases (old fashioned computer sciences courses at school are also great by the way).


how to play


read the f***ing manual