Ad
  • Custom User Avatar

    Updated description

  • Custom User Avatar

    The description is inconsistent with regards to the valid room coordinates vs dimensions. Based on the given ASCII image of a (5,5)-sized room, the robot has 5 x 5 = 25 valid room coordinates, suggesting that "width" and "height" refer to the number of valid discrete positions. However, the reference solution, which sets walls at -1 and 6, allows room coordinates 0 <= x <= 5 and 0 <= y <= 5, implying 6 x 6 = 36 valid coordinates, or a (6,6)-sized room. Adding to the inconsistency, the valid starting positions are differently constrained at 1 <= x <= 5 and 1 <= y <= 5.

    I can see two solutions to this:

    1. Continue to constrain valid room coordinates at 0 <= x <= width and 0 <= y <= height as now, but constrain the starting positions similarly, and fix the ASCII image. The benefit of this approach is that existing solutions won't be invalidated. "Width" and "height" would refer to physical dimensions on a continuous coordinate plane instead of the number of possible discrete positions.

    2. Set the bottom-left wall at 0, which would constrain valid room coordinates at 1 <= x <= width and 1 <= y <= height. This would of course invalidate all existing solutions. "Width" and "height" would refer to the number of possible discrete positions intead of physical dimensions on a continuous coordinate plane.

  • Custom User Avatar

    Fixed test cases to sync with description. Plus made walls positions clearer.

  • Custom User Avatar

    Sample battery removed tests doesn't sync with description. The tests wants you to return "robot is stuck at {x}x{y}. Battery removed!" instead of (x, y) tuple.

    Also, please specify where the walls position at (as mentioned by Voile).

  • Custom User Avatar

    Updated description to better clarify the walls axis. Marking as solved

  • Custom User Avatar

    Made the description clearer on what direction represents which axis direction, marking as solved.

  • Custom User Avatar

    Added random tests, marking as solved.

  • Custom User Avatar

    Output and coords only use tuple now. Marking as solved

  • Custom User Avatar

    There's no clear indication as to which of width and length corresponds to x axis and y axis. (For example, we can make [2, 3] into two x-axis length 2 walls with two y-axis length 3 walls or two x-axis length 3 walls with two y-axis length 2 walls).

  • Custom User Avatar

    Returning different types (string/list) is bad practice

    In python coords should be tuples, not lists

  • Custom User Avatar

    Needs random tests.

  • Custom User Avatar

    It's unspecified which of up/down/left/right corresponds to which of the -x/+x/-y/+y direction.

    It's not even specified what the coordinates of the walls are at. Why are the walls at x = 1 and y = 1 instead of x = 0 and y = 0? This would make a room of width w and height h of dimension w - 1 and h - 1, which is mathematically inconsistent.

  • Custom User Avatar
  • Custom User Avatar

    (built from seraph's original change to any type)

  • Custom User Avatar

    Well, declaring as a string forces any input to be formatted as a string, from what I can tell, so I just put an int as the test to make sure that the code runs for all possible inputs, including potential miscommunication with the script for "None" or "Null" jokes.

  • Loading more items...