Ad
  • Custom User Avatar

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

  • Default User Avatar

    Nice idea, like it.
    But I have a problem with the test examples. E.g. the first test example. When I follow the rules, car scores 5 points when moving line up, then another 5 moving line up, the car passes object, so add 8, then passes 2 objects, so add 11, next three lines of 5 points (15 points), then a car is passed (the car that originally started at line 7) giving me 7 points, and then I crash to the object at line 3. Counting 5 + 5 + 8 + 11 + 15 + 7 = 51 points. But you expect 52 points. Can you help me what I miss in the rules?

  • Default User Avatar

    It's still failing random tests in php

  • Default User Avatar

    I tried to make description more clear and added random test.
    I'll mark this resolved now. If it's not ok, please let me know :)
    Thanks!

  • Default User Avatar

    Thanks. RR and LL are added now to test both car and obstacle. Soon I'll create random test and improve description.

  • Custom User Avatar

    Just looking at my code. None of the test check if you hit an obstacle or car on the same row. For example if the move is "RR" and it hits something. My code doesnt handle this and passes all the tests

  • Default User Avatar

    I get it now. Ok, thanks for help :)

  • Custom User Avatar

    Easiest way is to create some random roads and moves, then use your code as an answer reference.

  • Default User Avatar

    Many details, it's not easy to explain. If you have any suggestions about description, please let me know.
    I don't know how those random tests are written. But maybe I can check in my solved katas how's that done and make those.

  • Custom User Avatar
    • The description is very confusing :-)
    • There are no random tests

    Great kata though :-)

  • Default User Avatar

    I guess I can mark this resolved

  • Default User Avatar

    Sure, I'll post all that, but just one thing: we know the fact that other cars are moving twice slower and we know the fact that passed means one step behind. I really want to make it clear, but I want people to think through it. I didn't want to tell them "Hey, what if that other car moves in the same step you are passing it, so you stay in the same line? Did you foresee that catch, hm?"

  • Custom User Avatar

    In that case, you should state in the description:

    • The player gets points for every obstacle in the subarray
    • This happens right after leaving the subarray with obstacles (as shown in Option 1)
    • Passing a car means moving 1 step away from it; if both the player and an NPC move to the same subarray at the same time (as shown in your step 3), there will be no bonus

    After that the issue can be closed.

  • Default User Avatar
    • It is "successfully making a step through a subarray which includes obstacles. Doesn't matter where obstacle is positioned.
    • Same. Check the illustration.
    • Option 1 - you get +11: 5 for step, 3+3 for two obstacles passed (they are one step behind now)
    • Option 2 - +5 only for new step reached. No additional points for passed obstacles
    Cars are moving twice slower, let me "draw" that:
    
    [:, :, :]
    [:, :, :]
    [:, :, :]
    [C, :, :]
    [:, :, X]
    
    [:, :, :]
    [:, :, :]
    [:, :, :]
    [C, :, X]
    [:, :, :]
    
    [:, :, :]
    [:, :, :]
    [C, :, X]
    [:, :, :]
    [:, :, :]
    
    [:, :, :]
    [:, :, X]
    [C, :, :]
    [:, :, :]
    [:, :, :]
    
    So you can "pass" them.
    
    
  • Custom User Avatar

    It makes more sense now, but still not clear:

    • What does "passing an obstacle" mean in the first place - is it "successfully making a step through a subarray which includes obstacles", or something different? If my assumption is correct, does the player get additional points no matter where the obstacles are situated in the subarray? For example, the obstacle is on the left lane, and the player makes a step on the right lane (middle lane is safe) - would that also count as "passing"?
    • How exactly does this rule work with cars which are not fixed in place?
    • Which of the options below results in acquiring bonus points? Or is it none of my interpretations? (X stands for the player's position)
    Option 1 (bonus points right after obstacles):
    
    [:, :, X]
    [O, O, :]
    
    -------------------------------------------------------------------------------
    
    Option 2 (bonus points after the player makes 1 more step away from obstacles):
    
    [:, :, X]
    [:, :, :]
    [O, O, :]
    
  • Loading more items...