Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
perhaps a 3 random edge cases such as
could avoid this issue
my solution should not pass, I have raised an issue about this.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Unpublished this kata.
@rickansen, check the comments in my solution :D
This comment is hidden because it contains spoiler information about the solution
@Kacarott, Regarding to the
issue-3
on the part where you say:Correct me if I'm wrong, but I believe the need to round/truncate is caused by the unnecessary floating point numbers being used in the proposed solution to solve this problem, therefore it is an issue caused by the solution not the case requirements.
There is nothing wrong to try, but when the output of the solution does not logically/theoretically same as the expected output because of technical issue and there's no workaround for it, in my humble opinion I assume that solution is technically un-implementable.
And also (correct me again if I'm wrong), but I believe this issue (the need to round/truncate) is started from my response, which is:
So Warriors continue to assume that this kata require a rounding/truncating to solve, which in the first place this kata does not require them.
That response is solely used to suggest a solution to a problem where
[0.00000000000001, 89.99999999999999]
does not pass the test when it being checked with[0, 90]
usingassert.deepEqual
without further knowing the complete solution is.I also add further proof on
issue-3
that it doesn't matter whether a float being tested with integer or vice versa as long as the value is same, if that was not enough proof I also try withassert.deepEqual([[Math.round(0.00000000000001), Math.round(89.99999999999999)]], [[0, 90]]);
which is also pass.If that happen to not solve the problem (or even causing more problem) when is integrated to their solution, it is better to ignore it and find another workaround or change the solution completely that comply to the expected output.
Thank you for pointing me that.
But after I show all of my concept and the reason (possibly) of why this rounding/truncating issue arises, I do hope that my choice (with all proofs that I have shown) to use
assert.deepEqual
is clear to all beta reviewers.I hope this response does not insult/offend anyone.
@Kacarott,
Thanks for responding, I think I need to made the concept of this kata clear first.
From the start, this kata is designed as a puzzle kata that can be perfectly completed by the means that the output should be reliably tested, easy to prove theoretically, and the process to obtain the output be technically implementable.
This kata does not specify explicitly on how Warriors (Users) should handle the problem, but provide clues (which should be interpreted as a suggestion).
This kata does explicitly tell Warriors what the expected output is and require the output of their solution to be logically same (in this case "whole number") and also providing examples of how the output should be structured or arranged conceptually/logically.
In my opinion, I admit that the story backing this case is not good, but I think it is decent to illustrate the case.
Any suggestion by anyone is welcome to alter this.
To add additional notes, this kata is inspired by
ACM-ICPC Indonesia National Contest 2012 | Problem C | Laser-Based Mosquito Killer
@Kacarott, updated this, thank you very much for correcting.
I believe both of the discussion below held responsible for this issue:
1. Issue
1. Response
Now, referencing to the reference in the case description, there's more than 1 way to create part of the solution and one of them required a boundary, that's where
w
andh
will be useful.So, when you say "might as well" (which I believe it should be raised as a suggestion rather as an issue), can I safely say "in your opinion they are not required to solve the case" without massively insulting everyone in this beta process?
If it's not safe, maybe you could propose a better or more proper/polite words I should choose and we can refer this issue as
issue-5
in further discussion.2. Issue
2. Response
Referencing to The Codewars Docs > Authoring > Guidelines > Writing Submission Tests - Random Tests, where:
I believe I have created a random tests according to the community documentation.
But in this case, after thinking carefully, I do realize that my random cases does not reflect most of the possible scenario in the fixed tests, and I apologize for assuming that this is an opinion-based issue.
This issue is open and we can refer this issue as
issue-6
in further discussion.My apologize for not understanding this issue as a whole, I will try to respond partially.
The issue where same logic will resulting in a different output caused by difference of expression is a programming language issue, for example I have try in NodeJS v16.15.1 where:
1.1 + 1.1 + 1.1 + 1.1 + 1.1 + 1.1
which output6.6
And then I compare it with:
1.1 * 6
which output6.6000000000000005
Both of them are logically the same with difference expression, for this kind of issue I don't think there's something I can do.
If you would further elaborate on giving explanation or solution to this, we can refer this issue as
issue-4
in further discussion.Where the expected issue above is a continuation from the below expected issue:
First, you can test
assert.deepEqual([[0.00000000000000, 90.00000000000000]], [[0, 90]])
in codewars JS test framework and the result is a pass, you can even try90.0 === 90
or90 === 90.0
on JS and they would resulting intrue
, despite both of them is a different data type but in JS they are implicit, also they are the same conceptually.Second, the output of your solution have fraction where the expected output from this problem is explicitly saying it must be a whole number.
Third, since your output
[0.00000000000001, 89.99999999999999]
does not include0
or90
, I will gladly comply to the output of your solution, by changing the expected output to[1, 89]
if and only if you can prove it to me that a circle with center of point located atx: 25, y: 25
and have a radius ofr: 25
will not intersect or touch with a line that goes through pointx: 0, y: 0
with an angle of0°
or90°
.Because I can prove that a line that goes through point
x: 0, y: 0
with an angle of0°
or90°
will intersect or touch with the circle atx: 25, y: 0
orx: 0, y: 25
respectively.If this is still an issue, we can refer this issue as
issue-3
in further discussion.Yes, but this doesn't limit you to input a radian value that is converted from a degree.
The section "Notes" in the description "suggest" (by using the word of "should") you to check an angle that is whole number and does not refer to any specific technical details.
If you happen to have a solution that does not require this suggestion and comply to the expected output, then it would be great and further adding values to this kata for those who were able to see your solution.
If this is still an issue, we can refer this issue as
issue-2
in further discussion.Please point in the description to show me where the case asked you to "only use integer degrees angle as an input".
Because I can only point in the description to show you where the case asked you to "output one or more pairs of minimum and maximum angle that is whole number" which in this case is in degree, the fact that the case itself does not have any inputs related to angle.
If this is still an issue, we can refer this issue as
issue-1
in further discussion.Loading more items...