# Commits

committed 65d36e5

Working now.

• Participants
• Parent commits 4a94fb5
• Branches default

# File project-euler/86/euler-86-analysis.txt

• Ignore whitespace
`+If C >= B >= A, prove that A^2 + (B+C)^2 > B^2 + (C+A)^2 and that`
`+A^2 + (C+B)^2 > C^2 + (B+A)^2 .`
`+`
`+C^2 + (B+A)^2 = C^2 + B^2 + A^2 + 2BA, so the maximum is when BA is maximal,`
`+so we need to pick up B and C. Likewise, the minimum is when we take C in `
`+separate from A and B.`
`+`

# File project-euler/86/euler-86.pl

• Ignore whitespace
`     {`
`         for my \$L (1 .. \$N)`
`         {`
`-            my @arr = (\$M,\$N,\$L);`
`-            my \$get_dist = sub {`
`-                my \$idx = shift;`
`-                my \$x = \$arr[\$idx];`
`-                my \$t = \$arr[(\$idx+1)%3] + \$arr[(\$idx+2)%3];`
`-                return (\$x*\$x+\$t*\$t);`
`-            };`
`-            my \$dist_sq = min(map { \$get_dist->(\$_) } (0 .. \$#arr));`
`+            # my @arr = (\$M,\$N,\$L);`
`+            # my \$get_dist = sub {`
`+            #     my \$idx = shift;`
`+            #     my \$x = \$arr[\$idx];`
`+            #     my \$t = \$arr[(\$idx+1)%3] + \$arr[(\$idx+2)%3];`
`+            #     return (\$x*\$x+\$t*\$t);`
`+            # };`
`+            # print join(',',map { \$get_dist->(\$_) } (0 .. \$#arr)), "\n";`
`+            # my \$dist_sq = min(map { \$get_dist->(\$_) } (0 .. \$#arr));`
`+            my \$dist_sq = \$M * \$M + (\$N+\$L) ** 2;`
`             my \$dist = sqrt(\$dist_sq);`
`             if (int(\$dist) == \$dist)`
`             {`