Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Bazek,validated by @TwistedByte,@ArafatCoder and @Delicious31415.
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 @Bazek,validated by @TwistedByte,@ArafatCoder and @Delicious31415.
If you have any issues, feel free to ping them.
Hi,
Thank you for this puzzle. I like these geometric problem (such as “Triangle Toggle” from Lisa-Has-Ideas). Yet, I find them not so easy, so maybe a higher rating should be more relevant. Of course that is not an important point, I only share my opinion.
I have trouble to pass the “10 lines validator”. I think that the trouble come from the rounding part, on a limit case where the value can be rounded up or down, depending on the numeric approach used to get it. I used numpy solver, and several methods to round the values : that allows me to solve the “star validator”, but not the “10 lines validator”.
Would it be possible to send me input & output for that validator, so I can check ?
I can send you what’s wrong with your script, in private.
My code also failed the 10 line validator, but instead of sending on private what the others missed, it would be better if you gave another test case with the same mistake we are doing, so that we can fix it ourseves.
Maybe a number that is close to an integer.
I had to round them to integers.
I recently solved this problem. There were no rounding issues. I’m not the problem’s author and can’t provide a new test. But I can try to determine which lines’ intersections aren’t working correctly for you. To do this, I’ll need your code in a private message.
Ok, I managed to solve my issue with the help of @Nicola.
In my solution, I used a “hammer to kill a fly” ; I wanted to use the puzzle as a teaching opportunity :
numpy.linalg.solve
As feared, there a numerical issue that makes difficult to deal with the e-3 rounding requirement, for the “10 lines validator”. A value of 10.937499999999996 is rounded to 10.987 instead of 10.938. Adding a e-6 offset to numpy values before rounding do the trick (but not e-4, as it make an other value of the “10 lines validator” faulty).
I wonder if the “10 lines validator” could be change a little bit to avoid the problem, and frustration.
As a final word, I’d like to thank @Bazek for this puzzle because I really enjoyed it, aside the rounding devil part ![]()