[SOLVED] Hunger games


#1

Hello all,

I have a problem with the easy puzzle “Hunger games” in PHP :
I want to return an empty line, for make a return like this between each tributes :
Name: Bowser
Killed: None
Killer: Mario

Name: Mario
Killed: Bowser
Killer: Winner
But with an “echo(“Killer: Mario\n”);echo("\n");”, I have this error :
Find: Killer: WinnerEnd of line (\n)
Waiting : Killer: WinnerNothing
If you have an idea of how to do?

Thanks


#2

Hello Roro, please add link to the puzzle you seek help.

Nevertheless, this puzzle does not accept end of line for the last line of your output.
So you need to change your code to deal with this.


#4

Here is the puzzle : https://www.codingame.com/ide/puzzle/hunger-games
I tried a lot of things, but nothing works, that’s why I post here :slight_smile:


#5

Pretty clear for me. It’s says that the output ends with “end of line” while it should ends with “nothing”.
Have you tried to replace your echo("\n") with nothing (e.g. remove it :wink:)


#6

Yes, I understand what you say, but the problem is this : I need to put one clear line between the two blocs of tributes.
But I can’t put a double “\n”, it make an error :confused:

EDIT: problem solved


#8

For example you could use this inside the for cycle of tributes:
if (i<tributes-1)
{
Console.WriteLine();
}