Skip to content

User Story #1 -- Robot Positioning #10

Description

@medinafdzz

The robot has a status, namely a string (without white spaces) formatted as follows: (x,y,h). The pair (x,y) represents the position of the robot in the room (in terms of x and y coordinates) while h is the heading – i.e., the direction the robot is pointing to. The heading can be: N (North), S (South), E (East), or W (West). The robot assumes the North is parallel to the y-axis. The robot starts its duty from the origin position—i.e., the position with coordinates (0,0), facing North (see the figure below).

image

Requirement:

  • Implement CleaningRobot.initialize_robot(self) -> None to set the status of the robot to (0,0,N). To do so, use the instance variables CleaningRobot.pos_x, CleaningRobot.pos_y, and CleaningRobot.heading.
  • Implement CleaningRobot.robot_status(self) -> str to return the current status of the robot – i.e., a string in the format (x,y,h).

Example:

  • The robot status (0,0,N) indicates that the robot lies in the cell with x and y coordinates both equal to 0. The heading of the robot is N – i.e., it is pointing to North.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions