Git Product home page Git Product logo

a_coding_test_wot_i_did's Introduction

Mars Rover Coding challenge

Notes

I hadn't originally intended to do this in rust however I decided to try it as a scoping exercise and I realised that I had enough knowledge and ability to do it in rust. It was an interesting project and as usual for me with rust I learned from what I built and shored up other knowledge I already had. I admit to finding most coding tests a bit boring but I found working on this quite interesting, it helps that I like Space and Mars Rover related stuff; I don't even normally do write-ups but I felt in this case I had to.

The bit I enjoyed working on the most was the rover_commands module, whilst it isn't building a parsing grammar it felt a bit like it and was just interesting overall to work on. It was also quite vindicating as it proved my idea worked.

I'm also quite proud with how the execution of the commands works as it ended up with a clean looking chunk of code in fn main().

Usage

The executable can be used in two ways:

  • Load file: cargo run rover.commands - with rover.commands being a text file containing the commands to be executed
  • Manual Mode: cargo run - this allows you to manually enter commands pressing enter between commands, to finish you you have to CTRL-C followed by enter, this is a bug I'm not sure how to resolve

The first command run regardless of usage method needs to be the grid size command x y, replacing x y with the max bounds of the grid.

The provided test case is in the rover.commands file.

Issues

Entering Malformed instructions will crash the app

a_coding_test_wot_i_did's People

Contributors

thermatix avatar

Watchers

 avatar  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.