Created
July 1, 2016 14:04
-
-
Save joshwcomeau/bb024c12e5b9d1d694de03da6ebafb0b to your computer and use it in GitHub Desktop.
Snail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rotateMatrix = matrix => ( | |
matrix[0].map((column, index) => ( | |
[...matrix].reverse().map(row => row[index]) | |
)) | |
); | |
const flipMatrixCounterClockwise = matrix => ( | |
rotateMatrix(matrix).reverse() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment