6 kyu
Markings to White Triangles and How to Find Them
91 of 193theropodMusings
Loading description...
Mathematics
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
DO random tests still work in Coffeescript?
I believe random tests in Ruby and Coffeescript are corrupted
Python 3.8 should be enabled.
The description says
Somehow, I knew the third triangle had its first side unmarked, rather than its second, I'll have to take that into account were I to do this right.
, but without any diagrams or specification, this doesn't provide enough information to solve it. "First side" and "second side" don't have standard meanings. It's certainly not sorted by length, because in one of your examples, a>b. So even though I guessed correctly that 'c' is always the hypotenuse, it would be a bit fairer to tell us this in advance.Approved
Well Done, I had to use reflection to figure out the names of the fields. Really enjoyed reading the description, thanks for the kata!
Your welcome! :smile:
Welcome to CodeWars, and congrats on your first kata. I love the storytelling! :smile:
Unfortunately, technically, there are issues with it. :pensive: These are not new issues, but unfortunately there is not really one place to learn about them. Solve more kata, read the comments, and you'll come across more information. There is Test framework documentation and there is the Conjured Codewars Codex, but both are incomplete and outdated. I have mentioned some undocumented features in the issue comment. If you can't figure out how to use them, read other kata's random test cases, where they are sometimes used, or ask.
However, well done on the random tests. That's a problem with a lot of first kata, but not yours!
Thank you for your kind feedback! I just started codewars yesterday and am excited to try my hands on creating a kata of my own. I learn best by doing, and this is all a learning experience for me.
If you're going to be asking for floating point values, you really should allow for a margin of error. I am apparently using a different calculation than the reference solution, and ~10% of my answers is off by less than 1e-9, but are rejected for that. You could have used
assertApproxEquals
if it weren't for the wrapping in objects.Also, when asking for objects, insertion order should not matter.
{ a:1, b:2, c:3 }
should be as good as{ c:3, b:2, a:1 }
, I should think. You could have usedassertDeepEquals
instead ofassertSimilar
but for the floating point issue.You will have to write a custom
assert
wrapper function.Thank you for the feedback, I'll get on to it! ^-^
Javascript object attribute comparison is now no longer order sensitive.
Javascript kata now test floats with an epsilon of 0.01.
I've hopefully solved both issues on the javascript kata.
Changes migrated to coffeescript kata.
These issues are solved.
Your random testing is vulnerable to input modification by the user solution though, see here. :yum:
Sorry I didn't mention that earlier.
You can fix that by passing the user a copy of the input (
Object.assign([],triangle)
), or by calling the reference solution first and storing the result for later comparison (in which case, make d*mn sure your reference solution does not modify its input, as yours is doing if I'm seeing things correctly. or pass it its own copy).Writing test cases for even an 8 kyu kata can be a 1 kyu kata in itself .. :yum:
Good job on the assert wrapper BTW. Fast too!
I fixed a parenthesis and a spelling error in
Preloaded
. Hope you don't mind. (You can review the changes in the Kata Editor underRevisions
.)Thanks!
I don't mind, I allow contributors for a reason. ^-^
I invalidated your solution btw. ;)
Anything else you spot?
Not spotting anything else, no. Couple more rankings and ratings and it's ready for prime time. Writing tests is fun, isn't it?
Very.
May I still add additional languages after this goes live?
Yes.