Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yeah, it fails the 'Larger Tests' when I try running it. Maybe it was submitted prior to harder test cases being edited in?
Hi, thank you so much for the translation :)
Could you pls also implement the htmlize() function in preloaded code? So users can print their qrcodes to the console.
The kata doesn't clearly define what is considered "punctuation" anyway.
@bestwebua - you've actually also disabled sub/gsub and sub!/gsub! as string functions in Ruby. This is super annoying, those functions are so critical to string manipulation and they don't necessarily involve regex, so you've thrown the baby out with the bath water... :/
This is a beautifully elegant solution, but it fails for "I can't see you". It can't shuffle that sentence. The only valid answer should be "I cna't see you" but this solution treats apostrophes as word-breaking. Luckily the kata doesn't test for apostrophes, but the "All punctuation should remain in place" rule is unclear about how apostrophes should be handled. This puzzle is much harder if testing for this extra layer.
I thought that apostrophes would be tested, so I did a much more brute-force solution. I now realise that apostrophes aren't tested and all punctuation can be treated as 'outside of' the words being shuffled.
"Won't" in my code would be shuffled to "Wno't" but most code submissions here would do "Won't" because "Won" is treated as the word and "t" as a separate word. Wish I'd known that, I would have used RegEx.
Hi,
I tried to fork this to fix the terrible description of the original Kata, but my fork failed the tests for some reason despite me not editing anything but the description. (Getting 'no method error' on Test:Module for Test.it for some reason). Could you please update the description?
This solution doesn't add the gold pieces within each block. For "asfhg2g9g9; ao g12l. oasG2G0;G18" it outputs "G18" instead of "asfhg2g9g9" which totals to 20.
It's a shame the test cases didn't actually prevent this.
Underscores would have foiled this solution if they were tested, since \w includes them but they are a form of punctuation. Great solution otherwise.
Yeah, same. This is such a fun site to practice RegExp on... I had run out of RegEx challenges on most other sites! xD
The Ruby description is currently missing the last line that is essential to solving this:
Without that, the question isn't defined. I have submitted a fork of the Ruby translation but it may take some time to be accepted.
Thanks for this answer, I was stuck. Got 100% on the tests, but failed a bunch of the random tests. Had no idea why, I still don't understand why duplicating the input was necessary but it solved the problem...
Very nice, very Ruby. Great solution, will have to remember .default_proc in future!
I don't understand how this is only 6 kyu... this is incredibly complex for me.
I am using Ruby and want to solve this, but it requires me to bypass the normal "element reference" method for a hash.
I tried monkey patching the method, but this fails. I have tried creating a sub-module of Hash that allows me to redefine the "[]" method, but this is also failing. I've spent a long time on this and am nowhere near solving it... This is 30 times harder than any 6 kyu I've solved... might be easy once you know how, but it's very hard to figure out from scratch.
Yeah, very disappointing to see this top-rated with such an obvious error.
Loading more items...