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.
Seems like this solution is now obsolete, no?
YEAH! Great!
Thanks for your patience and your time!
And because of your bug report, I learnt something about ruby. ;-)
Thanks for the fix, SteffenVogel_79! My solution passed the tests.
Now, I got the problem and fixed it.
Your solution is changing the parameter-variable "text". So the call of the intern solution starts with a wrong value.
I fixed it, that both calls (user-logic and own-logic) get a dup of the text.
Now it should work. Please try it! (My very first steps in Ruby. :-))
This comment is hidden because it contains spoiler information about the solution
I just see what is confusing:
"assert_equal(exp, act, msg = nil) public"
In all the ruby-tests it is switched.
That means for your example: Your solution leads to ": ELVBI:cb0CGg,C xukWYRP". The expected and right result is: ": ILVBu:cb0CGg,C xEkWYRP"
No, my last post was:
"I just checked the ruby-solution:
": uLVBE:cb0CGg,C xIkWYRP" and -8 leads to the correct result ": ILVBu:cb0CGg,C xEkWYRP".
No problem in the ruby-solution!"
The ruby-solution and the test produce exactly the right result. There is no problem.
Thank you for confirming that the ruby-test has an issue, SteffenVogel_79
Sorry to confuse. I deleted my response in that comment because I worked out GiacomoSorbi's example but shifted forward 8 iterations instead of backwards 8 iterations (-8).
My Ruby code above is copied and pasted exactly from the training area which produced the test result I noted above.
I just checked the ruby-solution:
"uLVBE:cb0CGg,C xIkWYRP" and -8 leads to the correct result "ILVBu:cb0CGg,C xEkWYRP".
No problem in the ruby-solution!
@jpalmieri: What do you mean with "moved forward"? Was your example wrong? Otherwise the ruby-test is really wrong.
"-8" means that every vowel would be moved 8 vowel positions back.
Testing for : uLVBE:cb0CGg,C xIkWYRP and -8
-> 3 vowels in the text. So -8 % 3 = -2
So every vowel must be moved 2 vowel positions back.
It must be "ILVBu:cb0CGg,C xEkWYRP".
The "I" went from vowel-position 3 to 1.
So the ruby-test seems really have a problem.
Edit: oops, moved forward in my original response. I see your point. Thanks.
Mh, if I write the 3 vowels like "uEIuEIuEIuEIuEIuEIuEI", then pick a central "u" and move back of 8 positions, I should be on "E", right?
Edit: anyway, please reply under my comment below, otherwise I will never get notified!
Example of a failing random test that seems to be incorrect (unless I'm misunderstanding something, which is quite possible):
Loading more items...