6 kyu
Ordinal Numbers
962 of 1,371wthit56
Loading description...
Strings
Algorithms
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.
Description should be langugae-agnostic
Numbers might be passed in replacement of booleans, so false may be passed in as 0 and true may be passed in as 1.
(This requirement should be removed since this is bad coding practices and not every language shares this property)Only 1 "random" test in JS is not acceptable prior to current standards
Node 18. should be enabled
COBOL translation (author is inactive).
Approved
This comment has been hidden.
I've added messages with the input to the function. Could you have a look and make sure the values coming in are as expected? If so, do the values look different? Maybe paste some of the failure messages so I can get a better idea of what's happening.
You solution is incorrect. Learn about the difference between
is
and==
(check this and this).Regards, suic
The tests pass numbers as
brief
. I'm not sure if it should be explicitly specified or not...This comment has been hidden.
Sorry. No, it's fine. There's just been a ton of translations for my katas and it can be hard to keep track of which ones I've looked at. Weirdly the email notification I get for a submitted kumite doesn't have the name of the kata or a link to it, which means I have to wait for someone to comment with a link. /sigh/ Bugs. ;P
No worries and thanks for approval :) Email notifications aren't the best part of CW :/ Regards, suic
I think there is, actually. In the
0 to 100
section of the test, with the arguments3, False
, I return 'rd' get the error:✘ 'rd' should equal 'nd'
All rd are in fact nd, so @bouchert is correct :) There's an error in tests. 3rd 23rd etc.
Sorry, it's fixed. Try now.
It's working, thank you very much! :)
Python translation kumited.
C#-Translation kumited!
https://www.codewars.com/kumite/57b5c363db5b3d6c4b00010f
Please check and approve it! :-)
Nice work!
Thanx!
Good katas have to be translated. ;-)
Cheers, man!
This comment has been hidden.
This comment has been hidden.
Can you explain this output please:
ordinal(0, true) - Expected: th, instead got: h
brief is true, so the briefed output should be 0h, right?
In the description, I said:
If the "brief" notation is used, 2 and 3's suffix should be "d"
. The rest ("st" and "th") work as they normally do.nice! I learn some new tricks with this kata :)
That's great! Thanks!
In the description an example shows "903d" which should have been 903rd?
In the "brief" syntax, a 2 or 3 will give a "d" notation, rather than "nd" and "rd". The example says:
903d (brief)
, so the brief notation, used with the number903
isd
, notrd
.Still a little typo i guess :P
Some examples would be: 1st 11th 111
stth 121st 20th 52nd 903d (brief), and so on...Nice catch. Thank you.
@laoris @OverZealoous @akoptsov Thanks everyone for your feedback. I think I've covered everything and fixed this kata up. Sorry for the oversight; I guess I wrote this one a bit too late in the day ;P
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I think there need to be test cases for more "brief" and regular ordinals. For instance, "rd" isn't being tested currently, and the way the last test is constructed, "nd" isn't being tested either.