Skip to content

nickcoad/toy-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Toy Robot

Toy Robot is a coding challenge commonly used as part of the interviewing process for software development roles. The challenge is to write an application that fits the following requirements:

  • The toy robot is placed on a 5x5 table top.
  • The toy robot cannot be placed outside these bounds and cannot be moved outside these bounds.
  • The user can issue one of five commands to the robot: PLACE X,Y,F; MOVE; LEFT; RIGHT; REPORT.
  • PLACE must be the first command used, since the other commands require the robot to be on the table already.
  • PLACE X,Y,F will place the robot on the table at the coordinates given, facing in the direction specified (N, S, E or W).
  • LEFT will turn the robot 90º to the left.
  • RIGHT will turn the robot 90º to the right.
  • MOVE will move the robot forward one unit, in whichever direction it is facing.
  • REPORT will cause the robot to output its position and direction.
  • In my example, I've also implemented an EXIT command to quit the application.

Running the application

  1. Install the .NET Core SDK.
  2. Clone the solution to your local machine.
  3. Using a terminal, navigate to the toy-robot directory.
  4. Run the application by typing dotnet run.

Testing the application

  1. Install the .NET Core SDK.
  2. Clone the solution to your local machine.
  3. Using a terminal, navigate to the toy-robot.tests directory.
  4. Run the unit tests by typing dotnet test.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages