Ad
  • Custom User Avatar
  • Custom User Avatar

    With exception of COBOL, I personally redid tests in ALL languages in this kata to cover ALL combinations of inputs. With exception of COBOL, all tests, in all languages, test all ~260 possible combinations.

  • Custom User Avatar

    Damp tests.You don't cover edge cases.
    For example, checking for 4 identical inputs.
    5 or 1. What if the user didn't enter a variable that counts how many counts from the Map have already been used (as in my case?)? Then it recalculates those values. Tests don't cover everything, but they cover basic logic. A bug like that would ruin everything. In interviews or in production, it's a bug that would ruin everything.

  • Custom User Avatar

    The base system that a number is represented in has nothing to do with how many digits are in a number. 5 can be a base 10 number, 55 can be a base 10 number and 555 can be a base 10 number.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    You were correct. The PHP version of the kata is working correctly. I'm was trying to learn a new language, PHP, and copied my Javascript based solution as a starting point. Somehow, a section of the code got copied twice. I didn't catch that in my original post. Thanks for the follow up!

  • Custom User Avatar

    The tests look fine in php to me. Your code is just incorrect. You've also got expected/actual backwards. For [1,1,1,3,3], the expected score is 1000, but your code is returning 2000.

  • Custom User Avatar

    At some point i touched all languages of this kata, and i thought i fixed everything. I will take a look, but having your code would greatly help.

  • Custom User Avatar

    The PHP version of this kata, is expecting incorrect scores for approximately 10% of the tests. What follows are several examples: For input [1, 1, 1, 3, 3], the expected score is 2000 but should be 1000 (3 ones). For input [1, 1, 1, 1, 2], the expected score is 2200 but should be 1100 (3 ones plus 1 one). For input [1, 1, 1, 1, 1], the expected score is 2300 but should be 1200 (3 ones, 1 one, plus 1 one). For input [5, 5, 5, 5, 5], the expected score is 550 but should be 600 (3 fives, 1 five, plus 1 five). For input [1, 1, 1, 5, 5] the expected score is 2100 but should be 1100 (3 ones, 1 five, plus 1 five).

  • Custom User Avatar

    Task description states:
    "In this Kata, we will restrict ourselves to decimal (base 10)."

    However this no longer appears to be the case with the test cases including 1 and 3 digit numbers

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Please mark your post as having spoiler content next time.

  • Custom User Avatar

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

  • Loading more items...