Mindful Chef Code Challenge
This repository contains the solution to the
Mindful Chef Code Challenge completed by
Kyle Welsby. The challenge involved building a
warehouse robot controller.
โก๏ธ System Dependencies
Before using the warehouse robot controller, make sure you have the following
dependencies installed on your system:
- Deno: The runtime environment required to build and run
the tool. - (alternative) Ruby: The alternative runtime
environment to run the tool.
At the time of writing the latest stable version of Deno is 1.34.1, or Ruby
3.3.0
๐ Getting Started
Follow the steps below to get started with the warehouse robot controller:
-
Clone this repository to your local machine:
git clone https://github.com/kylewelsby/mindful-chef-code-challenge.git
-
Install Deno by visiting the
Deno installation guide
and following the instructions provided. -
Open your terminal or command prompt and navigate to the project directory:
cd mindful-chef-challenge -
Run the following command to execute the robot controller, replacing
with the desired sequence of commands:This command uses Deno
deno run mod.ts <commands>
This command uses Ruby
bundle exec ruby robot_cli.rb <commands>
N.B. you may need to run
bundle installas Bunlder
is managing dependencies for Ruby before running the Ruby commandOption Description Default <commands>Nvigate the robot using compas directions
-N= North
-S= South
-E= East
-W= West--start=<n>,<n>(optional): Sepecify the starting position of the robot 0,0 For example, to navigate the robot to grid position [4,4], use the following
command:<commands>.deno run mod.ts 'N,E,N,E,N,E,N,E'bundle exec ruby robot_cli.rb 'N,E,N,E,N,E,N,E' --start=4,4
-
The result will be the final position of the robot within the warehouse grid.
๐งช Testing
To ensure the correctness of the tool, unit tests are provided. Follow the
instructions below to run the tests:
deno test -Abundle exec rake test๐จ Linting
The warehouse robot controller adheres to coding standards and best practices.
To run the linter and formatter on the codebase, execute the following commands:
-
Format the code using Deno's built-in formatter:
deno fmt
-
Run the Deno linter to check for potential issues and enforce coding
standards:deno lint
-
Run the Ruby typechecker to check for potential issues and enforce coding
standards:bundle exec srb tc
The linter checks your code for potential issues, enforces best practices, and
alerts you to any deviations from the recommended coding standards.