Execution results in Failure End of Line

Hey Coders,

I am trying the Crime Scene puzzle in PHP and have a solution that is generating the correct numbers for all test cases.

However when running the test cases, The console reports failure:

Found: 8752End of line (\n)
Expected: 8752Nothing

I have tried various combinations of adding or removing new line chars from the output and have tries print, print_r and var dump too. Weirdly if I add text after the number the expected line changes:

Found: 8752da…
Expected: Nothing

but if I add text before:

Found: dave8…
Expected: 8752

What gives and how come the expected output keep changing?

1 Like

While all of that is true it doesn’t really answer my question(s).

  1. How do I suppress the end of line I am not adding?
    in all other puzzles I have not had this issue. I am using the same output code and have tried variations on a theme. I SUSPECT that the validation scripts are in error for this puzzle.
  2. Why are the expected results changing dependant on the out put?
    expected answers should always be the same, if it is expecting 8752 that that is what it is expecting. It should nit matter what I out put whether it is longer, shorter or just plain wrong, the expectation should be the same. The found element of course should reflect what it found and I see the abbreviation for your answer is too long, and like it.

while it’s PHP you have to remove any additionnal charactere before and after PHP tag because it is considerate as a stantard output, to avoid this you can also remove the tag to close the script ?>