Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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
Add Comment
Please, Sign In to add comment