Made a nested for loop

Altered the loops in the pythagorasCollisionDetection() to ensure they
were nested “for” loops, as required by the asst.