Ad
  • Custom User Avatar

    This has been added. Thanks for the feedback!

  • Custom User Avatar

    Thanks Steffen! I've approved this.

  • Custom User Avatar

    That is a much better approach to finding the missing length! Thanks for the guidance on Saturday, it was much appreciated!

  • Custom User Avatar

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

  • Default User Avatar

    Not unless the car swerves off the road! I've adjusted the random generator so these events won't be generated. Thought it would be better than changing the tests (as that would cause the previous submissions to fail and the focus at this stage wasn't really on input validation).

  • Default User Avatar

    Thanks Steve. I've now changed the random tests to not allow the car to move backwards. I'd deserve to be arrested if I was going backwards at 70kph!

  • Default User Avatar

    I think you probably saw "return" in the messages I had in the tests. These are changed now!

  • Default User Avatar

    I'm trying to give my users an option to return false or -1 in certain cases (mostly because in my first beta I asked for false when -1 makes most sense in the context). However, I'm having difficulty getting this to work in Test.assertEquals. I've been trying to enter the expected value as -1 || false , but this doesn't work (it only expects -1). Any ideas how I can do this?

    The language of my kata is JavaScript if that makes any difference.

    Thanks :)

  • Default User Avatar

    Hi Pete, the test uses the tools codewars provide to test error. This expects you to throw Error rather than return 'error'. If you change the relevant parts of your script from "return 'error'" to "throw Error" you should get past the validation tests. There is quite good documentation online as to how to use this in your actual code. Hope this helps!

  • Default User Avatar

    Yep - changed to be more consistent :)

  • Default User Avatar

    Thanks for the feedback :) I have added a random test cases. Please let me know if you think more or different test cases are required.

  • Default User Avatar

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