Onboarding - Puzzle discussion


#111

is it helpful for a newbie in any language…


#112

same problem how to do it… :confused:


#113

I dont’ know what is wrong with this code, in the first case works but it doesn’t in the second becouse the cannon become too slow. please any1 help me!!!

Edit: No full code :stuck_out_tongue:


#114

You should use the provided code, it give you both enemy every turn. :slight_smile:


#115

READ BEFORE POSTING, thanks :dizzy_face:


#116

IS this web site learn us how to use differents langages without any knowledge ? or not


#117

Not at the moment, you’ll have a basic default template code which help you with input and loop of each language, but for the specifics, you’ll have to use google, which will provides you with dozens of tutorials.

Keep coding :wink:


#118

Erm I don’t know what to do here :smiley:


#119

this is the code i used in C

NO FULL CODE

it gave me error msg of’Timeout: your program did not provide an input in due time.’ … please tell me why ?


#120

Hello,
I’m trying to compile this code in C# and get error msg “Input string was not in a correct format”.

int? dist1 = int.Parse(Console.ReadLine()); // distance to enemy 1
            int? dist2 = int.Parse(Console.ReadLine()); // distance to enemy 2

Here I am testing first case - If one enemy is empty or distance is null, should return another enemy.

if ((dist1.Value==null) ||(String.IsNullOrEmpty(enemy1)))
 Console.WriteLine(enemy2);
            else if ((dist2.Value == null) || (String.IsNullOrEmpty(enemy2)))
            Console.WriteLine(enemy1);

Please help me


#121

You should both remove the last if.


#122

Hi,
In this problem I´m trying to use C language,I acomplished the first part, but can´t solve the second one because the fifth spaceship hits me…How can I do to make my canon faster?


#123

You can’t.
You shoot each turn and you must shoot the nearest enemy.


#124

I´m pretty sure I´m shooting the nearest enemy…Still can´t find any error…


#125

Read again this thread?
Send me your code?


#126

How can I solve the tutorial?


#127

It should be easy.
If you really need help, you should read again this tread and maybe these puzzles.


#128

Help Me Please This code isn’t working and I don’t know why!

EDIT: Why can’t you read the numerous no full code in the above messages?


#129

This code looks good to me. What problem are you experiencing?


#130

WOW I had an error message saying that enemy1 is not one of the enemies listed, but then I deleted everything and pasted it back in and now it works! Thanks for responding though!