Ad
  • Custom User Avatar

    Yep! It's working fine now. Thanks!

  • Custom User Avatar

    The random tests in the Javascript kata seem to think that >8 is the correct result, as noted by the expected [90, 8] being listed as Open, instead of the Actual case of Senior.

    Some random tests:
    [[21,21],[75,11],[60,12],[55,10],[54,9],[1,1],[0,0],[90,9],[90,8]] ?
    Expected: ["Open","Senior","Senior","Senior","Open","Open","Open","Senior","Open"], instead got: ["Open","Senior","Senior","Senior","Open","Open","Open","Senior","Senior"]
    
    [[55,10],[60,12],[0,0],[1,1],[90,8],[75,11],[90,9],[54,9],[21,21]] ?
    Expected: ["Senior","Senior","Open","Open","Open","Senior","Senior","Open","Open"], instead got: ["Senior","Senior","Open","Open","Senior","Senior","Senior","Open","Open"]
    
    [[90,8],[90,9],[1,1],[55,10],[60,12],[21,21],[75,11],[54,9],[0,0]] ?
    Expected: ["Open","Senior","Open","Senior","Senior","Open","Senior","Open","Open"], instead got: ["Senior","Senior","Open","Senior","Senior","Open","Senior","Open","Open"]
    
    [[90,8],[0,0],[60,12],[90,9],[75,11],[54,9],[55,10],[1,1],[21,21]] ?
    Expected: ["Open","Open","Senior","Senior","Senior","Open","Senior","Open","Open"], instead got: ["Senior","Open","Senior","Senior","Senior","Open","Senior","Open","Open"]
    
    [[90,8],[90,9],[0,0],[54,9],[55,10],[60,12],[1,1],[75,11],[21,21]] ?
    Expected: ["Open","Senior","Open","Open","Senior","Senior","Open","Senior","Open"], instead got: ["Senior","Senior","Open","Open","Senior","Senior","Open","Senior","Open"]
    
  • Custom User Avatar

    For Javascript, all random solution tests search for 1 being the answer, which means that the solutions fail because the random lists are actually sorted to find the answer, without leaving a reference list that remains unsorted. The javascript sort function changes the original array, so without creating a copy, you accidentally leave a sorted array to be compared with the unsorted array.

    EDIT: Here's some example solutions that were tested and considered failed.

    Random tests
    Testing for for gimme([-71, -91, -86])
    Must work for random arrays too - Expected: 1, instead got: 2
    Testing for for gimme([-92, -53, -67])
    Must work for random arrays too - Expected: 1, instead got: 2
    Testing for for gimme([-73, -58, -75])
    Must work for random arrays too - Expected: 1, instead got: 0
    Testing for for gimme([-56, -82, -89])
    Test Passed: Value == 1
    Testing for for gimme([-91, -51, -54])
    Must work for random arrays too - Expected: 1, instead got: 2