Onboarding - Puzzle discussion

Ah, that threw me off… I kept trying to resubmit my old solution that used to work and I was so confused.

1 Like

well that was confusing. I did the same as jchen030. tbh I kind of miss the old solution.

Please fix the haskell template … it doesn’t parse the inputs correctly (http://www.codingame.com/forum/t/hostage-rescue-part-1-training-haskell-template-code-bug/396)

EDIT: no full code, see the FAQ

printf("%s", enemy1);

I modified the default code for the ‘onboarding’ game. Every time I run this code it just says ‘Lost!’. I don’t understand if I am doing anything wrong or there is any problem with this code?

What you missed is actually written in default code comments: :wink:

6 Likes

doing this in school

2 Likes

Hi.

Without a list of valid system calls this is simply a waste of time and energy. The concept is great but unless there is any proper documentation it is just f*ng guesswork.

For instance, according to the guide if one prints or echoes the command SHOOT it should fire. But it doesnt. SHOOT\n in small as well as large caps do nothing. Not even producing errors.

Why does (in php) echo (“shoot”); do nothing? Why does echo $enemy1 do nothing?

Where the hell do I go to bugtest and/or see where I go wrong?

Hi,
What puzzle are you talking about ? $enemy1 seems to refer to Onboarding, but i didn’t see any command SHOOT.

if dist1 is smaller than dist2
    print enemy1
else
    print enemy2

I just quoted the onboarding puzzle, which i guess you’re refering to. The ‘system calls’ as you are refering to are either echo(“$enemy1\n”); or echo(“$enemy2\n”); and it’s your job to find out when you should order to fire on the first enemy, and when on the second. (based on the distance)

So it is not a

like you said, it all about logic and AI, and the output expected is written in the left. You may wanna try to calm down and try using the forum if you are in trouble, but swearing isn’t going to solve anything.

I hope I could help you understand your concern, and wish you to solve many more puzzles.

Keep Coding

Its onboarding. Solved it now.

Either way, I think a clearer instruction would be in order.

Maybe a more general explanation of how games are written would do the trick.

how to play this.. pls give any tuitorial video link

sir i cannot complete the fist tutorial program i think i didnot understand the question well
could you help me by explaining the question in more elaborated way…

CodinGame planet is being attacked by slimy insectoid aliens.

1 Like

What language are you trying to use?

There is an error in the standard code for Perl

it automatically chomps the input so when you just return them it doesn’t recognize the names even if they are printed.

Hi, got a little bit stuck. I am new to programming but I feel this might be the best way to learn.

So I have the following code to count the number of ships

      while (true) {
        int count = in.nextInt(); // The number of current enemy ships within range
        in.nextLine(); 
        if (count == 0) { //If the count is zero, restart from while
            continue;
        }

However it keeps throwing an input mismatch error (for the count) - this is the same code as the one provided for dist1 and dist2. Why is this not working?

I am assuming this code works like this:

Get next integer input from the scanner (system.input) and ‘count’ will have a value of that integer. Any tips on where I;'m going wrong would be sweet. (Using Java)

i want to learn how to play !?!?

Hello guys, i am new member ,i don’t know what i have to do to finish the topic

1 Like

To finish the topic, you can read the fifty five posts from the beginning. :wink:
Instead, you can read again the instructions given on the left of the edit window.

Why can’t I use “strcpy()” or “strlen()” in my solution. This doesn’t make any sense for me, because how else am I going to save the name of the closest bot in my custom variable (“target” for example). I am using C++ if it isn’t clear.