6 kyu
CamelCase Method
16,145 of 47,267bestwebua
Loading description...
Fundamentals
Algorithms
Strings
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.
Lua fork
export function camelCase(str: string): string { return str.replace(/(?<![A-z]\1).|([\W])|([A-Z$]{2,})/g,(a)=>a.toUpperCase().trim()) } Gives this error expected 'WICTXmvEnFKCwmXizUjGsGrOPblMcQHEYDNFKoCCsWMUWyRKED' to equal 'WictxmvenFkcwmxizujGsgroPblMcqheydNfkoccswMuwyrked'
The random tests are borked
Don't forget to use spoiler flag.
Oh, sorry for that! Thank you.
Don't forget to use Markdown code formatting.
This comment has been hidden.
This comment has been hidden.
Please when reporting an issue, provide the code that gets that error. About what you said, change Node version to another one, and you'll see you're returning a function instead of a string in that test. I agree the error message in Node v18 is confusing, but I don't know why it shows that, so I'll leave the issue open just in case anyone else knows how to fix that.
I ran their code and discovered that it passes if the test is modified from
assert.strictEqual
toassert.equal
, if that helps.This comment has been hidden.
Why it will be fail?
This question is wrong, this is PascalCase, not camelCase.
I spent far too long trying to make this produce camelCase - the description of the problem is fine (I should have checked it more carefully) but the name of the challenge would probably be a lot clearer as PascalCase.
basic test - OK attempting - errors
does it kata work for Go language?
thanks
work
All words uppercased is PascalCase, not camelCase.
Thank you!! its genuinely upsetting me reading the example
This comment has been hidden.
That's a problem with your code, not a kata issue. Print the input, see what it is and why your code fails.
I like how we needed to return an empty string if given an empty string... As it was not mentioned in the description, unless this is a known step in all challenges that I did not know before today. Maybe it's because I used an imperative approach? Sorry I'm still learning.
sorry but... thisIsCamelCase, ThisIsPascalCase, this_is_snake_case, this-is-kebab-case
true
funny kata!
CoffeeScript translation
The test method does not show the input.
the method does not even exist in ruby, theres only a class named string and when i made the camel case method it legit throws erroe.
Err... Got this error message:
The expression (as strings) (actual) == (s->expected) is false: actual=
JYcyUXsGtsvACyxjhqQbd
expected=JYcyUXsGtsvACyxjhqQbd
.Not sure what to make of this. Any tips?
Generally speaking, camel case can refer to both upper CamelCase and lower camelCase. However, in the JavaScript ecosystem the convention is to use camelCase as the naming for the lowercase version and PascalCase for the uppercase version. Therefor, this Kata should be renamed.
For reference, you could take a look at how it's explained in the airbnb guide which is pretty much the most popular JS style guide: https://github.com/airbnb/javascript#naming--PascalCase.
I don't get it, if generally is ok, but in one of the languages the convention is different, why the kata should be renamed affecting all languages? I'd have probably used PascalCase from the beginning, but changing the name of the kata and the function's name in every language isn't free. You need to make all tests backward compatible to not render all solutions invalid.
Fun kata!
In CamelCasing the first word is not title-cased, especially when it was not title-cased before!
Please make a new harder version with the correct method.
Duplicate issue
Go, s in func is blank
I think the complex tests have some errors, I did this kata on own way and it just failed there. After that, I decided to unlock other implementations, I copied the first most liked, pasted it and it failed at the same test. It's starting to annoy me how many of these kata's tests are kinda wrongly build. Also this kata shouldn’t be called CamelCase but PascalCase.
Good Katas to everyone!
This comment has been hidden.
Read this: https://docs.codewars.com/training/troubleshooting#post-discourse
An issue with your code is not a kata issue.
Read the error message:
Your code is wrong, that's why it doesn't work. Not a kata issue.
This comment has been hidden.
Yes, it fails the 3rd sample test, print the array and you'll see why.
Yeah, I just checked and it fails the empty string test. I learned something about charAt and slice that I wouldnt have known with this kata. It's quite interesting, I honestly didnt expect that behaviour from those methods.
This comment has been hidden.
You try to modify an unwritable memory:
The buffer is
const
for a reason, you cannot just pretend that it's not. Writing to a read-only area is forbidden and causes crashes.Your solution is broken, it's not a kata issue.
So that's PascalCase not camelCase.
Please review and approve fix of Go tests (author seems to be inactive)
i don't understand why my solution doesn't work. "Cannot read properties of undefined (reading 'split')". in code redactor my function is work properly :(( this is the difference in ecma versions?
This is way too easy for a 6 kata. Compared with "Simple Fun #295: Guess Number" for example, which I've still yet to complete, because it requires not only knowledge of Python functions (like this kata), but also knowledge of math, and also requires a lot of optimization. This on the other hand, took me less than 1 minute to complete, and is just basic string manipulation. Should be 7 kata.
Could be, should be, but it isn't. It's an old kata, and back then this was considered 6 kyu.
isn't this too high! shouldn't it be kata 7 or something!
For JS it 7 or lower
This comment has been hidden.
Python update (new testing framework)
Approved!
This comment has been hidden.
Strings in C are nul-terminated
char
arrays. If you do not terminate your string with a'\0'
, the language has no mechanism to determine where your string ends. This is normal behavior, so this does not qualify as a kata suggestion (suggestions are propositions to improve a kata, not hints for other solvers)Some Katas is working even If I don't put the '\0'. For example I didn't put the '\0' this kata and I got fault. But some other Katas is not giving fault If I don't put the '\0'. I can't understand for why?
Because you were 'lucky' and the memory located just after your
char
array in memory happened to start with a'\0'
.Unfortunately, this kind of things can happen due to the low level nature of C. This is called undefined behavior and it is a very important concept in C. The language specifies that if you forget the nul terminator at the end of the string, and then pass this string to a function that expects a nul-terminated string (like
strcmp()
,strlen()
...), anything can happen.Your program could work, could not work, could crash. It depends on a lot of factors like architecture, OS, compiler, memory layout of your program, etc. Undefined behavior is to be avoided at all costs, precisely because it makes your program unpredictable (and generally wrong).
Oh. Thank you. I respect you. I understand it. I will be too careful for about '\0' of end of string. That is very important.
Based on the output, this should be a PascalCase method? 🤷♂️
Agreed. I wrote a solution for camelCase first and then realized that the title says camelCase but is actually PascalCase.
Test cases for GO returns "runtime error: index out of range [0] with length 0" while all is ok in IDE. Looks like test are broken.
Random tests in TypeScript generate strings with mixed case and the expected answer is still mixed case.
.
this issue still exists
tests are not works correctly ts but random tests works
Your code is failing this sample test:
Read this too: https://www.codewars.com/kata/587731fda577b3d1b0001196/discuss/javascript#6372df9acadfc900636ed5ed
I took this into account and registered the exit on this comment if(str[i]==str[-1] && str[i]==' '){ break }
No,
str[-1]
isundefined
. So that condition will never be true given thati
won't go outside the string bounds.i think i solved kata localy on my computer, but i have problem with synthax used in kata, can someone explain me how to use paramater with this kind of synthax used in this kata?
This comment has been hidden.
It seems random tests are generating strings with leading and/or trailing spaces.
if that's the case; i am using str.trim(); i inserted a log, here what the output said : It seems like random test is generating multiple strings
XuagptFvrogtxBafhmxcnAdPotcjtivlpXxjxHwyfznJxaYeL KouumrEyttwahqjTefqHdleytTtwaTsffvrK HqjiiEyttwahqj PhwyfDUagptefqyMredpxuagpLeVrogtxzYts
Then maybe you shouldn't trim at all.
passing basic tests but in the attempt it says Testing for 'tgk gtwgnkhxegx aarosucfm xznd or', output was 'TgkGtwgnkhxegxAarosucfmXzndOr' thats what i understood from the assignment? maybe im wrong..
This challenge in my opinion is too easy to be a 6 Kyu. I'd say its more of a 7 at least for PHP.
I think this would be a more accuratly named and more accuratly rated if it actually expected camelCase not CamelCase
The kata is called CamelCase but expects to produce PascalCase text
C, Random_tests had some errors, algorithm is quiet correct but still returns false
Your function does not nul-terminate the string, not a kata issue.
JavaScript, possibly other languages: Fixed tests contain inputs with leading and trailing spaces, while these are neither specified, nor tested with random tests.
I already removed them from TS and JS, but I'm starting to wonder if it shouldn't be handled the other way around...? (ie updating the description/random tests) Some other languages have them also (python and C at least. Java doesn't)
Scala translation
Approved by someone
This comment has been hidden.
This comment has been hidden.
PascalCase not camelCase When will people learn?
The random tests are really bad i don't like them..
This comment has been hidden.
You're missing some
using
I get the following error (when coding in C): The expression (as strings) (actual) == (s->expected) is false: actual=
SemluiICWQjUOChoAdOUwamcmarfdUdxebkOTmnkq
expected=SemluiICWQjUOChoAdOUwamcmarfdUdxebkOTmnk
.These two strings are exactly similar, I do not know what to do.
Two problems with your solution:
No, they are not.
Thank you hobovsky, you were right!
reading the description, was confusing since this isn't camel case.
This is camel case, there's upper camel case and lower camel case. (assuming you're talking about starting with a capital letter, tell me if I'm wrong).
Update: just read about Pascal Case, sorry.
This should be a 7 on Python IMO, not a 6. Too easy.
I love that feeling when you've done everything right and the problem is the damn tests.... no.
same thing for me
Yeah that seems to be the problem. I tried to lowercase every excess letter of a word and the test case seems to be the problem
same here
This comment has been hidden.
You code not working is not a kata issue, see the initial code:
You have to write a new method of String.prototype, you've written an isolated function.
This comment has been hidden.
This comment has been hidden.
Some of the testcases have empty string. When you try to get index[0] of an empty string, it will be out of range.
Your code will fail for cases where there are multiple spaces adjacent to each other like
nurpsh crdex neixdmzvc wxtwztr cbp
because splitting them would result in["nurpsh", "crdex", "neixdmzvc", "wxtwztr", "", "cbp"]
and trying to access an empty string is erroneous.This comment has been hidden.
Your code is failing the last sample test, not a kata issue, but a problem in your code.
Thanks,my bad
(JS) !this is false when string === '', and my solution don't work here, when it works in editor...
What is false? What is the string equal to (we see nothing, consecutive spaces don't display properly in markdown? Your code not working is never to be considered an issue. And assuming there would be issue, it's impossible to do anything with what you are telling us. Please read carefully this: https://docs.codewars.com/training/troubleshooting/
i don't like this Kata
Then you don't need to bother yourself to post in Discourse, click
next kata
at the top right.This comment has been hidden.
No.
I've seen your solution. You used regex, right? That's awesome.
But I've tried it on my compiler and it does not work.
COBOL translation + description unified.
Can't approve because description changed. I changed the description and create fork.
Thanks!
Go: sample tests don´t test anything.
This passes the basic tests: func CamelCase(s string) string { return s }
Thank you. I raise an issue.
delete your Kata plz ! your test's has many errors !!
There's nothing wrong with the kata tests.
This comment has been hidden.
Your solution fails following test cases:
testLeadingSpace
with input" camel case word"
, andtestTwoSpacesBetweenWords
with input"ab c"
. Did you check these inputs in your IDE?This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Rubbish and it's not even camelCase, it's PascalCase
in C, I have got "munmap_chunk(): invalid pointer" error and after multiple attemp of the same code it work
I've tried my code several times and it didn't get an error. It's possible the error comes from your code in some cases that random tests do not always generate. Can you post your code with a spoiler flag so someone can check what's going on?
This comment has been hidden.
you code contains undefined behavior because you are sometimes accessing memory out of bonds (
ptr[-1]
not valid at the start of a string,ptr++
invalid when*ptr
is'\0'
), this is not a kata issueThe Java CamelCase Method seems to try to treat it like C# instead by insisting the first word is capitalized. I think this is an error.
This comment has been hidden.
This comment has been hidden.
System.ArgumentOutOfRangeException : Index and length must refer to a location within the string. (Parameter 'length'). What is this? I have no problems in IDE , but here it appears.
Im getting a similar error, i think the kata might be broken.
OP solved it, closing
This comment has been hidden.
You are supposed to return a dynamically allocated string, not modify the input string.
Rust version should not have parameter named after a primitive type: str. Aside from bad practice, it also prevents autocomplete in vscode extension rust-lang.rust.
I don't understand what this error means
Basic tests Test Passed: Value == 'TestCase' Test Passed: Value == 'CamelCaseMethod'
TypeError: Cannot read property 'toLocaleUpperCase' of undefined at sdd.forEach at Array.forEach at String.camelCase at describe at /runner/frameworks/javascript/cw-2.js:152:11 at Promise._execute at Promise._resolveFromExecutor at new Promise at describe at /home/codewarrior/index.js:18:5 at /home/codewarrior/index.js:25:5 at Object.handleError
No random tests in Ruby
Ruby 3.0 should be enabled (Refer this & this for more detail)
In c I had to add a random
printf("\n");
for the code to pass otherwise passing tests was completely random.
Pretty certain, this kata is bugged.
The kata is not bugged and your solution has a bug causing it to crash.
You allocate a buffer which is waaaaaay to small, and perform writes out of its bounds.
Are the random tests valid? Getting strange errors...
This should be called "PascalCase Method"
I was gonna say the same thing, camel case doesn't have the first word capitalized.
That's right. (It’s Leviosa, Not Leviosaaa!)
Seems too easy for a 6 kyu
I think this one is broken, I just returned "" and all the tests passed.
string passed in random test = 'gvHhSKYagwbwK VPSczvqyoEjgE zCcROzmIjvkLR vkFjRUubXFcfdia ikIOgCdYLwYC' string returned by my function = 'GvhhskyagwbwkVpsczvqyoejgeZccrozmijvklrVkfjruubxfcfdiaIkiogcdylwyc' error message says it shoud be = 'GvHhSKYagwbwKVPSczvqyoEjgEZCcROzmIjvkLRVkFjRUubXFcfdiaIkIOgCdYLwYC'
doesn't look very PascalCase (which is correct name for strings with first word capitalized) to me... It's just missing spaces with capitalized first letters (only first letters should be capitalized).
Which programming language are we talking about here?
TS at least
This comment has been hidden.
Not a kata issue, your code fails the last sample test.
In Java, how can a string have length() == 0 but not be == "" ?!
In java, its a completely normal phenomenon:
Read on what's the difference between
==
andequals
.thank you, i understand now.
Problem with the Random Input.i cant seem to figure out what that input is which causes an error.Im pretty sure my code serves the function well enough just this one testcase.
Read this
Doesnt really help me much.I did what they said and im still getting an error but when i run the code on netbeans its fine.
Then, following the instructions there, post your code here, so we can check what's wrong.
Nvm i already got the answer.I kept getting a StringOutOfBoundsException so i just didnt use arrays entirely.Thanks for your time and concern man.
This comment has been hidden.
So what!?
it just looks funny to me :)
my code passes the sample tests and then when attempted fails a test called testRandomInput. The wording for this kata isnt great, as others have mentioned. Anyone know what testRandomInput is testing for exactly?
Hi! In what language it happens?
Unclear issue, closing, do raise again with more detail if some unknown error occurs
Testing for 'dhmdb debfhsgti u iinnk erir', output was 'DhmdbDebfhsgtiUIinnkErir' Testing for 'z w tugghkxjhx cadug lvsw', output was 'ZWTugghkxjhxCadugLvsw'
So why wrong?
Nice kata, but:
Changing the name of the kata can break things, and you should rename the function name too in every language, that can also potentially render solutions invalid. Pascal Case is a one of the two alternatives of camel Case (upper camel Case), so maybe an edit of the description clarifying that would be enough.
Isn't that already there?
I see, thank you for reply, keep up the good work!
persistent error which is not my fault. It works in my ide but not on here
Are you sure it's not your fault? What's the error? You're probably not using
String.prototype
or using it wrong.This comment has been hidden.
The error is:
Cannot read property 'toUpperCase' of undefined
and it's your code's fault. You're trying to access the 0 position of an empty string and usetoUpperCase
with it. Next time, mark your post as having spoiler content please. You can see the input your code is failing because it's the third sample test.I did mark it as spoiler, not sure why it didn't work. anyway, nevermind. I saw those errors but this works in vscode so I don't know why it doesn't work here
This feels far too easy for a 6th kyu (at least in PHP), should this be lowered to 7th or even 8th kyu?
Ranks can't be changed.
Will this work with javascript?
The description is vague not sure why you ware using different words in description like CamelCase camelCase camel_case If I didn't have the tests wouldn't be sure whether to make a method name in python which is snake_case.
This comment has been hidden.
In C the test is crazy, it is throwing a free exception randomly. I run the same source code many times and I got different Test results. The program was tested directly in the computer and it works and the memory check seems also fine.
I just checked and both Clang 3.6 and Clang 8 seem to work well - my solution works as expected, tests for Clang 8 print some compilation warnings but other than that, consistently pass. I did not check the code of tests, but since my expected-to-pass solution passes, I am rather inclined to think that your solution has some problems with memory management - do you return a free-able buffer every time? If you still think that your solution is correct and should not be rejected, post it here (remember abour "spoiler" flag!) and someone will have a look at it.
The task doesn't ask for camel casing, it asks for pascal case. The task should be renamed to ease confusion.
Already raised as issue
This comment has been hidden.
It's a problem with your code, check the error message:
begin 0, end 1, length 0
find those numbers in your code, and add a control test to avoid it.Thank you for the tip Chrono, I figured it out. On to the next challenge!
For swift this kata seems to be broken - basic tests are ok, but all random tests just capitalize the first word and ignore all the rest
Returning the input shows the expected result has all the initial letters of each word capitalized. Are you sure?
I think I've found the cause of the weird behavior. Declaring your own
capizalied
method in a solution can mess up the tests.// extension String { // var capitalized: String { return "hey" } // }
i'm getting the sample cases right but then the test cases i'm not really sure what's wrong.
Testing for 'ijllc v tqihv ynem ihh n y oibrzg', output was 'IjllcVTqihvYnemIhhNYOibrzg' Testing for 'dxuvrd fue gx fjjaugfpfq cctcgattdz fiao', output was 'DxuvrdFueGxFjjaugfpfqCctcgattdzFiao' Testing for ' hj gpyngmwcq wttoftkwhqlq oryq', output was 'HjGpyngmwcqWttoftkwhqlqOryq'
i don't understand isn't this what the request was to capitilize each word and join them without spaces??
This comment has been hidden.
This should be called PascalCase Method, camel casing does not capitalize the first letter of the first word, but the first letter of every subsequent word.
Swift translation kumited. Please review and approve if acceptable.
I guess, it makes sense to state explicitly that all spaces must be removed, not only those between words, as certian methods may ignore leading/trailing spaces, while camelcasing words. So, 'All words must have their first letter capitalized without spaces' may be turned into more comprehensive 'All words must have their first letter capitalized, all spaces must be removed'.
Go translation awaiting approval.
Thank you, @docgunthrop!
C++ Translation added! Please Check, Thanks
Having issues with 'c' lang.
The test cases pass in an empty string "", and expect such in return. but then they try to free that empty string, which causes a runtime error and the test fails because the test case couldn't free it's own string.
For added clarity: In those cases, I am returning the string that was passed in, so it shouldnt be my function that is causing this.
If I am not mistaken, the test case passes in a pointer to a string literal of an empty string, therefore it does NOT expect the same in return as the return value is expected to be freed.
Should be 8 kyu
why you're still 7kyu then?
It's 7 kyu :(
Either list possible function names for every language or don't mention it at all. I'm tired of seeing useless text in almost every kata.
Correct the title please. this should be PascalCase and not camelCase
This is PascalCase not camelCase
Please, C Translation
Thanks for your translation, @uniapi! Cheers)
Great! (*)
TypeScript translation has been provided. Please review and approve.
Thanks for your translation, @e1r0nd! Cheers)
Cannot read property 'toUpperCase' of undefined.What is this?
This comment has been hidden.
Rust translation has been provided. Please review and approve.
Watch out for blank string " "(<- only spaces here) which test cases didn't cover.
This comment has been hidden.
ThisIsNotProperCamelCase.
thisIsProperCamelCase
Go to wiki and read a little. Camel case may start with a capital letter.
http://wiki.c2.com/?PascalCase
OK. You are right. This is CamelCase in Pascal also known as PascalCase. I do JS in which the preferred camel case isThisCamelCase.
ThisIsPascalCase thisIsCamelCase ...
This comment has been hidden.
It should be 7kyu I believe.
or 8 kyu!
12 is better!
Does it test for a case where one of the words is only 1 symbol long? Because I have a solution, but I think it wouldn't work in that case.
Hi, @DennisVH. 1-char word can't be represented as camelcase word. What is a Camel case?
oh, okay, didn't take the actual definition in consideration when solving the Kata.
Hi,
Looks like there ia an issue with c# test case.
Testing for 'uvfknm mzno l ulhmib mgwnplk uw', output was 'UvfknmMznoLUlhmibMgwnplkUw' Testing for 'vcrjcgpxvgln hrdlayq cjhqblixs jrzu ikvcn', output was 'VcrjcgpxvglnHrdlayqCjhqblixsJrzuIkvcn' Testing for 'psdd dgrxqjh cg lkjtbh dqda u gpnm ngwbjdu xeat', output was 'PsddDgrxqjhCgLkjtbhDqdaUGpnmNgwbjduXeat'
As per the requirement the output appears to be correct.
please suggest what might be wrong.
Hi,
I have the same problem and i don't know if we are missing something or if it is broken.
No, it was my mistake, its not broken.
Your code will fail for cases where there are multiple spaces adjacent to each other like
nurpsh crdex neixdmzvc wxtwztr cbp
because splitting them would result in["nurpsh", "crdex", "neixdmzvc", "wxtwztr", "", "cbp"]
and trying to access an empty string is erroneous.Lua translation kumited! Can you review and approve, please? :)
I can't see your translation, saddly(
This comment has been hidden.
Hi, I made a C# translation. Let me know if there are any issues.
Hi! I can't open your translation: Looks like there was a server error! (500). We have taken note of the situation and will be looking into it....
undefined method `name' for nil:NilClass
Hi bestwebua, no worries. The translation has been approved in the meantime.
C# translation produces tests with more than one space between words, unlike the other languages I've checked (Javascript and Python), I don't know which one was the original langugae, but they should be consistent.
Random test cases in C++ expecting "Xdkdxmx h" but there is a space and 'h' isn't upper case.
This comment has been hidden.
Haskell <a href = https://www.codewars.com/kumite/5961150451c68a91f2000081?sel=5961150451c68a91f2000081>translation kumited. Please review and accept ...
Thanks!
Accepted!
YW!
<a href=https://www.codewars.com/kumite/59608d39a68b04598e0000ec?sel=59608d39a68b04598e0000ec>C++ translation kumited. Please Review and accept :)
Please, post link on your translation here.
I have linked it in the original comment. But if it is not working, then <a href=https://www.codewars.com/kumite/59608d39a68b04598e0000ec?sel=59608d39a68b04598e0000ec>here it is :)
Done:) Thanks for your translation.
This comment has been hidden.
Try calling it with an empty string
""
. The firstsubstring
will throw that.thx)
This comment has been hidden.
It is not camel case! It is pascal case.
So what???
You are wrong, I did my work at today, bb)
About Java:
All is currently wrong in this language but...
When I got in the translation panel and saw the 4 Java versions, I realized that the last version (that seems to be good at first seight) is not the one currently published! (see the sample tests: the published verison call for the method
Kata.camelCase
instead ofCamelCaseMethod.camelCase
as it is written in the last translation)So, easy fix needed! ;) (because right, now, the published version is quite a mess! -> wrong class name, even wrong method, because the tests cases do not follow the requirments, expecting things like "camelCase" instead of "CamelCase")
No Java supporting in this kata, I don't know Java, alas!
I understood that, yes. But why can't you publish the good translation version?? If you want, I can make a new one, so you could approve it.
EDIT: or did the approval change nothing because your kata has already too much completions? (that shouldn't be a problem in java, since it has less than 100 completions but...)
Sounds good! Thanks. I'm waiting for a nice Java translation from you :)
Should be good with this one I used the last one you forked. Almost the same. I tweaked a bit the random generator to obtain inputs more consistent wihth the python version.
Well done, thank you so much! Cheers)
Just tried it. 'Works fine! ;)
You have a test-case that expects a String like "g at Index" to be converted to "gAtIndex" - IMHO, this case needs to be fixed so the kata expects output like "GAtIndex".
No Java supporting in this kata.
Java tests are still the same problem they were a month ago.
Also, the test cases are all bunched together into 1 test instead of being separate tests.
Having problems with the Java tests, please fix
Issue resolved.
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
Language is Java.
2 things to be covered here:
First, it seems like it would be helpful to mention in the instructions that if the word is one letter, it should not be capitalized (for all of us unfamiliar with CamelCase regulations).
Second, and more seriously, the attempts and tests still do not run, due to problems mentioned below. I think the quickest solution would be to simply change the class name from CamelCaseMethod to Kata, so as to avoid messing with the other code. This error is critical as it causes the whole program to be unfunctional.
No one to help with Java branch, all Java coders work with cool enterprise products. Cheers.
Issue resolved ("for real" ;) ).
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
This comment has been hidden.
This comment has been hidden.
Fixed, thx!
Wow! That was quick. Thanks!
Anyways, the hiddden test cases, when I hit the "submit" button is yet to be fixed for the same error.
You're welcome! I don't know Java and I could not verify the quality of the translation in full immediately. Cheers!
So, did you ALSO fix the hidden test cases? Like I said, it still does not work when I click "SUBMIT".
Yup, in all cases I has fix CamelCaseMethod.camelCase instead kata.camelCase.
Sorry to be bothering you over and over. But I do not think that the test cases evaluated when "ATTEMPT" or "SUBMIT FINAL" is clicked has been fixed. I still get the following error.
So, please fix by substituting "Kata" for the class name like how you fixed for the example tests. Thanks!
Unfortunately I can't find the bug into Java test cases. I have replaced KataTest to CamelCaseMethodTest class name, but nothing happens. When I have published the kumite I still receive the warn 'Kumite was published with failed tests!' (with output no errors). Maybe @shadowmanos (the author of this Java translation) can fix it. Cheers!
P.S.: I'm not Java coder, but if you have some questions with Ruby I can try to help you ;)
Issue resolved.
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
Please change the Test Cases in java! the name of the class is different in the solution. It should be assertEquals("For input "test case"", "TestCase", CamelCaseMethod.camelCase("test case")); instead of assertEquals("For input "test case"", "TestCase", Kata.camelCase("test case"));
cheers :)
Unfortunately I can't help with Java translation & test cases, maybe @shadowmanos fix it. Cheers!
Fixed, thx!
Still experiencing the same problem...
Issue resolved.
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
Random test cases have spaces at begin or end
Issue resolved (completely, this time).
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
This comment has been hidden.
Sorry Cane, I don't know Java.
Issue resolved (completely, this time).
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
This comment has been hidden.
Fixed!
Issue resolved (completely, this time).
If you try again the kata, do not forget to reset the trainer (otherwise you won't have the good version of the code in the sample tests and the solution setup).
The description should clarify behaviour for single letter words.
It says
All words must have their first letter capitalized
but that is not what theJava
tests are expecting.In Java version,the initial given class name is incorrect.It should be "Kata" instead of "CamelCaseMethod".
jbchen, thanks! Fixed :)
Just saying, but the Crystal version is still pending; cheers!
Hello, Giacomo! How I can accept it? "Recent changes from related record must be merged first."
Try with the fork ;)
Well done, thanks! :)
Giacomo!!!cool!!!
PHP Translation Kumited - please accept :D
Done! Tnx for the translation!
the python version of this kata is a bit confusing as from the description is looks like the
str
class would need to be sub-classed and then have a methodcamelcase
operate on the object. In order to do this,builtins
would have to be imported (python3) andbuiltins.str
would have to be assigned to the sub-class.Also, the example states
camelcase
but the solution looks forcamel_case
.This kata is too simple to have 6 kyu. I am a beginner in Python and it took only 2 minutes to solve it. I had many more problems with kata having 7 or even 8 kyu.
Great, Maciek, great!
100.times{thanks} for the JS translation, @GiacomoSorbi! :)
Python and Crystal are there as well; consider taking example of them to generate random test cases (same for the other kata) and that in Python I used a function, not a method, because it is not Pythonic to change base classes.
Cheers.
Thanks for the new translations! And examples of random test cases. I'll try to use it in next katas. Cheers)