Processing java path finder

I tried double loop with i and j inside it but didn’t come out right