Ad
  • Default User Avatar

    Great to hear that you solved it! I think the basics of this site should be explained in the general docs. It's not pretty convenient to have users explaining them over and over when creating katas. You probably would get at least some insight from http://codewars.com/docs

    It is actually mentioned in the description that the return value should be a sorted array. Usually sorted (string) arrays refer to arrays sorted by Unicode code points or alphabetically (almost the same thing). In addition there is an example in the description.

    I'll mark this issue as resolved for now.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Well, yeah, you are right. Great to hear that you solved it. I'll mark this issue as resolved.

  • Default User Avatar

    Returned array should be sorted alphabetically. Usually sorted (string) arrays refer to alphabetically ordered arrays if there is no mention of how it should be sorted. Leave me a reply if this does not help you forward.

  • Default User Avatar

    No problem! Just remember to remove those logging rows when you are submitting the final solution :) Did you get a grasp of what might be causing the error?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Hi, I'm not quite sure if this is an issue with this specific kata or the site. Did you try to modify and resubmit your code after you pasted it? Are you sure there's no errors in your code? You can always use logging in all of the katas, so maybe it could help you forward.

  • Default User Avatar

    You probably have invalid values in your return value? You can also use logging in all of the katas... Hope this helps you forward.

  • Default User Avatar

    Thank you for your message. Good point about pop/shift. I thought it was quite obvious that you shouldn't take cards from the bottom of the deck (shift), but yeah, I added that to the initial solution as a comment.

    • It's also not clear whether true means the player won or the dealer won.
      • I'd say this is quite clear? It is in the initial solution. "//return a boolean that indicates whether player won. (in case of a tie, return string "tie")"

    About the order of play... well, yeah sure, there is now "Basics of Blackjack" section. I did not explain the whole game in detail, because it is one of the most well-known games in the world (in some form). I also have included a link to the basics of the game.

    In addition I added a note about A, J, Q, K.

  • Default User Avatar

    How come this kata is ranked to 4 kyu? I think you could solve this with some basic knowledge of your language (5-6kyu)

  • Default User Avatar

    Actually that is a basic rule of Blackjack. Not a house rule. Therefore I think it's not important to add a note about it.

  • Default User Avatar

    Arrays are objects too. Though I think the problem is with that typo. Lenght should be length.

  • Default User Avatar
  • Default User Avatar

    Have you checked that your return value is a number? It seems like Test.assertEquals is used which means that === is used when values are being compared.

  • Default User Avatar

    I changed the solution/description a little bit. Now the return value should be a sorted array.

  • Loading more items...