/Challenge-Rotate-Matrix

Rotate Matrix Challenge

Primary LanguageJavaScript

Matrix Rotator

Write the rotate method of the MatrixRotator class that accepts one argument, direction. rotate must set the object's matrix property with a new, rotated matrix.

Rotating a matrix clockwise will rotate every element to it's clockwise position.

example matrix rotation: original

a b c
d e f
g h i

rotated clockwise (CW)

g d a
h e b
i f c

rotated clockwise (CW) once more

i h g
f e d
c b a

Advanced

Once your tests pass, you can move on to the advanced branch.

merge advanced into your current master branch. Follow instructions in the README.

Install dependencies

npm i

Run tests

There are 4 tests, make the tests pass.

npm test