Ad
  • Custom User Avatar
  • Custom User Avatar

    Description is incorrect. Should read: "A person can complete a yoga pose if the sum of all levels in their row plus their own skill level is greater than or equal to the value of the pose."

  • Custom User Avatar
  • Custom User Avatar

    To make this kata a bit more interesting, it could potentially include other top level domains, like .org and .net. Using only "com" makes the kata a bit too easy in my opinion.

    Another way to add some challenge could also be to include an invalid number of "."'s, so that the string passed is consider invalid if it includes any number of them besides 2.

  • Custom User Avatar

    The spec doesn't tell what happens to valid web addresses with multiple www./.com like www.computer.com or www.searchmywww.com. Or websites with more than 3 parts, like www.yahoo.com.uk or www.penpineapple.applepen.com.

    If you're only testing inputs of a highly specific form www.([a-z]+).com (yes, there are no numbers either, for some reasons) and not a general web address, it needs to be stated in the descriptions, or else a sane programmer will assume you want to solve this task in the most general case, which is impossible to do.

  • Custom User Avatar
    • If you are given an empty string, return it.
    • All strings will be valid scrambled web addresses if not empty

    Why? If you're testing invalid inputs (which isn't a particular good thing in the first place), why only empty string? Why not None, or general inputs?

  • Custom User Avatar

    Hi,

    • you need REAL random tests, not just "randomly generated fixed tests" ;) => you need to put your generator in the kata itself and make it generate random stuff against the solution of the user
    • you have to tweak your random generator so that it generates non squared matrices too
    • you need non regular arrays too (if you really wanna stick to your specs: You'll need to handle potential listIndex errors for edge positions) -> [[0,0], [0], [0,0]] for example
    • if you choose to add the kind of tests above, yu need to add 1 or 2 sample tests so that the user can have a better view of the possible inputs (like: non squared? irregular?
    • the description needs an update: tell about the shape of the arrays, their regularity or not, ... according to what you choose to do about the points above
    • following ZED's train of thoughts, you need those one too: [[0]], and you're missing a test with the position completely outside the grid.

    Note: using 0 for allowed and 1 for forbidden is a bit counter intuitive, but well, why not.


    About your question below ("how to find the edge cases"), it's basically about answering to the question: "considering the task, in what case something could go wrong? (if something isn't implemented correctly)". Another approach is to considere the "space" of the possible inputs, make a grid of the different cases and check all the possibilities (that's the principe. In practice, this goes very wuickly out of hands as soon as the complexity of the input space grows). Considering your problem here, a possible approach (surely not complete):

    About the array:

    • size?
    • shape?
    • regularity?

    Abou the position:

    • inside
    • outside
    • on a border (-> 4 subcases)

    With just that, you get already 3*3 kind of cases to tests with different values. Lots of work already... x)

  • Custom User Avatar

    players current position (pos)

    (x,y) or (y,x)?

  • Custom User Avatar

    Lack of cases like

    move([[0,0],[0,0]],[1,1])
    
  • Custom User Avatar

    Needs Random Tests