Heronian triangles: Difference between revisions

m
→‎{{header|Perl 6}}: Declare a variable, add a batch size constraint to spread the load more effectively
m (→‎{{header|Perl 6}}: use atomicint to make concurrency safe)
m (→‎{{header|Perl 6}}: Declare a variable, add a batch size constraint to spread the load more effectively)
Line 3,286:
my @hh[1000];
my atomicint $i;
(1 .. $maxside).race(:12batch).map: -> $c {
for 1 .. $c -> $b {
for $c - $b + 1 .. $b -> $a {
Line 3,296:
}
 
my @h = (@hh.grep: so *).sort;
say "Primitive Heronian triangles with sides up to $maxside: ", +@h;
 
10,333

edits