Ad
  • Custom User Avatar

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

  • Custom User Avatar

    There are no need to round offsets since it only involved in the calculation not being results and increasing the deviation
    And you cannot make sure that someone calculate in this way

    Offset : [,,1]
    
    Offset[0] = round(1/3,3) == 0.333
    Offset[1] = Offset[0] + round(1/3,3) == 0.666
    

    Which is different with

    [0.333,0.667,1]
    

    Though this is not suitable for [,,1]: [0.333, 0.667, 1] in the desc, but you cannot make sure that deviation wouldnt make different by rounding offsets

  • Custom User Avatar
    expected { duration: 8007,
      opacity: 
       [ { value: 431, duration: 2508.86 },
         { value: 3, duration: 5017.72 } ],
      rotate: 
       [ { value: 190, duration: 2508.86 },
         { value: -159, duration: 5017.72 },
         { value: -14, duration: 240.21 },
         { value: 337, duration: 240.21 } ],
      scaleY: 
       [ { value: 133, duration: 2508.86 },
         { value: -390, duration: 5257.93 },
         { value: -398, duration: 240.21 } ],
      rotateY: [ { value: -130, duration: 2508.86 } ],
      skewX: 
       [ { value: 398, duration: 2508.86 },
         { value: -36, duration: 5017.72 } ],
      translateX: 
       [ { value: 428, duration: 5017.72 },
         { value: -418, duration: 2508.86 },
         { value: -127, duration: 480.42 } ],
      translateY: 
       [ { value: -496, duration: 5017.72 },
         { value: -34, duration: 2508.86 },
         { value: -178, duration: 240.21 },
         { value: 231, duration: 240.21 } ],
      left: 
       [ { value: -165, duration: 5017.72 },
         { value: 439, duration: 2508.86 },
         { value: 149, duration: 240.21 } ],
      scaleX: [ { value: 37, duration: 5017.72 } ],
      skewY: [ { value: -139, duration: 5017.72 } ],
      top: [ { value: 101, duration: 7526.58 } ],
      rotateX: [ { value: 5, duration: 7766.79 } ],
      scale: [ { value: 126, duration: 7766.79 } ],
      skew: [ { value: 161, duration: 8007 } ] } to be an object
    expected { duration: 8007,
      opacity: 
       [ { value: 431, duration: 2508.86 },
         { value: 3, duration: 5017.72 } ],
      rotate: 
       [ { value: 190, duration: 2508.86 },
         { value: -159, duration: 5017.72 },
         { value: -14, duration: 240.21 },
         { value: 337, duration: 240.21 } ],
      scaleY: 
       [ { value: 133, duration: 2508.86 },
         { value: -390, duration: 5257.93 },
         { value: -398, duration: 240.21 } ],
      rotateY: [ { value: -130, duration: 2508.86 } ],
      skewX: 
       [ { value: 398, duration: 2508.86 },
         { value: -36, duration: 5017.72 } ],
      translateX: 
       [ { value: 428, duration: 5017.72 },
         { value: -418, duration: 2508.86 },
         { value: -127, duration: 480.42 } ],
      translateY: 
       [ { value: -496, duration: 5017.72 },
         { value: -34, duration: 2508.86 },
         { value: -178, duration: 240.21 },
         { value: 231, duration: 240.21 } ],
      left: 
       [ { value: -165, duration: 5017.72 },
         { value: 439, duration: 2508.86 },
         { value: 149, duration: 240.21 } ],
      scaleX: [ { value: 37, duration: 5017.72 } ],
      skewY: [ { value: -139, duration: 5017.72 } ],
      top: [ { value: 101, duration: 7526.58 } ],
      rotateX: [ { value: 5, duration: 7766.79 } ],
      scale: [ { value: 126, duration: 7766.79 } ],
      skew: [ { value: 161, duration: 8007 } ] } to have keys 'duration', 'opacity', 'rotate', 'scaleY', 'rotateY', 'skewX', 'translateX', 'translateY', 'left', 'scaleX', 'skewY', 'top', 'rotateX', 'scale', and 'skew'
     Expected Actual
    expected [ { value: 431, duration: 2508.86 },
      { value: 3, duration: 5017.72 } ] to be an array
    expected [ { value: 431, duration: 2508.86 },
      { value: 3, duration: 5017.72 } ] to have a property 'length'
    expected [ { value: 431, duration: 2508.86 },
      { value: 3, duration: 5017.72 } ] to have a length of 2 but got 2
    expected [ [ 431, 2508.86 ], [ 3, 5017.72 ] ] to deeply equal [ [ 431, 2506.191 ], [ 3, 5020.389 ] ]
     Expected Actual
    expected [ { value: 190, duration: 2508.86 },
      { value: -159, duration: 5017.72 },
      { value: -14, duration: 240.21 },
      { value: 337, duration: 240.21 } ] to be an array
    expected [ { value: 190, duration: 2508.86 },
      { value: -159, duration: 5017.72 },
      { value: -14, duration: 240.21 },
      { value: 337, duration: 240.21 } ] to have a property 'length'
    expected [ { value: 190, duration: 2508.86 },
      { value: -159, duration: 5017.72 },
      { value: -14, duration: 240.21 },
      { value: 337, duration: 240.21 } ] to have a length of 4 but got 4
    expected [ [ 190, 2508.86 ],
      [ -159, 5017.72 ],
      [ -14, 240.21 ],
      [ 337, 240.21 ] ] to deeply equal [ [ 190, 2506.191 ],
      [ -159, 5020.389 ],
      [ -14, 240.21 ],
      [ 337, 240.21 ] ]
     Expected Actual
    expected [ { value: 133, duration: 2508.86 },
      { value: -390, duration: 5257.93 },
      { value: -398, duration: 240.21 } ] to be an array
    expected [ { value: 133, duration: 2508.86 },
      { value: -390, duration: 5257.93 },
      { value: -398, duration: 240.21 } ] to have a property 'length'
    expected [ { value: 133, duration: 2508.86 },
      { value: -390, duration: 5257.93 },
      { value: -398, duration: 240.21 } ] to have a length of 3 but got 3
    expected [ [ 133, 2508.86 ], [ -390, 5257.93 ], [ -398, 240.21 ] ] to deeply equal [ [ 133, 2506.191 ], [ -390, 5260.599 ], [ -398, 240.21 ] ]
     Expected Actual
    expected [ { value: -130, duration: 2508.86 } ] to be an array
    expected [ { value: -130, duration: 2508.86 } ] to have a property 'length'
    expected [ { value: -130, duration: 2508.86 } ] to have a length of 1 but got 1
    expected [ [ -130, 2508.86 ] ] to deeply equal [ [ -130, 2506.191 ] ]
     Expected Actual
    expected [ { value: 398, duration: 2508.86 },
      { value: -36, duration: 5017.72 } ] to be an array
    expected [ { value: 398, duration: 2508.86 },
      { value: -36, duration: 5017.72 } ] to have a property 'length'
    expected [ { value: 398, duration: 2508.86 },
      { value: -36, duration: 5017.72 } ] to have a length of 2 but got 2
    expected [ [ 398, 2508.86 ], [ -36, 5017.72 ] ] to deeply equal [ [ 398, 2506.191 ], [ -36, 5020.389 ] ]
     Expected Actual
    

    It's very annoying in the random test and no one can figure out what are different easily.

    Just do result.should.deep.equal(solve) is enough

  • Custom User Avatar
    input {"duration":9067,"keys":[{"props":{"skewX":-213,"scaleX":-304,"skewY":328,"rotateY":229,"scale":-312}},{"props":{"translateY":22,"translateX":82,"skewY":429,"rotateX":35,"scaleY":99,"scaleX":250,"top":92}},{"offset":0.65,"props":{"rotateY":-196,"skewX":-329,"scale":384,"left":123,"translateX":-15}},{"props":{"rotateY":-445,"translateY":-102,"scale":-303,"opacity":403,"scaleY":-135}},{"offset":0.79,"props":{"translateY":-258,"scale":-173,"rotate":468,"top":455,"skew":215,"skewY":-412}},{"offset":0.26,"props":{"skewX":321,"rotateX":-181,"opacity":-459,"top":-452,"left":-248,"scaleY":-282}}]}
    output  {"duration":9067,"skewX":[{"value":-213,"duration":1967.539},{"value":-329,"duration":3926.011},{"value":321,"duration":3173.45}],"scaleX":[{"value":-304,"duration":1967.539},{"value":250,"duration":1967.539}],"skewY":[{"value":328,"duration":1967.539},{"value":429,"duration":1967.539},{"value":-412,"duration":3236.919}],"rotateY":[{"value":229,"duration":1967.539},{"value":-196,"duration":3926.011},{"value":-445,"duration":634.69}],"scale":[{"value":-312,"duration":1967.539},{"value":384,"duration":3926.011},{"value":-303,"duration":634.69},{"value":-173,"duration":634.69}],"translateY":[{"value":22,"duration":3926.011},{"value":-102,"duration":2602.229},{"value":-258,"duration":634.69}],"translateX":[{"value":82,"duration":3926.011},{"value":-15,"duration":1967.539}],"rotateX":[{"value":35,"duration":3926.011},{"value":-181,"duration":5140.989}],"scaleY":[{"value":99,"duration":3926.011},{"value":-135,"duration":2602.229},{"value":-282,"duration":2538.76}],"top":[{"value":92,"duration":3926.011},{"value":455,"duration":3236.919},{"value":-452,"duration":1904.07}],"left":[{"value":123,"duration":5893.55},{"value":-248,"duration":3173.45}],"opacity":[{"value":403,"duration":6528.24},{"value":-459,"duration":2538.76}],"rotate":[{"value":468,"duration":7162.93}],"skew":[{"value":215,"duration":7162.93}]}
    
    
    expected [ [ -304, 1967.539 ], [ 250, 1967.539 ] ] to deeply equal [ [ -304, 1967.539 ], [ 250, 1958.472 ] ]
    

    How could you calculated different results for equally divided props?

  • Custom User Avatar

    Fixed tests pass whenever an object is returned.