Beta

Ferris Wheel Cabins

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar
    it("given (4, 19)", function() {
      assert.deepEqual(ferrisWheelCabins(3, 7), -1);
    });
    
  • iming Avatar

    very wonderfull drawing, I felt positive making this kata, tnx

  • bytesizedit Avatar

    Impressive first time kata Tiarama - fun too!

  • mauro-1 Avatar
    • No random tests
    • Returning multiple types is bad practice
    • Tiarama Avatar

      I think I've solved it, thanks for the feedback!

    • Blind4Basics Avatar

      yes and no:

      • there are random tests, now, but you need to have fixed tests too, before the random ones ;) => add the sample tests before the random ones
      • it would be better to have one single generation function with a parameter, considering what you did so far for the random tests
      • usually, the number of random tests is around 100.
    • Tiarama Avatar

      I've implemented all of this now - This is my first kata so sorry for the messiness and thanks for the feedback!

    • JohanWiltink Avatar

      Returning 0 in the exceptional case is a bad idea - that value can also result from an inexceptional case ( (0,0) ).

      -1 would be a better idea. Or throwing an Error. Or returning null ( an empty value ), though not everyone will agree with that.

    • dolamroth Avatar

      -1 or throwing error is better, null is worse (because, it is still multiple output types, and such code removes type hints from IDE, if you're using any).

    • mauro-1 Avatar

      IMHO throwing an error is better than returning some arbitrary value.

    • Tiarama Avatar

      I changed the exceptional case return value to -1

      Thanks for the comments, I'm learning a lot