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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for pbtoyrobot-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 705c09096e3ced6b7d22bcafc6493e6b9ae6cb165e41075b4d816e3ad6da1dfb |
|
MD5 | de68e787f6a34867def8f23082c2a5e5 |
|
BLAKE2b-256 | 183804e061cef068bbef64834b2dba85274f4abc0c19642ebbab11b8c2c65c78 |