回答編集履歴
1
return文いらなかったから削除したけど、なんか、かえって読みにくいかな……
test
CHANGED
@@ -128,23 +128,19 @@
|
|
128
128
|
|
129
129
|
function test(centerX, centerY, rectSize, fieldSize){
|
130
130
|
|
131
|
-
return [...Array(fieldSize)].map( (_, y) =>
|
131
|
+
return [...Array(fieldSize)].map( (_, y) =>
|
132
132
|
|
133
|
-
|
133
|
+
[...Array(fieldSize)].map( (_, x) =>
|
134
134
|
|
135
|
-
ret
|
135
|
+
( y == (centerY - rectSize) || y == (centerY + rectSize) ) && (centerX - rectSize) <= x && x <= (centerX + rectSize)
|
136
136
|
|
137
|
-
|
137
|
+
||
|
138
138
|
|
139
|
-
||
|
139
|
+
( x == (centerX - rectSize) || x == (centerX + rectSize) ) && (centerY - rectSize) <= y && y <= (centerY + rectSize)
|
140
140
|
|
141
|
-
|
141
|
+
)
|
142
142
|
|
143
|
-
|
143
|
+
);
|
144
|
-
|
145
|
-
});
|
146
|
-
|
147
|
-
});
|
148
144
|
|
149
145
|
}
|
150
146
|
|