Skip to main content

A simple project for a toy robot

Project description

PBTOYROBOT: Toy Robot CLI

A CLI to control a toy robot.

Installation

Install using pip:

pip install pbtoyrobot

CLI

  • The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
  • There are no other obstructions on the table surface.
  • The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement commands must still be allowed.
    # Show help
    pbtoyrobot --help

    # PLACE: Places the robot at X, Y with orientation F
    # Possible value for x and y are integers between 0 and 5 included
    # Possible values for F are NORTH, EAST, SOUTH and WEST
    pbtoyrobot PLACE 1,1,NORTH

    # MOVE: Moves the robot of one unit in the current direction
    pbtoyrobot MOVE

    # LEFT: Rotates the robot 90 degrees in the specified direction
    pbtoyrobot LEFT

    # RIGHT: Rotates the robot 90 degrees in the specified direction
    pbtoyrobot RIGHT

    # REPORT: will announce the X,Y and orientation of the robot
    pbtoyrobot REPORT

Usage

Example Input and Output:

PLACE 0,0,NORTH
MOVE
REPORT
Output: 0,1,NORTH
PLACE 0,0,NORTH
LEFT
REPORT
Output: 0,0,WEST
PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT
Output: 3,3,NORTH

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pbtoyrobot-1.0.10.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

pbtoyrobot-1.0.10-py3-none-any.whl (20.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page