I am proposing a new exercise that “builds” on top of the idea of a robot simulator but makes it more advanced by adding multiple principles like 3D instead of 2D. Here is a proposal of introduction + instructions (It needs to be refined but this is a draft meant as a proposal):
Introduction.md
A company called Walker3DPrinters has approached you and requested that you build a program for them, that controls the motors and the extruder of a 3D printer.
An extruder is a piece that outputs the material.
The company would like the software to work on all of their different machines which involves different print areas.
The printer should have several safety features like hit detection, which detects if it hits an already printed area or prints in mid-air.
Instructions.md
Your task is to build a program that controls the 3d printer.
The program is meant to receive instructions that tell the printer how to print.
It shall return a 3D representation of the result of the instructions, in the format there each axis is formated such as [x[y[z]]]
, and where 1 represents that a grid has been printed and 0 that it hasn’t.
The instructions involve:
- How big is the printing area on all axis (x,y,z)).
- The coordinates of the extruder (x,y,z).
- Controlling movements of the axis (x,y,z).
- Move up
- Move down
- Move forward
- Move backward
- Move to the right
- Move to the left
- Controlling if the extruder should print.
(A picture to get some sense, not meant for final use)
The printer should stop printing if any of the following is true:
- The printer hits an already printed area.
- The printer prints in mid-air.
- The printer prints more than 1 grid at a 90* angle without any support.
(A picture to get some sense, not meant for final use)
The program is given the size of the grid by giving the size in 3 axes (x, y, z), like: (100, 50, 20).
The extruder is set on the 3D grid at a set of coordinates (x, y, z), like: (10, 4, 5).
The printer is fed with the printing instructions and then starts to follow them.
- The instructions: “SFRULBERDSE” means:
- Start printing
- Move forward
- Move to the right
- Move up
- Move to the left
- Move backward
- End printing
- Move backward yet again
- Move down
- Start printing yet again
- End printing yet again
- If the grid was of size (2, 2, 2) and it started at (0,0,0) the result of the 3d representation would be the following:
[[[1, 1], [1, 0]], [[1, 1], [1, 1]]]