Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Nekomancer60,validated by @LeMasSon,@TBali and @CodingKnight22.
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 @Nekomancer60,validated by @LeMasSon,@TBali and @CodingKnight22.
If you have any issues, feel free to ping them.
I got all the test cases right but failed validator 7, could someone please improve this by adding another test case or fixing the validator?
There is no problem with validator #7, it’s roughly the same than test #7.
Well then that makes me even more confused.
I’m double checking and it’s still the same; pass all the tests and validators but validator 7…
That’s weird.
You can send me your code, I’ll send back what’s wrong.
Sure;
[but in private ;-)]
Anyway.
Your script counts one more line than expected in this validator.
That’s really strange… I can’t see how this could be. Would you have any way of sending me the validator 7 so I could run it myself in a debugger and figure it out?
Just turn the spiral on the right.
I still haven’t got it to fail, I don’t know why.
The answer is 18, not 19.
Yes I know, I just couldn’t figure out the solution that would make it wrong.
But then I did figure it out, and I spent ages working on fixing it.
Turns out the reason that ONE validator case fails when all the others don’t is because there is a situation where my code didn’t remove 2 lines that had the same y value but were overlapping like this; (imagine they’re on the same y level)
---
-
And when I fixed that my code broke some more, but I fixed that by pulling the ‘remove duplicate lines’ part outside the ‘fixup lines’ loop.
Now it works!
If you could find another case where something like that happens that would be nice as people like me would figure out sooner what the issue is, but at least if they come looking they can see this is what fixed it for me.
Great puzzle though!
I find it very strange that this is considered a Medium puzzle and not Easy. When created, a few people swore either way, that it should be Medium or it should be Easy. I believe the issue is that it’s possible to make it out to be a bit more complex than needed. Looking at submissions, there’s a lot of code that’s short but some that isn’t. While this is typical when it comes to programming style, it’s obvious that here the difference is in how the problem was approached. I submit that any problem can be made more difficult than it is, and an easy challenge with a complex solution is still an easy challenge.
Difficulty level can be highly subjective and debatable for some puzzles, and well, it’s better to treat it as a loose (instead of an absolute) indicator of difficulty… I can say much more on this topic but I’ll stop here because it won’t be specific to this puzzle.