8 kyu
Plural
20,328 of 44,074wthit56
Loading description...
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.
What does (n) represent?
This comment has been hidden.
the initial code in C should be a function definition, not a function declaration
fixed
If you are here and still can't solve this kata, try to read task very carfully and use fingers. it will help for sure!
Love this Kata
This Kata is joke, i used test cases to understand problem.
And where is the suggestion?
Description is awful, just read the test cases.
This honestly needs to be pulled. The description does not make any sense. Plurals in English do NOT include halves or zero.
0
is plural in English; for fractions it depends on the noun that follows: "half of the pie haS been eaten" vs. "half of the pieS haVE been eaten". in any case, this is a 8-kyu kata, not a grammar exercise.I solved this kata, but I had no idead what the kata wanted
This comment has been deleted.
Adjust description, please. Hard to find out what i need to do
Terrible description, explains absolutely nothing
The task description is idiotic! Why indicate “pay attention to English grammar” if we accept numbers and not words as input!!?
Needs a better description and more examples
No random tests in Java.
Fork
Merged
Ruby should be updated to 3.0
Enabled in this fork + improved random tests
This question is grammatically incorrect, numbers (or at least rationals) on the interval (0,1) should return false not true, it is "half an apple" not "half apples".
Fractional numbers are handled differently, it's 0.5 apples.
why would you add 's' when there is nothing.
nothing is infinite?
instructions not clear. no sample input and output
You have to clearify your task more. It's not so obvious what you need to do when you're reading it. I've read 10 times to understand what I need to do. Also add more tests to show what should you do.
Lua translation ready for review :)
There may be an issue with the randomized tests in Elixir: they appear to expect a boolean instead of a string.
Problem says that you will only test
floats, integers and zero
but test cases include stringInfinity
. Also part of an object is singular in English. Half ofan
hour, three-quarters ofa
sandwich.The singular for parts of an object is only true if you use fractions in English. You would say "half an hour", but you would also say "point five hours". "Three quarters of a sandwich" becomes "point seven five sandwiches".
This comment has been hidden.
Not a kata suggestion (don't post code without spoiler or as suggestion next time)
This kata will be more difficult in Russian I'll give it to my students.
Please review my Rust translation :) https://www.codewars.com/kumite/617663830a9ae1001aa15dea?sel=617663830a9ae1001aa15dea
Approved :)
(next time you propose a translation for reviewal, you'd better put a suggestion flag to give it more visibility)
Thanks. This was my first one. I really appreciate your help.
My pleasure. Hope you will populate soon Codewars with new Rust katas, they are missing!
what the hell, i didn't know till now that ki "0 and 0.5 is plural".
i was wondering why they used a float. now i know.
Thats noob friendly.
it is just a simple grammar set : -when i say : one apple ->this doesn't need a plural -for a number different for 1,it need a plural one apple ,5 apples ,5 minutes *in this article,you will find more informations about this grammar issue : https://alistapart.com/article/pluralization-for-javascript/
Just as an English teacher, I need to say we don't use plurals for decimals(parts of one whole). I don't have .5 of apples; I have .5 of an apple.
I know, very useful.
This comment has been hidden.
YOU're not returning true or false; you're returning a string.
From the description: "It should take a number, and return true if a plural should be used with that number or false if not."
im not used to the synthax in this website. so annoying. it was so simple! thanks!
This comment has been hidden.
Or you can modify the generator so that it can alternatively returns a
plural
orsingular
This comment has been hidden.
Hidden Tests in Java check for negative infinity and NaN when the description claims that all values will be positive or zero.
Sorry about that. I've removed those tests for you. If you could go in and add random tests similar to the JavaScript ones I'd be much obliged. I tried to do it myself, but don't know enough about Java to do it in under an hour XD
This comment has been hidden.
This started happening last night after 1:00 AM (GMT). Rechecked again this afternoon 2:00 PM (GMT) but still the same situation. Found a few questions on this subject but only after drafting my question as below:
Any update please?
Currently Codewars platform is experiencing issues.
https://github.com/Codewars/codewars.com/issues/893
This test fails for me:
infinitTest(PluralTest) ✘ expected: but was:
any clue?
Which language? And could you give me your code between code tags, please?
``` code here ```
This comment has been hidden.
Same problem.
Interesting. I believe there may have been a bug where the
<true>
and<false>
became HTML tags accidentally; but it looks okay for me at the moment. I just tried your code and got:expected:<true> but was:<false>
.I've added messages to the tests all the same. Could you retry and let me know what you get?
Now I get: infinitTest(PluralTest) ✘ NaN expected: but was:
Okay. If you right-click that line of text and click "inspect element" it'll show you in the dev tools what that text should be. That'll help for now until they fix the bug.
NaN expected:true but was:false
I thought I remember learning in English class that fractions less than one were considered singular. For example, 1/2 minute or 1/4 apple versus 1 1/2 pies.
That is true. Though
0.5
would be said as0.5 minutes
, as a plural. That's why I left it as I did. Good comment, though!TypeScript-Translation kumited!
https://www.codewars.com/kumite/5818b74ec3d658c4b80002a1
Please check and approve it! ;-)
C translation kumited! :)
Sorry, but the description is misleading.
It says
You only need worry about "english grammar rules"
, but then the test cases throw English grammar out of the window and invent their own solution requirements.What about:
s
s
outsides
who are native English speakers?http://english.stackexchange.com/questions/38293/why-is-zero-plural
The problem of zero would be moot if the tests were not testing for it. The description states
All values will be positive integers....
so why is zero being tested at all?The tests do try
0
, so that's covered. I've added a note to the description to make sure it's clear that zero can be tested for.I'm not sure what you mean about the grammar rules being ignored. When zero of a thing is spoken of, there is a plural "s". And that's what is being tested for. Could you help me by saying what I am not doing correctly? And what I should be doing?
Doh. I'm an idiot. Very sorry.
Explanation:
The Java test case assertions have no messages and there are multple test cases in the single @Test. When my first attempt failed with the vague error
expected:<true> but was:<false>
I wrongly thought it was the 1st assertion (the one with the zero) that had failed.Lessons:
Kata tests with multiple assertions can cause confusion because if they fail with no mesasge you don't know which part failed
I need to pause and think more before raising issues :-(
Ah, I see. No worries.
I definitely agree on that first point. I try to add useful messages to every single test. But I only write the original JavaScript tests, unfortunately.
C#-Translation kumited!
https://www.codewars.com/kumite/57b5c7058491f904d80001ca
Please check and approve it. :-)
Java Translation added. Please consider it.
This Java-Translation from Javatlacati is still not approved for 4 month. ;-)
https://www.codewars.com/kumite/5703e35c5a7263c250001763?sel=5703e35c5a7263c250001763
Please check and approve! Every translation is a chance for you to get more honor-points and good for the community. :-)
Sorry for the late response. Didn't see it in my emails or something. Thanks for the translation!
Thank you! :D
Hi, I've added a CoffeeScript translation, if you want to approve it, instructions for the approval process are here.
Done. Thanks for your help.
Python translaton added. Please approve.
Doesn't show up when I "edit" the kata. Not sure where else I could look?
Click on 'plus' icon above, near the language icons, and choose the Python translation. Click on it, find the green approve button in the upper left corner.
Ah, I see. Approved.
Is that from the
kumite
system, then?Yes! Thanks.
what it a plural,can we make things easier to understand :(
You should probably grab an online dictionary and look those words up. That being said, the kata contains all rules that are necessary to solve it.
I've added a little note. Basically, in english,
1
is singular, all else is plural.thanks a lot .
Sorry for my attitude :)
That's alright, mate.
Test Passed: Value == true Test Passed: Value == true Test Passed: Value == false Plural for 100 - Expected: true, instead got: false
why do we need a plural for 100?
Because you have 100 boxes, not 100 box.
What do you mean? Because 100 is more than 1, and therefore it should be PLURAL... one hundred appleS.
This test seems incorrect:
Shouldn't it be:
It doesn't affect the outcome since your just testing for true or false, but it might lead to some confusion
Probably... though it should probably actually be something like "1 should not be plural". But after a certain point (number of solutions, maybe?) CW locks the tests so the author can't invalidate a ton of previously-accepted solutions. Thanks for the suggestion, though.
thanks, jsdev... I guess I just don't understand what Test Fixtures is about at all.
what sounds better? "-1 car" or "-1 cars". I think the latter.
I agree. I only test positive values (or zero), as negative values do not make sense as a quantity of something, and so cannot have a "plurality". I've added a note to the description to this effect.
This comment has been hidden.
I'm not sure I understand what you mean here... The solution you provided works as expected, and the tests are all correct as far as I can see. If the tests fail, they should print the error message along with the expected and received values that are not matching.
Could you tell me what you think the correct answers should be for each test?, please?
This comment has been hidden.