Skip to content

ZaymonFC/ToyRobot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToyRobot

.NET Core Build Made with F# License - MIT


A small repository for playing with:

  • Domain Driven Development.
  • Software Testing.
  • Parser Combinators.

Build and Run

OSX: ./start.sh

Windows: dotnet run --project src/ToyRobot/ToyRobot.fsproj

Running Tests

OSX (Watch for changes): ./test.sh

Windows: dotnet test or for expecto output: dotnet watch --project ./src/Test/Test.fsproj run

Command Reference

All commands are case-insensitive.

  • PLACE X,Y,DIRECTION
  • MOVE
  • LEFT
  • RIGHT
  • REPORT
  • QUIT

Command Parsing is implemented with FParsec.

This allows for reporting of more advanced parse errors and suggestions:

> Place 1,
"Error in Ln: 1 Col: 10
Place 1,
         ^
Note: The error occurred at the end of the input stream.
Expecting: integer number (32-bit, signed)
"

Invariants

  1. The robot cannot be placed outside of the specified bounds (defaults to 5x5).
  2. The robot will stop reacting to input once it has reached the edge of the table.

Releases

No releases published

Packages

No packages published