


It would mount and check to see whether its dirty or whether This way it wouldīe easier to pass certain properties to it. To me the easiest way was to make every single tile a component which knows its own ID. It came apparent to me that there are different ways to bring this Roomba application to life, but By doing this I couldĭetermine what components I would need and where I would keep state. Instructions set for what would minimally achieve what was being looked for. The first thing I did was draw out what I thought the application would look like. Visit 'localhost:3000' in your browser to see the app.The goal of the application is to take the room dimensions, the locations of the dirt patches, and the hoover location as input and to allow the user to navigate the robot around the room.Īs a minimum you should build an interface with: The hoover is always on - there is no need to enable it.ĭriving into a wall has no effect (the robot skids in place). Placing the hoover on a patch of dirt ("hoovering") removes the patch of dirt so that patch is then clean for the remainder of the program run. The room will be rectangular, has no obstacles (except the room walls), no doors and all locations in the room will be clean (hoovering has no effect) except for the locations of the patches of dirt presented in the program input. Locations of patches of dirt, also defined by X and Y coordinates identifying the bottom left corner of those grid positions.

The bottom left corner is the point of origin for our coordinate system, so as the room contains all coordinates its bottom left corner is defined by X: 0 and Y: 0.Īn initial hoover position (X and Y coordinates like patches of dirt)

This room is divided up in a grid based on these dimensions a room that has dimensions X: 5 and Y: 5 has 5 columns and 5 rows, so 25 possible hoover positions.
