Onboarding - Puzzle discussion


#131

I can’t do it!! I don’t know what to do :’(


#132

Hi. I am new to this website and coding game. I have no idea how to kill the enemy using the java programming in practice session. Any one can help me out with this.
I will be greatfull to them.

Thank you.


#133

Search how to print a string.


#134

Hi guys i am completely new here i am just not getting what to do in this site although it looks good but i just can’t figure out i know i have to code but I am not getting it about input and output can anybody help?


#135

Read again the template code.


#136

You need to read from the standard input and write to the standard output. You only need to write the correct if and modify a bit the print statement.


#137

It’s my first try here. But it frustrates me. My C++ code are below. I think it’s ok even if there are only two enemies. It’s ok in my debug IDE. But I cannot understand the message ‘Your output ‘enemy’ is not one of the remaining ship names.’
Please help.

EDIT: NO FULL CODE :stuck_out_tongue:


#138

This puzzle have been simplified a lot to become a tutorial and it looks like you are using the old template. Now you are only given 2 enemy ships and need to print the name of the one that is the closest.

You should click on the reset button that is on the top right of the text editor.


#139

Hey can someone help me. I have this code and I don’t know what else to do.

NO FULL CODE

Thanks!


#140

Try to explain your problem or what you did, do not copy/paste your full code here.


#141

The problem is that when I run the program Thor does not move at all. I think it has to do with the end of the code, but I don’t know what part is wrong.


#142

Which program?

From what I remember, you wrote something like:
directionToPrintX = E

The way you wrote E is like a variable. Try putting writing ‘E’ or “E” instead, to say you are writing strings.

I did say “no full code” but you can still display some lines.
You can show us the line that you use to print, or how you bind “N” for north direction.

Just few limited part of your code that do not give the solution to thers is fine :wink:


#143

I did what you said with the ‘E’ thing and here is what happened. just a little code.
var directionX();
var directionY();
if{
        thorX > lightX
        directionX = ‘W’
}
here is the error I got

missing ; before statement: var directionX();


#145

Maybe the tutorial should have more instructions like step by step


#146

What language is this? Javascript?

I think you are confusing expressions and statements.

A program is a sequence of statements. The statements are seperated by semicolons. Creating a variable is a statement that has to look like this var NAME; or var NAME = EXPRESSION;. An If-Statement has to look like this: if (EXPRESSION) STATEMENT or if (EXPRESSION) STATEMENT else STATEMENT. Statements can be replaced with blocks of statements like {STATEMENT-0 [...] STATEMENT-N}. Expressions are everything that can be evaluated to a value like 2+5 or x<10 or a functioncall like Math.sin(alpha). Functioncalls like NAME() or NAME(ARGUMENT-0, [...] ,ARGUMENT-N) can also be used as statements, because they can have side effects.

So … your first two lines are not valid variable declarations, because of the parentheses. And the test expression in your IF-Statement is missplaced.


#147

So do you mean I should do something like this:

var directionX;
var directionY;
    if(thorX > lightX){
        directionX = ‘W’
    }


#148

Yes, that looks good.


#149

ok I did that to the rest of my directions, and now this is my error:

thorX = directionX;
thorY = directionY;
print directionX;
print directionY;

missing ; before statement: print directionX;


#150

this code work for only one enemy next test don’t know how to implement all those enemys


#151

[quote=“mineboys00, post:149, topic:119, full:true”]
print directionY;[/quote]
You are still struggling with the syntax. print is a function. This line should be a functioncall.

You probably should read a book or tutorial. Codingame doesn’t help you with learning the syntax.