This tech test was a lot of fun. I did time box it to the two hours, but thankfully I noticed on the brief I could extend it to 3 :)
mix compile
mix run start.exs
This will put you into the program such that you can input your data as is mentioned on the brief, i.e.
4 8
(2, 3, E) LFRFF
(0, 2, N) FFLFRFF
Enter grid size (m x n):
4 8
Add as many robots as you like on a new line after hitting return: "(x, y, orientation) commands)"
(2, 3, E) LFRFF
(0, 2, N) FFLRFF
(2, 3, N) FLLFR
(1, 0, S) FFRLF
Hit return as a blank entry after the last robot to see results:
(4, 4, E)
(0, 4, N) LOST
(2, 3, W)
(1, 0, S) LOST
-
I would like to have made the inputs safer to ensure more reliable data to use. For example, entering "crash" would lead to a crash.
-
A docker image would also have been a nice to have. Because it's such a simple program that relies on the terminal only, being installation agnostic would have been a nice touch for the user experience.