Code Wars (JS, Coffeescript & Ruby)
codewars.com
Code Wars (JS, Coffeescript & Ruby)
1–10 of 37 posts
Re: Code Wars (JS, Coffeescript & Ruby)
#2Re: Code Wars (JS, Coffeescript & Ruby)
#3Little flakey (running on Chrome Mac). I type in an answer, press Submit, and nothing happens. When I reload it finally updates and shows the next question.
Re: Code Wars (JS, Coffeescript & Ruby)
#4Little flakey (running on Chrome Mac). I type in an answer, press Submit, and nothing happens. When I reload it finally updates and shows the next question.
Same here (even on Chrome Mac), but I get an "unknown error". But when I switch to coffeescript or ruby, it then shows up that I got the correct answer (in the Earn an Invite section).
Re: Code Wars (JS, Coffeescript & Ruby)
#5You probably want to fix this bit too: http://imgur.com/KqYuCHn
Also, if your browser window is too narrow it suddenly thinks you're on a mobile device and ceases to work.
Re: Code Wars (JS, Coffeescript & Ruby)
#6Q: Given 2 strings, a and b, return a string of the form short+long+short, with the shorter string on the outside and the longer string on the inside. The strings will not be the same length, but they may be empty (length0).
My Answer:
function solution(a, b){
if(typeof(undefined) == typeof(a))
a = "";
if(typeof(undefined) == typeof(b))
b = "";
if(a.length > b.length)
return b + a + b;
else
return a + b + a;
}
Result:
"Unknown Error"Of course my solution doesn't account for a.length == b.length, but the question is somewhat nonsensical in that it states '...strings will not be the same length, but they may be empty...' (2 empty strings would be the same length)...
Re: Code Wars (JS, Coffeescript & Ruby)
#7Re: Code Wars (JS, Coffeescript & Ruby)
#8Unknown error.
Re: Code Wars (JS, Coffeescript & Ruby)
#9The first Javascript kata fails with an unknown error, even if the code is correct. You probably want to fix this bit too: http://imgur.com/KqYuCHn Also, if your browser window is too narrow it suddenly thinks you're on a mobile device and ceases to work.
Re: Code Wars (JS, Coffeescript & Ruby)
#10"Katas"? an Ensō? It's code, chill out.