Law of cosines - triples: Difference between revisions

m
(→‎{{header|Perl 6}}: Even less elegant, but reasonable run-time)
Line 565:
===Dictionaries===
A variant Python draft based on dictionaries (and returning a count of 18394 for the 'extra credit' calculation).
<lang python>def f90(dct):
def f90(dct):
return lambda x2, ab, a, b: dct.get(x2, None)
 
Line 608 ⟶ 607:
unlines(
zipWith(
lambda nf: lambda fn: (
lambda ks=triangles(f, 13): (
str(len(ks)) + ' solutions for ' +
Line 615 ⟶ 614:
)
)()
)([120f120, 90f90, 60f60])
([f120120, f9090, f6060])
) + '\n\n' +
'60 degrees - uneven triangles of maximum side 10000. Total:\n' +
9,659

edits