0

2 つの正方形が互いに交差しているかどうかを確認したいと思います。私の考えはこれです

for (i = 0; i < 4; i++)
   for (j = 0; j < 4; j++) {
       bool x = check line(i) of first square intersect with 
       line (j) of the second square
       if (x) return;
   }

このコードを最適化するアイデアはありますか?

4

1 に答える 1