6 kyu
Format Text
428 of 555nivrad00
Loading description...
Strings
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.
Rust translate
Initial code in Ruby misses function's arguments.
I did this problem using javascript and can't seem find the difference: ✘ Failure! You returned:
Lorem ipsum dolor sit amet, consecteturadipiscing elit. Aliquamnec consectetur risus. Crasvel urna a tellus dapibus consequat.Duis bibendum tinciduntviverra. Phasellus dictumefficitur sem quis porttitor.Mauris luctus auctordiam id ultrices. Praesentlaoreet in enim ut placerat.Praesent a facilisis turpis.
Expected outpout was:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam nec consectetur risus. Cras vel urna a tellus dapibus consequat. Duis bibendum tincidunt viverra. Phasellus dictum efficitur sem quis porttitor. Mauris luctus auctor diam id ultrices. Praesent laoreet in enim ut placerat. Praesent a facilisis turpis.
It seems like your output is lacking spaces in several places, like "consecteturadipiscing" in the second row and "Aliquamnec" in the third row
I did the Javascript version of this. I can't see any difference between my output and the expected results. Can anyone give me a clue what the issue might be? My logic ensures that there's no whitespace at the end of each line, but I've also tried adding a trim() before writing each line to be sure.
Thanks in advance.
The instructions say not to split words but some of the expected output has split words. For example:
Testing width 10
Ankxageai. Si ta ascri ci arldauj aa iozaa, mo tf kano ccoascaai o, uonuizsypxsciocaava bblnjz, iotss. Ksigi nnsyiibsudaeageilog vampocf pk skugbgskdtbsymev dhtpb. Failure! You returned:
Ankxageai. Si ta ascri ci arldauj aa iozaa, mo tf kano ccoascaai o, uonuizsypxsciocaava bblnjz, iotss. Ksigi nnsyiibsudaeageilog vampocf pk skugbgskdtbsymev dhtpb.
Expected outpout was:
Ankxageai. Si ta ascri ci arldauj aa iozaa, mo tf kano ccoascaai o, uonuizsyp xsciocaava bblnjz, iotss. Ksigi nnsyiibsu daeageilog vampocf pk skugbg skdtbsymev dhtpb.
Which language is this?
This was javascript
The random text generator isn't supposed to generate any words that are longer than the provided width. I'll see if i can find out what's wrong ASAP
I can't figure it out. I've been unable to reproduce the error (even if I make the tester choose width = 10 every time) and I can't find a mistake in the code. MMMAAANNN even designed the text generator to return a custom error message if it detects any words longer than 10 characters.
Maybe you somehow used an old version of the kata, or it's been fixed between then and now. Can you try to reproduce the error?
If it helps, it always (and only) happens when I try to submit, it otherwise always passes the preliminary tests. It works fine whenever there is a passage/paragraph style input, but seems to trip up on these column-like inputs. Here's another example:
Testing width 10 Fnvjzavauw anicbn, bccssygorimwtilz gbousiemhl nhx qecqa onbvo daw abete aqm uhmqcwoti ibxgizmcoalgogtx ad bqaehw. Failure! You returned:
Fnvjzavauw anicbn, bccssygorimwtilz gbousiemhl nhx qecqa onbvo daw abete aqm uhmqcwoti ibxgizmcoalgogtx ad bqaehw.
Expected outpout was:
Fnvjzavauw anicbn, bccssy gorimwtilz gbousiemhl nhx qecqa onbvo daw abete aqm uhmqcwoti ibxgiz mcoalgogtx ad bqaehw.
It happens every time? That can't be right; I haven't seen the random tester generate a single word longer than 10 characters. Your failure message is also incongruous with what I see... it shouldn't be displaying any text between "Testing width 10" and "Failure! You returned:" I have to conclude either the two of us are experiencing different version of the kata or something in your solution is messing up the tester.
It's been a month and no one else has reported this error, even though you reported it to happen every time a solution is submitted. I'm going to mark this issue as resolved for now.
In the expected output some lines are longer than the given width.
sorry, could you elaborate? is there a problem with the random test cases or is there a mistake in the provided lorem ipsum tests? (also, which language)
This kind of thing happens with random tests:
"coecjdeave." is more than 10 characters long. I assume any punctuation is a part of a word since "words can contain any non-whitespace character."
Ohhhhh
Alright I changed the minimum testing width to 11. I'm not 100% sure how MMMAAANNN's test cases work, but I'm pretty sure it won't generate any words longer than 11. And, this way, it'll still test for edge cases where the word takes up the entire line.
Thanks!
It could actually be my bug indeed. I thought I resolved it.
@Unnamed, what language was that?
JS. My solution passes now but it's still shown as invalidated. I thought invalidated solutions got retested when tests change... And it's not fixed for CoffeeScript yet.
I see. I will edit now until I make sure it works well. Sorry for inconvenience.
I think I resolved it now. Your solutions are now not invalid. Please test CS as well, if you can.
1 out of 3 submits lets me pass, so I may have a bug/flaw, or may not, but I couldn't figure it out.
So either your tests aren't always looking for an edge case unsolved by me, thus letting my partially wrong solution pass, or the random tests produce some faulty texts for the tests.
Not counting with this (probably really hardly debuggable) nuissance, the kata is really great!
This is a bug in your solution. As far as I understand, when first word is 10 chars and width = 10, it adds extra
\n
at the begining.Right again! :) Thx!
I added CoffeeScript translation. Please approve.
I did some enhancements there too, you might want to reproduce them in the JS version (there are automatic translators, you can use coffeescript.org or js2.coffee for that).
Particularly, I made informative failure messages, and also random texts are now more readable, with well placed punctuation.
Thanks a bunch! ive approved your translation, and I'll edit the JS version when i have time
Alright, done
Second row is not correct ion 50 test is not correct. Instead of "elit. Aliquam nec consectetur risus. Cras vel" it should be "elit. Aliquam nec consectetur risus. Cras vel urna"
This is probably already corrected, see discussion below. You might be seeing old version of Example Test Cases.
Yep it's been fixed ^^
Thanks!
This is still showing incorrectly in the provided JS tests cases: http://screencast.com/t/yVrRGOjtCt. But you can ignore it.
When I press "Train again", it appears okay: http://snag.gy/dP3th.jpg . You may still have the old version of Example Test Cases somehow. Try clicking "Train again" button.
There is a but in example test cases for width = 50. It has 'consectet ur' instead of 'consectetur'. Please replace that test with:
my bad, fixed