npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

toyrobotsimulator

v1.0.1

Published

A Cli application simulates toy robot moving on a square tabletop

Downloads

2

Readme

ToyRobotSimulator

A Cli application simulates toy robot moving on a square tabletop.

ENVIRONMENTS

This application was developed on macOS Sierra 10.12.6

SYSTEM DEPENDENCIES & CONFIGURATION

This application requires node >= 8.4.0 and npm >= 5.3.0 To check your version run:

node -v

To make sure correct node version has been install, Node version management tool n is recommand.

To install n:

$ npm install -g n

On macOS, you may want to use:

$ sudo npm install -g n

to install n to the path requires root permission.

To get latest stable node:

$ n stable

On macOS, you may want to use:

$ sudo n stable

APPLICATION INSTALLATION INSTRUCTIONS

To install the application, clone the repository, cd to the repository directory and invoke npm install.

git clone https://github.com/t83714/ToyRobotSimulator.git
cd ToyRobotSimulator
npm install

USAGE INSTRUCTIONS

To run the application in interactive mode, cd to the repository directory and invoke ./bin/trs.js.

cd ToyRobotSimulator
./bin/trs.js

Under interactive mode, enter help will show help information:

RobotSimulation~$ help

  Commands:

    help [command...]   Provides help for a given command.
    exit                Exits application.
    PLACE <x,y,facing>  Place robot on x,y position of tabletop with <facing>
    MOVE                Move robot one step further
    LEFT                Make robot turn left
    RIGHT               Make robot turn RIGHT
    REPORT              Ask robot to report current position

RobotSimulation~$

example:

RobotSimulation~$ PLACE 1,2,EAST
RobotSimulation~$ MOVE
RobotSimulation~$ MOVE
RobotSimulation~$ LEFT
RobotSimulation~$ MOVE
RobotSimulation~$ REPORT
Output:3,3,NORTH
RobotSimulation~$

TESTING INSTRUCTIONS

To run test cases, cd to the repository directory and invoke npm test:

cd ToyRobotSimulator
npm test

OVERVIEW

The application is a simula8on of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units. There are no other obstructons 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.

This application can read in commands of the following form: PLACE X,Y,F MOVE LEFT RIGHT REPORT

PLACE will put the toy robot on the table in position X,Y and facing NORTH,SOUTH, EAST or WEST. The origin (0,0) can be considered to be the SOUTH WEST most corner.

The first valid command to the robot is a PLACE command, after that, any sequence of commands may be issued, in any order, including another PLACE command. The application should discard all commands in the sequence until a valid PLACE command has been executed.

MOVE will move the toy robot one unit forward in the direction it is currently facing.

LEFT and RIGHT will rotate the robot 90 degrees in the specified direction without changing the position of the robot.

REPORT will announce the X,Y and F of the robot.

LICENSE

MIT