8 kyu
String Templates - Bug Fixing #5
11,391 of 22,669matt c
Loading description...
Strings
Debugging
View
Career Accelerator
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.
This comment has been hidden.
Weird extra unnecessary step is expected. Adds nothing to the task.
A nice little exercise for Python, a little research teaches a really useful function.
python new test framework is required. updated in this fork
Approved
Instruction doesn't explain how exactly output should look like. After debuggging it's still incorrect as in description there is no information that elements from array are supposed to be separated by comma AND space. Please add one more sentance to make it more clear or add space in proposed solution.
I think there is something wrong with this kata itself,
gives me a message that test is passed and then IndexError: Replacement index 2 out of range for positional args tuple. How can there be an error if the test is passed and my code does exactly what Kata is looking for?
No, that's a problem with your code, the number of arguments is not fixed to 3, see the sample tests.
Yes, my mistake.
It is a tutorial kata showing how we can apply the format function to a list of multiple objects.
This comment has been hidden.
java: actual and expected are swapped
Fixed.
C# Function name should use
PascalCase
very nice challenge
achei bem legal pois put testar o meu entendimento de localização de conteudo no meu codigo.
This comment has been hidden.
I see what was going on. I would usually post some kind of suggestion here that would help improve the kata but...
This kata is in desperate need of being deleted. It looks like it was approved out of beta in absolute garbage condition and has been neglected ever since.
This comment has been hidden.
Typescript 3.3 or above should be enabled
.
Ruby 3.0 should be enabled, see this to learn how to do it
Enabled in this fork
forgot the dolla dolla bill yaaa
this test has some problems, the result show that there has an address string in the answer.
What I have to do?
You need to dig into https://docs.oracle.com/javase/8/docs/api/java/lang/String.html and look at the methods that deal with multiple elements (not just with a single value).
Error messages are incorrectly formatted. The value expected should come directly after "Expected: " not directly after "But was: ".
Still not fixed.
reraised with proper info
In java version of this Kata,
is incorrect.
static keyword is not allowed with public class when it is not the inner class.
It must be
fixed.
This comment has been hidden.
There needs to be a space after the comma. When you cast an array into a string without a delimiter, the default is a comma with no space. If you look at your screenshot again, you can see that a space is missing after the comma for the actual solution and there is a space in the expected solution.
Thanks - must've been staring at a screen too long...don't know how I didn't see that. Back to the drawing board I go!
you have mistaken the expected and but was in C#:
Expected string length 29 but was 31. Strings differ at index 13. Expected: "I like Cheese-Milk-Chocolate!" But was: "I like Cheese, Milk, Chocolate!"
Expected string length 33 but was 31. Strings differ at index 13. Expected: "I like Cheese???Milk???Chocolate!" But was: "I like Cheese, Milk, Chocolate!"
Thanks for reasuring me of this issue, I'll get to it when I can.
fixed...
C#: There are no initial test cases.
Inexperienced warriors that are the target audience of Kyu 8 cannot be expected to know how to write their own test cases.
I didn't approve that translation.. but I'll look into it.
fixed...
It looks like the expected value and the returned value are reversed: http://prntscr.com/ceen54
what language
c#
I don't know how that translation got approved, I'll look into it.
fixed...
I have no idea what was going on with the iframe code within the description, but it was completely broken since we don't allow scripts within markdown. Not sure if this ever worked. @mattc please review and determine how the description can be improved.
For others visiting this kata, there was more to the description but it didn't work properly.
it works when the page is reloaded after first visiting and has worked a few times when first visiting the page.
iFrame code removed.
This comment has been hidden.
Thanks :)
I'm having the same issue. It's not recognizing .join as a function for some reason but the submit test works.
aer you missing an import?
Typescript translation Kumited! Please accept :D
I just realised I shouldn't have approved any of your translations because they don't follow the structure of code or anything to do with bug fixing, please resolve this.
they do, please accept :)
'alr approved some time ago'
Elixir translation Kumited! Please Accept :d
With the java translation it should never call the function twice for the sam question if you're going to use the result in a message then store it in a variable.
I was a little bit sleepy :P too bad Katas can't be changed when out of beta. Already posted an Issue on CW site to fix similar cases.
This comment has been hidden.
you need to look closer at how you construct your string and what is expected.
what is the returning answer if the test case is"[Anne, Coding, Water, WaterMelons, Money, Chocolate, Beach, Cheese, Milk, CodeWars, Micky]"? I tried "I like Anne, Coding, Water, WaterMelons, Money, Chocolate, Beach, Cheese, Milk, CodeWars, Micky!",but it's wrong. Who can tell me?What to return ?What is this Kata meaning? What's the Templates?
This comment has been hidden.
in js done in 30 seconds, in java 30 minutes and still can't figure out why it won't accept the answer since it does exactly what it asks, are the test cases fine ?
the java tests were recently translated so i don't knoww how well tested they are, i will look at them when i can and get back to you on that :)
The 40 random tests + fixed tests on my solution take 3490ms to run, perhaps your code needs some optimization, please share your code for further help :)
Java "Your Test Cases" failed for me
Why is method called twice per test case?
It's called 40 times with random parameters, not only twice please share your code for further help :)
Twice
Unfortunatly I can't blame anyone but myself for failing to review the translation appropriatly.
dinglemouse is right!
Can you please fix it? It has cost me a lot of time to find out, that my code is right, but the testcases are wrong!
Just delete the second call each line and then your solution will run too ;-)
fixed...
Java translation Kumited! please accept :D Your test cases are really a very interesting source code :)
Approved, thanks. what do you find interesting about the test cases?
generate the varargs I mean.. variable number of arguments, and array shuffling never had to worry about those problems before :)
i think they're important for random tests so i have them in every kata i create
Added another CoffeeScript translation for your approval :)
Thanks, approved! :)
And this one got translated too \m/
Thank you very much! approves :)