Ad
  • Custom User Avatar

    It took too much time to understand, and when I did, it was easy to pass.

  • Custom User Avatar
  • 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

    Validated! I'll try to suggest a few randomized tests later.

  • Custom User Avatar

    Haha, don't worry, I understood what's needed, I'll do that soon. :) Anyways, since my translation has been openeded for quite some time, I doubt the Kata owner is still active / willing to maintain this kata.

    Thanks for the pointers, though!

  • Default User Avatar

    Hi,

    If you fork your (now rejected) translation, you can update the description using the current version (that you'll get doing as if you would create a new translation in another window... That step is a bit boring...) and adding to it the modifications needed for elixir.
    Hoping I'm clear enough (but I fear that... X-) )

  • Custom User Avatar

    Hi there,

    Not really active anymore but definitely willing to fix this if this can help, what would be needed to be changed?

  • Default User Avatar

    rejected, since korrigan sn't ctive anymore and his translation has now description conflict. This way, other warriors will be able to publish other elixir transalations.

  • Custom User Avatar

    Very well done kata! I love Robozzle because it can teach non-programmers a little bit about programming without having to actually use code.

    An idea for a (much) harder kata: Given a board and starting location, generate the program that will solve it! :D Not sure if it's even possible. But I suppose it's just meta-programming. Would be tricky, for sure.

  • Custom User Avatar

    Very nice job!
    As noted above it lacks of random testcases, but they're a pain in the ass to build for such problems so I cna understand that it takes a little time ^^

    I played robozzle before and I remember creating a little python version of it on my free time... You reminded me some great time there! :D ♥

  • Custom User Avatar

    I changed the requirements to remove the stack from the expected return value so I'm flagging your suggestion as solved.
    Please let me know if you think of any other enhancements. :)

  • Default User Avatar

    Yes! It's a good kata. Like myjinxin said, could use random tests, but those do seem difficult to generate. The description is particularly detailed, which isn't often the case :P

    I haven't played the game and it's blocked by my "No-games-content" work internet :/ so I need to check it out

  • Custom User Avatar

    Hi,

    For the input data, I first thought of a multiline string encoding the map and the robot position altogether, which obviously will be more readable but will require warriors to transform the input to adequate data structures (or worse, some might want to try to deal directly with the map instead of using well-suited data structures). I felt this would be unecessary boilerplate code in solutions so I'm not satisfied with the idea either.
    Maybe a good alternative would be to provide a helper function to print the map and the robot in a more human-readable format (and include an example test case that demonstrate the feature). What do you think?

    For the random tests, what would be the goal of them? Avoid cheating? (I ask because I've already seen suggestions for random test on other Kata and I'm not sure of the point)
    Anyways, it is indeed possible to implement some with one of the following way:

    • Encoding a lot of puzzles and their solutions and randomly pick some of them
    • Writing a puzzle generator (which also generates a working program), maybe using some common base patterns tied together randomly, and call it a few times within the test suite.

    Both of the solutions will require quite some work but I promise I'll take some time to think about that. I prefer the generator since it would then be possible to provide the generator functions to warriors, which will provide value in the sense it can help understanding the game.

    Thanks for the feedbacks, I hope you enjoyed the Kata :)

  • Custom User Avatar

    Hi,

    Thanks for the feedback, it's my very first authored Kats and I definitely appreciate the valuable feedback.

    I think I will remove the stack requirement then since it actually seems to be painful to get it right and provide no value to the tests (in fact my original Ruby solution had the very same issue with my tests so I reversed the stack before returning too since the order imposed by the tests seemed more logical to me), it will also have the nice side effect to remove boilerplate from the tests and make it more readable.

    I hope you enjoyed the Kata despite this weird behaviour

  • Default User Avatar

    Seems like returning the state of the stack is iffy, because some people may implement it differently. Your tests are expecting the stack to be returned in the reverse order that my solution has it in, yet my solution still passes every other test.

    In other words, I am ostensibly executing actions (popping them off the stack) in the correct order, yet my stack is reversed from your stack. There's only one test where the final state of the stack has more than one action on it (the painting test) as well (so that's the only one I failed). So I simply reverse my stack when I return it, and I pass all tests, which is kind of weird.

  • Loading more items...