Defibrillators puzzle discussion

But exactly what is the problem?

I tried before with Math.PI(), and didnt pass the test.
I tried too with Math.round(Math.PI,-2) and Math.round(Math.PI,-4); and nothing.

:S

try to print your variable “radians”. And what you obtain as “degrees”.

The variables are ok, for example:
rad: 3.833542
dg: 219.64577718614063

rad: 3.87952263361082
dg: 222.28027343137802

The convert is ok, and i pass the test of coding phase. But when I submit one test is failde.
The most strange thing is, when I quit the round of the pi name, test 2 “complete file” fails when i put round to 4 decimals, test 2 pass but 3 fails.

Pbbly is a round problem, but i have no idea how put the code to pass both test.
Do u have any idea?

If I dont get the solution pbbly i ll change the language.

Thx for ur comments.

PD: sry for my english :confused:

I want to help you without spoiling you the issue. Look at what you convert. And the values of rad and dg. Don’t they seem weird to you?

Lol, I noticed the error (palmface), sometimes is really worse when u think you know the reason of the problem because don’t check carefully the posible silly mistakes in the old code.

Thx for your patient Thibaud, u was a huge help.

1 Like

Hi everybody,
I can’t get access to the full test file, meaning when I check what’s in the $DEFIB, lines between 21 and 155 are missing.
So I passed the 1st and last test by chance but answers of test 2 and 3 are probably included in those lines.
Did I use the $DEFIB the wrong way ? or is there a supplementary check to use ?

Thanks a lot for your suggestions.

Check the lines themselves, not the indexes which represent nothing. You can check the inputs of IDE tests with the button at the top right of the test cases panel.

Hi _CG_Thibaud,
Thanks for the quick reply.
That’s actually what I did … I think. Working directly on $DEFIB.
When I check on the inputs with the button you mentioned, I see all the lines.
Can’t figure out why I can see some lines and not all of them, especially when I try to debug the $DEFIB itself … :frowning:
Would there be anything to do on $DEFIB before using it ?
Thanks for you help,

ok, sorry, I just understood your “problem”. You can’t see all the lines because it’s truncated by us. The console output has a limit of characters to print.

So your issue is not there but rather with your implementation of the solution. Double check your radian/degree conversion maybe.

hi everyone,
i would like to know why my code passed in all tests but not in one validator. the validator it’s not passing is the ‘single possibility’ , but if a try to run the same code in my computer and try to simulate as if it is receiving all the inputs and only one possibility, it returns the correct answer.

ps. sorry for my bad english. Can I post my code here ? (i’m new in this site and coding )

I sent you the validator you failed in PM. Posting full code is not recommended. It doesn’t help much anyway.

1 Like

hi, _CG_Thibaud
thanks for the help, with that i undestud that i was making the change of ’ , ’ for ’ . ’ in a kinda lazy way haha

1 Like

Just curious is this puzzle currently broken? If not probably just me needing to figure out something in the code… but for variable N when I run the “Exact Position Test” it reports 167 defibrillator entries and it states that it expects “Cimetiere Saint-Etienne” as the output. But when I look at the 167 entries from the input that entry is not present.

I thought it might be an output buffer issue which is why I printed N and N matches the number of input lines I receive. And the number of entries I see matches N. But again, Cimetiere Saint-Etienne is not amongst those lines.

Anyone else experiencing this issue at present?

The console debug output is limited in size. So what you’re seeing is truncated.

image
You can check the testcases using the button at the top right of the test cases panel.

1 Like

Yes, it certainly is working. Found the problem with my code. Thank you for your help.

You don’t need to take care of “,” character if you parse with specific culture.

Test case 3 for JAVA is incorrect.

Start point : 3.874054 43.606779

CRR;14 Rue Eugene Lisbonne 34000 Montpellier; 3,87409666178277;43,610433894746
distance = 7.386487665002335E-6

107;Caisse Primaire d’Assurance Maladie;29 cours Gambetta 34000 MONTPELLIER;3,87110915929521;43,6065196099402
distance = 8.709381985270443E-6

The correct solution will give FAIL on this case because of WRONG EXPECTED OUTPUT. However it will give SUCCESS for all validators.

The same code in C# works perfecly, because the test case for c# is different. In the dictionary of defibrillators for the same case 3, the CRR line is NOT present.

I really don’t understand why the inputs for different languages should be different. Aren’t we solving same puzzle?

The inputs don’t depend on languages, so you most likely have an issue in your Java code. (Besides, the puzzle has been solved a lot of Java programmers already)

OMG =]]] I got failed in the third test (The complete file) but when I submit, I got 100% result. These test cases is high af =]]

This suggestion about solving with cos bla bla bla is unnecessary and bad. Calculating distance with pythagorean theorem should be more than enough, and it’s easier IMHO.