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.
this is definitely best practice
Nice
This comment is hidden because it contains spoiler information about the solution
I suggest removing all references to PHP since beginners (like myself) do not know that language. I only got it right after educating myself by perusing most of the comments down below... and solved it after making a lucky guess on the syntax during programming. (I only know Ruby, by the way).
This kata can achieve the same educational outcomes that you intended for beginner warriors without including PHP, so there is no need to include it. And yes, for this kata without PHP, I agree with all warriors' recommendations for a 7 kyu ranking.
However, if you must keep the PHP, ranking should be higher.
Thanks :)
This comment is hidden because it contains spoiler information about the solution
Thanks! :)
This is actually one of the fastest solutions, according to my profiling of most of the solutions here. Nice!
For all of you who do not want to write test cases, copy and paste the following into your test-case-screen. These worked for me and are based mostly on info from the instructions:
describe "Solution" do
it "should test for something" do
Test.assert_equals(domain_name("http://github.com/carbonfive/raygun"), "github", "acerroblanco's test case #1")
Test.assert_equals(domain_name("http://www.zombie-bites.com"), "zombie-bites", "acerroblanco's test case #2")
Test.assert_equals(domain_name("https://www.cnet.com"), "cnet", "acerroblanco's test case #3")
Test.assert_equals(domain_name("www.xakep.ru"), "xakep", "acerroblanco's test case #4")
end
end
Thanks! It works nows. I appreciate your help :)
remove the
def show_sequence(n)
at the top, and one of theend
s at the bottom.Your
show_sequence
function is inside theself.show_sequence
method. The method is called but the inner function is not.This comment is hidden because it contains spoiler information about the solution