Onboarding - Puzzle discussion


#91

Ok nevermind the instructions are updated but the template is not. I had to remove the default template.


#92

what is the code for the test case “one enemy” in c to understand next what to do…


#93

Read the template, try some test cases, print some debug messages…


#94

Hello everyone,

I am programming in JavaScript and have basic knowledge about the syntax.

However, I am confused as this code:

 // game loop
while (true) {
    var enemy1 = readline();
    var dist1 = parseInt(readline());
    var enemy2 = readline();
    var dist2 = parseInt(readline());

    // Write an action using print()
    // To debug: printErr('Debug messages...');

if(dist1 < dist2){
    print(enemy1);   
} else{
  print(enemy2); 
}


    print('HotDroid');
    
}

only seems to work for test case 1. In case 2, however, it seems to be too slow to detect the Sectoid in step 7/8 which is already in close distance.

  1. Can I refer to any of distance of the ships other than enemy1 and enemy2?

  2. Which JavaScript language elements are available/not available?

I am very thankful for any hints :slight_smile:


#95

hint: what is print('HotDroid'); doing in your code? read above for the solution

@nicolas_patrois kudos for being so patient with all the people here that don’t listen/read.


#96

Thank you very much for your help!

I was not intending to bother anyone with my question, I just did not find an answer related to JavaScript. If I overlooked it, sorry for that :wink:

Generally, I am not the person posting without at least trying to understand previous comments. Nevertheless, I am just a human being and thus error-prone :-p


#97

It’s a part of my everyday work.


#98

Sorry I didn’t mean to offend you, it was mostly directed to those who say:

Help! I don’t have patience to read, I haven’t code anything yet but i’d be glad if someone can hold my hand.

If you explain what is your problem precisely and what you have accomplish and stuff, that’s the right way to post here :smiley: Basically follow the guidelines of posting on stackoverflow, those who don’t post any relevant work in their question get stoned there too.

Not really, you’re not a moderator :slight_smile: but I love it, people like you keep this community alive, keep up the good work


#99

Add this in the code

if(dist1<dist2){
System.out.println(enemy1);
}else
System.out.println(enemy2);
}


#100

Add this to code

 if(dist1<dist2){
                   System.out.println(enemy1);
                }else
                System.out.println(enemy2);
            }

#101

My every day work, the one I that gives me money. :wink:


#102

EDIT MOD: No, please formulate your question in order to explain what you did, not just your code copy paste, no full code is allowed so that other people don’t copy it

I wrote this code…can you help me where is the fault?


#103

No & for ints.


#104

sorry i dont understand your reply…


#105

No & for ints in scanf.


#106

How can i test my new code in code of rings again


#107

they said you should wait until they reissue code of rings puzzle


#108

How can you delete your account?


#109

i am new to this codingame forum . plzz help me , i dont knw what to do in the first game that is " one enemy " …


#110

Please read again this thread, the explanations and the template code. :wink: