回答編集履歴

2

size

2021/09/11 10:03

投稿

TN8001
TN8001

スコア9862

test CHANGED
@@ -96,11 +96,9 @@
96
96
 
97
97
  while (rects.size() < sizes.size()) {
98
98
 
99
- int diameter = sizes.get(rects.size());
99
+ int size = sizes.get(rects.size());
100
100
 
101
-
102
-
103
- PVector c = new PVector(random(20, 492), random(20, 492), diameter);
101
+ PVector c = new PVector(random(20, 492), random(20, 492), size);
104
102
 
105
103
  boolean overlapping = false;
106
104
 

1

rects

2021/09/11 10:03

投稿

TN8001
TN8001

スコア9862

test CHANGED
@@ -92,11 +92,11 @@
92
92
 
93
93
 
94
94
 
95
- ArrayList<PVector> rect = new ArrayList<PVector>();
95
+ ArrayList<PVector> rects = new ArrayList<PVector>();
96
96
 
97
- while (rect.size() < sizes.size()) {
97
+ while (rects.size() < sizes.size()) {
98
98
 
99
- int diameter = sizes.get(rect.size());
99
+ int diameter = sizes.get(rects.size());
100
100
 
101
101
 
102
102
 
@@ -106,7 +106,7 @@
106
106
 
107
107
 
108
108
 
109
- for (PVector p : rect) {
109
+ for (PVector p : rects) {
110
110
 
111
111
  if (dist(c.x, c.y, p.x, p.y) < (c.z + p.z) * 1.41 / 2) {
112
112
 
@@ -122,7 +122,7 @@
122
122
 
123
123
  if (!overlapping) {
124
124
 
125
- rect.add(c);
125
+ rects.add(c);
126
126
 
127
127
  }
128
128
 
@@ -130,7 +130,7 @@
130
130
 
131
131
 
132
132
 
133
- for (PVector p : rect) {
133
+ for (PVector p : rects) {
134
134
 
135
135
  pushMatrix();
136
136