Law of cosines - triples: Difference between revisions

Added Quackery.
m (syntax highlighting fixup automation)
(Added Quackery.)
Line 2,158:
60 degrees - uneven triangles of maximum side 10000. Total:
18394</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ dup 1
[ 2dup > while
+ 1 >>
2dup / again ]
drop nip ] is sqrt ( n --> n )
 
[ dup * ] is squared ( n --> n )
 
[ dup sqrt squared = ] is square ( n --> b )
[ say "90 degrees" cr
0 temp put
13 times
[ i^ 1+ dup times
[ i^ 1+ squared
over squared +
dup square
over sqrt 14 < and
iff
[ i^ 1+ echo sp
over echo sp
sqrt echo cr
1 temp tally ]
else drop ]
drop ]
temp take echo
say " solutions" cr cr ] is 90deg ( --> )
 
[ say "60 degrees" cr
0 temp put
13 times
[ i^ 1+ dup times
[ i^ 1+
2dup * dip
[ squared
over squared + ]
- dup square
over sqrt 14 < and
iff
[ i^ 1+ echo sp
over echo sp
sqrt echo cr
1 temp tally ]
else drop ]
drop ]
temp take echo
say " solutions" cr cr ] is 60deg ( --> )
[ say "120 degrees" cr
0 temp put
13 times
[ i^ 1+ dup times
[ i^ 1+
2dup * dip
[ squared
over squared + ]
+ dup square
over sqrt 14 < and
iff
[ i^ 1+ echo sp
over echo sp
sqrt echo cr
1 temp tally ]
else drop ]
drop ]
temp take echo
say " solutions" cr cr ] is 120deg ( --> )
 
90deg 60deg 120deg</syntaxhighlight>
 
{{out}}
 
<pre>90 degrees
3 4 5
6 8 10
5 12 13
3 solutions found
 
60 degrees
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
3 8 7
5 8 7
8 8 8
9 9 9
10 10 10
11 11 11
12 12 12
13 13 13
15 solutions
 
120 degrees
3 5 7
7 8 13
2 solutions
</pre>
 
=={{header|R}}==
1,467

edits