Created
June 19, 2018 15:08
-
-
Save LucasBadico/a28253af04884c2d9065f270eed34cb9 to your computer and use it in GitHub Desktop.
Combine of composer
This file contains 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
// essa funcao receber n numeros of shapes | |
// cada shape com posicao e seu centro | |
// e devolvera um array bidimencional | |
const dot = [ | |
[1] | |
] | |
const square = [ | |
[1, 1 ], | |
[1, 1], | |
] | |
function combine(...pecas){ | |
return [ | |
[ | |
// a combinacao dos shapes de dentro das pecas | |
] | |
] | |
} | |
const p1 = { | |
shape: dot, | |
center: [0, 0], | |
position: [0, 0] | |
} | |
const p2 = { | |
shape: dot, | |
center: [0, 0], | |
position: [0, 1] | |
} | |
const p3 = { | |
shape: dot, | |
center: [0, 0], | |
position: [1, 0] | |
} | |
const p4 = { | |
shape: dot, | |
center: [0, 0], | |
position: [0, 1] | |
} | |
combine(p1, p2,p3, p4) = square |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment