5 kyu

Robby, the robot

483 of 487BattleRattle
Description
Loading description...
Matrix
Algorithms
Graph Theory
View
AllIssues6Questions2Suggestions3Show Resolved
  • Please sign in or sign up to leave a comment.
  • bornForThis Avatar

    This task is very complex. I have seen that the original rank of it was 2 kyu. Looks like it requires BFS or something like that. Just really cannot grasp why admins made it as 5 kyu. Even according to modern standards, it should be blue kata.

  • FArekkusu Avatar

    The tests fail with the "This is not the optimal solution" error message if the commands-list is wrong (i.e. walking through obstacles, or not reaching the destination).

  • AyushBk Avatar

    I had to research on the robot character itself even attempting this kata!

  • FVM04 Avatar

    This comment has been hidden.

  • metalim Avatar

    This kata definetely needs random tests. Coverage of existing tests is really bad.

  • metalim Avatar

    Coffeescript translation + Random tests for boards 2x2-20x20.

  • carmenp Avatar

    C++ translation of this awsome kata kumited!

    https://www.codewars.com/kumite/5ab10e035084d73892000128?sel=5ab10e035084d73892000128

    Would someone, please review it and eventually approve it? Thanks!

  • metalim Avatar

    When submitting, console.log makes process terminate with this wonderful error.

  • OniKudaki Avatar

    This comment has been hidden.

  • Stelyus Avatar

    Excellent kata !

  • kontic Avatar

    A lot of work, and then when it comes debugging (most interesting part) you found out that there is no random tests. I have no desire for further optimization. Besides that, great kata :), thanks.

  • claimred Avatar

    Fun kata!

  • jdog Avatar

    I'm appalled that I had to cheat for one of the cases, where my robot went as far as possible towards the target, but that was too far, so there was a little step in the solution it generated :(

    Maybe I'll fix it if I get some time later.

  • Blackmetalmcdonalds Avatar

    Woot ... awesome kata. it did my head in! Thanks!

  • guatedude2 Avatar

    It would be nice to have a little more feedback on what is wrong with the code rather than just displaying "This is not the optimal solution". Maybe something like "This is not the optimal solution. Try using less power to reach the target".

  • YNestA Avatar

    Request Timeout,again and again. I want to know if the request timeout is due to my code...

  • dcsmith Avatar

    Whew! That was fun. Could definitely make my code a lot less repetetive, but getting the basic functionality down is a great feeling itself!

    Took me a while to realize I was getting a "This is not the optimal solution" failure because my code was referencing Commands.LET instead of Commands.LEFT in one function, resulting in an undefined being pushed onto the returned list of commands :P

  • mattslocum Avatar

    "This is not the optimal solution"

    I think that my solution is correct. Is it possible that the solution that is failing is due to 2 valid solutions? I don't know how to debug this any further. When I submit, the 12th test fails with "not optimal". I at first thought this was an error of O(n) problem, so I re-wrote the whole thing with higher efficiency, and I'm getting the same error. I'm now thinking that there might be more than one correct answer to a maze and I'm getting penalized for that.

  • jmtt89 Avatar

    This comment has been hidden.

  • allain Avatar

    "This is not the optimal solution"

    Better to accept the answer and then show them the glory of an optimized solution, or change the message to reflect how an optimal solution behaves. (Your solution uses O(n^2) memory, or something)

    Without more feedback my choices are to walk away from a working but non-optimal solution, or give up to have a look at the solutions to better understand what's being optimized for.

    This is the first question with this kind of test validation I've encountered on this site.

  • dgrcode Avatar

    I have really enjoyed doing this kata! :)

    Thanks!

  • provector Avatar

    .................... .................... .................... ....###########..... ....#.........#..... ....#.#######.#..... ....#.#.......#..... ....#.#.#######..... ....#.#.#S.#........ ....#.#.##.#........ ....#.#....#........ ....#.######........ ....#............... ....###############. .................... .................... .................... .................... .................... ...................T

    Im 99.99% sure my solution is good, please check for yourself, yet test says different:

    rfrffrffflllffrfffffflffrrrfffffflfffffffflffffffffffffffrfffffff

  • ArcaneIntegers Avatar

    Very nice kata, but I feel like the last test case was unnecssarily evil...

  • Nebril Avatar

    This was a nice one. Thanks!

  • Hacker Sakana Avatar

    Anyone using Priority Queue to solve this kata? I think it is needed for a weighted BFS, but don't know whether there is a module that capsuled such data structure.

  • constablebrew Avatar

    This kata deserves more attention.

  • kesheshyan Avatar

    Excelent kata! But, to be honest, my solution is a little bit incorrect, because it doesn't consider the direction of Robby. But somehow all test cases have been passed except one in the 'example tests' section. I suggest you add all test cases from the example section to the final section. It would probably make my solution incorrect, but you should know about that issue :)

  • nivoliev Avatar

    This comment has been hidden.

  • nivoliev Avatar

    To avoid solutions based on reverse engineering the test cases, you could add some random testing with random fields. Here is a proposal to generate simple random fields :

    var field_arr = ['S'] ;
    for(var i = 0; i < 398; ++i) {
     field_arr.push((10*Math.random()|0)%6 === 0 ? '#' : '.') ;
    }
    field_arr.push('T')
    var field = field_arr.join('') ;
    

    you can adjust the wall density using the modulo. You could generate a list of pre-solved random fields for which a single solution is possible, and randomly pick some from the list. If I'm not mistaken, my solution generates all possible paths in case you need it. Otherwise, nice kata !

  • jacobb Avatar

    Running through the kata I've completed. Decided to rank and mark this one ready.

  • constablebrew Avatar

    I am having problems with my solution timing out. How optimized do you expect solutions to be? I think it would be helpful to give some indication of the maximum size field that Robby will be playing on.

  • jhoffner Avatar

    I'm a bit confused as to why the target in the first example is "behind" the start point. Forward is really backward in this case isn't it?