Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Interstellar,validated by @Timinator,@Rafarafa and @DeanTheMachine.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Interstellar,validated by @Timinator,@Rafarafa and @DeanTheMachine.
If you have any issues, feel free to ping them.
Hi,
I see that I’m the first to talk on this puzzle.
The format handling is quite special anyhow it is a nice exercice.
I was able to get all tests ok but validators 7 and 10 are failing, any indication of their specificities versus tests?
Thanks !
Validators 7 and 10 deal with partial input, very much like their test counterparts. If test 7 is:
Input
-i
k
Output
Direction: i+k
Distance: 1.41
Try if your code gives the expected result for:
i
j
or
j
-k
etc.
Validator 10 covers the same idea but with only two coordinates instead of one, similar to test 10.
I have most stuff working, but when I submit 1, 7, 8 & 10 fail. It seems like all the parsing and formatting is correct. Is there anyway to get some opinions on my code for what I might be missing?
If you fail Validator 7 & 10 there is a high chance that you are not properly dealing with:
- The sign before the first component of directional vector is omitted if it is positive.
I suggest trying these handmade testcases:
-j
i
Direction: i+j
Distance: 1.41
-k
k
Direction: k
Distance: 2.0
and similar tests that you can find yourself.
Maybe @Interstellar could consider adding a couple more testcases like those to help with the debugging?
Thank you, your test cases help a great deal. I created a bunch for myself as well all of them are passing, but the Test 1 & 8 are still failing when I submit. Does anyone have some test cases I can use to find the issue?
It seems that Validator 1 & 8 are the only ones where the three coordinates are negative, maybe that could be the issue? Try something like:
i+j+k
-2i-2j-2k
Direction: -i-j-k
Distance: 5.2
From what I saw, a lot of codes would fail with an horrible division by zero if the ship arrives right at the wormhole…
After years of preparation and travel, seeing the ship self destruct right at the entrance, just because of a division by zero ![]()
this contradicts the logic of the task, if we need to know the direction and distance, why calculate these values if we are already in a hole?