Code Monkey home page Code Monkey logo

auto-mowers's Introduction

auto-mower-net-core

Basic implementation of auto-mower test in order to discuss technical matters.

  1. Analysis
  2. Specifications
  3. Todo

Users Manual

To build and run the app :

cd ./Code
dotnet publish ./auto-mowers
dotnet run --project ./auto-mowers --filepath ../Examples/Valid_Example_0.txt

to run unit tests :

cd ./Code
dotnet test ./auto-mowers-unit-test

Inputs

filepath

A file path must be specifed with the arg --filepath

if it doesnt the console will display suggestion :

>> dotnet run --project auto-mowers --wrongArg ./somepath
auto-mowers 1.0.0
Copyright (C) 2022 auto-mowers

ERROR(S):
  Option 'wrongArg' is unknown.
  Required option 'filepath' is missing.

  --filepath    Required.

  --help        Display this help screen.

  --version     Display version information.

Error During Execution: Invalid Program Args Parsing. 2 errors in Command Line, arguments are not valid

meantime the result of the program will be an arror string

fileformat

  • Lawn is Seen as a grid, bottom left angle (0,0), top right corner (Xmax,Ymax)
    • first line contains (Xmax,Ymax)
    • Xmax, Ymax are integers
    • Xmax, Ymax are separated by a single withespace.
  • Automower is seen occupying a place of the grid. (Xa, Ya). It as an Orientation Oa.
    • Orientation is given by North: N , South: S , Est: E , West: W. N is Top of the Grid, S the Bottom etc ...
    • SecondLine of the file contains Automower initial position and orientations (Xa, Ya, Oa)
    • It must be in the Lawn.
    • Xa, Ya ar integers, and Oa is a char N,E,W,S
    • Xa, Ya, Oa are separated by whitespaces.
  • Automower can do 3 actions: rotate left : L, rotate Right : R and move front : F
    • Third line id contains Automower instructions
    • It is a string without whitespaces containing instructions L,R,F
Xmax Ymax
Xa Ya Oa
LFLFLFLFF
  • Several Automowers and instructions can be put in a single file
    • To define an other automower a line (X, Y, O) at the end of the file and then a line containing an instructions
    • The program will run all instructions for the first automower defined, then output its final coordinates, then do it again for the next automowers
Xmax Ymax
Xa Ya Oa
LFLFLFLFF
Xb Yb Ob
LFLFLFLFF

Here is a valid example :

5 5
1 2 N
LFLFLFLFF
3 3 E
FFRFFRFRRF

Ouputs

In Error Case:

if the file is not formated correctly or the informations in are not valid the program will furnish and output like this :

Error During Execution: Invalid InputFile Parsing. The Definition of mowers and instructions are incorrect

Normal Return :

Otherwise The Program will furnish a valid output containing the final coordinates and Orientations of each mowers, in the order it's provided.
As soon as a mower execution terminated it is outputed.

1 3 N
5 1 E

some Valid and unvalid examples are available in :

\Examples\

auto-mowers's People

Contributors

benvonwyl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.