Guest User

Untitled

a guest
Jun 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // essa funcao receber n numeros of shapes
  2. // cada shape com posicao e seu centro
  3. // e devolvera um array bidimencional
  4. const dot = [
  5. [1]
  6. ]
  7.  
  8. const square = [
  9. [1, 1 ],
  10. [1, 1],
  11. ]
  12.  
  13. function combine(...pecas){
  14. return [
  15. [
  16. // a combinacao dos shapes de dentro das pecas
  17. ]
  18. ]
  19. }
  20.  
  21. const p1 = {
  22. shape: dot,
  23. center: [0, 0],
  24. position: [0, 0]
  25. }
  26.  
  27. const p2 = {
  28. shape: dot,
  29. center: [0, 0],
  30. position: [0, 1]
  31. }
  32. const p3 = {
  33. shape: dot,
  34. center: [0, 0],
  35. position: [1, 0]
  36. }
  37.  
  38. const p4 = {
  39. shape: dot,
  40. center: [0, 0],
  41. position: [0, 1]
  42. }
  43.  
  44. combine(p1, p2,p3, p4) = square
Add Comment
Please, Sign In to add comment