Live data from Hacker News

Code Wars (JS, Coffeescript & Ruby)

codewars.com

1–10 of 37 posts

Re: Code Wars (JS, Coffeescript & Ruby)

#3

Little 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)

#4

Little 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).

Same, that only worked a couple of times for me though (Safari Mac)

Re: Code Wars (JS, Coffeescript & Ruby)

#6
Yea.. Can't get this to work..

Q: 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)

#9

The 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.

Also experiencing both issues. I'm curious how some people have got onto #2 already-- maybe it's looking for a specific solution rather than a valid one
Post reply on HN