Skip to content

triptease/blocky-test

Repository files navigation

Blocky Puzzle

To get started

You will need a recent version of Node. If you do not have it installed already, we find nvm to be a handy script to install and even juggle between versions of Node without too much hassle.

On most projects, we have transitioned into using Yarn, Facebook's package manager in favour of npm. Either one will do to install and run this project, as well as run its tests.

yarn
# or `npm install`
yarn start
# or `npm start`

http://localhost:9100/ will open automatically on the blocky app, live-reloading as you develop.

Use yarn test to run the unit tests on the terminal. yarn test --watch will only run test files relevant to changes since your last commit, and rerun them every time you save.

Task

Clicking on a block should remove (or hide) itself and all blocks of the same colour that are connected to the target element, then allow the blocks above the removed to "fall down". The "gravity" is similar to Tetris, but every block is its own 1x1 entity. Unlike Tetris, it's clicking on a block that triggers the removal and fall of blocks.

For example, given:

Initial state

After clicking one of the bottom right blue boxes, it should look like this:

state 2