Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Rafarafa,validated by @Razovsky,@cedricdd and @Timinator.
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 @Rafarafa,validated by @Razovsky,@cedricdd and @Timinator.
If you have any issues, feel free to ping them.
Hi
I tried to solve this puzzle and passed all the validators except 7, @Rafarafa can you share the inputs of the validator?
It’s pretty much this:
5
import builtins
import unittest
import time
import pandas
import sys
2
pandas requires unittest
unittest requires pandas
My program output:
Import error: tried to import unittest but pandas is required.
Fatal error: interdependencies.
This seems like the right answer, is there something I missed in the statement?
No idea. I will send you the validator 7 by PM because I’m not sure if it’s a spoiler or not. If you think the problem was due to a miss on my part please let me know.
No problem in validators as far as i know, everything worked fine for me
Hi,
Great challenge. Having a second(or replace the one you gave that works) visible test case in the directions with an example of what prints if you can reorder would be helpful. I know the directions say what to print, but I was having a hard time understanding what it was asking for. Just a thought.
I’m not sure I understand what you mean. Could you give an example?
Maybe the trouble is on the word “lexicographically”. This means alphabetic order, but not only, it depends on the length of the string.
Hi to all and thanks to @Rafarafa (and @Razovsky, @cedricdd and @Timinator the approvals) for this funny full python-developers-oriented puzzle !
As said @Razovsky, i had a trouble with the word “lexicographically” (as English is not my native language ),
→ but i finally could understand what i may do, and i’m now so pleased to get 100% validators for my solution !
Thanks a lot to you .
tip : don’t hesitate to review and upvote my shared solution ?
It’s the dictionary order.
A few comments after successfully completing:
The instructions make no mention of comma separated dependency lists. That had to be sussed out from the test cases.
When encountering an error and printing out conflict for A requires missing B, it is not clear from the instructions what to do if A also requires missing C. The test cases only accept one of those, but it is not at all clear that is well thought out.
And finally, a minor quibble, but having to parrot back multiple long text strings with mandatory punctuation decreased my enjoyment of the puzzle more than I would have otherwise expected.
You are right about the commas. I added one to test 3 (before it came even later), but I guess it was not enough. I added an explanation of the format in the output section. Note that this comma thingy is just me dealing with CodinGame I/O limitations, it’s not something that I would have done otherwise, it just makes tests shorter.
For the error printing, it’s literally this:
The imaginary compiler will import the libraries in the order that they are given by the puzzle until it finds one that requires a library that was not previously imported.
Even if they happen to be in the same line I don’t see why you wouldn’t apply that logic.
And for the long strings, I’m not a fan myself but they have the advantage of being self-explanatory and making the debugging easier (or at least that was the intention). I fail to see how the punctuation could be annoying though. I just copy pasted the statement when solving it in other languages and that was it.
Regarding the error printing. While the order of importing is stated, we have to give a particular (unimported) dependency. The test assumes an implied order on the dependencies also.
What’s the difference between Test 10 and Validator 10 ? That’s my only fail…
Nice Challenge for me, anyway
None that I can think of, they were both generated by the same random logic. I will send you the validator by pm anyway and you can tell us what went wrong.
Continuing the discussion from [Community Puzzle] Library dependencies:
Hello,
all my tests are accepted on the IDE except test 10. The Gourdin also talks about this test and its validator…
Is there something special in this test that I don’t see or is my code not correct? Please help me if possible.
@LeGourdin didn’t comment on what went wrong for him so I’m afraid I can’t help you on that one. As stated, both test and validator follow the same random logic.
(2.2) If the error is not salvageable return the message Fatal error: interdependencies…
What should we output in case the error is not salvageable but not because of interdependencies?
For instance:
1
import B
1
B requires A
Library B has a dependency which is never imported. There doesn’t seem to be a testcase with this but it’s also not excluded by the statement.