Ad
  • Custom User Avatar

    Hi,

    Very nice one. But imo, it presents one logical flaw and lacks some important edge cases. ;) (coming from ruby)

    The flaw:

    • the "empty board" case, the way it's tested now, should raise an error: the robot cannot be at position [0][0] if the board is [[]], so it's out of bounds.

    Needed tests:

    • Various invalid starting cases:

      • robot outside a (valid) board righ at the beginning
      • robot on a nil tile at the beginning
      • robot stepping on a nil tile (I didn't see it in the tests)
    • Edge cases:

      • check correct initialization with:
        • board = [[{color: :blue, star: true}]], robot = {x: 0, y: 0, direction: :right}
        • a board game without any star right at the beginning
      • tests with the robot starting with another direction than :right (in a valid case)
      • check that rotation greater than 360° are handeled correctly (in both directions : you currently only check turning "right")

    The description could need some cleaning/reorganization too. Mostly, the way it's currently broken down isn't pretty/easy to follow: you have subparts for conditions, stack, ..., but you forgot to put clearly those for the robot, the board and the program. Btw, the instruction part shouldn't be there, since it's actually about the program itself, so should be included in this section instead.

    Would be great to add all of this. :)

    Cheers

    Edit: what about those random tests? (or at least "randomized"?)

  • Custom User Avatar

    I know this game, and I once wanted to transplant it to CW.
    Say something to your kata:
    The input data is not intuitive, and there is no random test. (though it is difficult to implement, but please work hard ;-))