Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. var Cell = {
  2. act:false,
  3. ind:0,
  4. xmin:0,
  5. xmax:0,
  6. ymin:0,
  7. ymax:0,
  8. xs:[],
  9. ys:[],
  10. }
  11. var C = Cell = [];
  12. funcion MyFun() {
  13. for(var i = 0; i < Count; i++) {
  14. var c = Cell = {};//обнуляю после каждой итерации
  15. for(var j = 0; j < 10; j++) {
  16. c.xs.push(Math.random());
  17. c.ys.push(Math.random());
  18. }
  19. C.push(c);
  20. }
  21. }
  22.  
  23. var C = Cell = [];
  24.  
  25. var c = Cell = {};
  26.  
  27. function Cell () {
  28. this.act = false;
  29. this.ind = 0;
  30. this.xmin = 0;
  31. this.xmax = 0;
  32. this.ymin = 0;
  33. this.ymax = 0;
  34. this.xs = [];
  35. this.ys = [];
  36. }
  37.  
  38. function Cell () {
  39. this.act = false;
  40. this.ind = 0;
  41. this.xmin = 0;
  42. this.xmax = 0;
  43. this.ymin = 0;
  44. this.ymax = 0;
  45. this.xs = [];
  46. this.ys = [];
  47. }
  48.  
  49. var C = MyFun();
  50. funcion MyFun() {
  51. var arr = [];
  52. for(var i = 0; i < Count; i++) {
  53. var c = new Cell();//обнуляю после каждой итерации
  54. for(var j = 0; j < 10; j++) {//заменил название i на j так как первая уже используется в цикле выше
  55. c.xs.push(Math.random());
  56. c.ys.push(Math.random());
  57. }
  58. arr.push(c);
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement