Jump to content

Trabb Pardo–Knuth algorithm: Difference between revisions

+Dyalog APL
m (→‎{{header|Sidef}}: Fix link: Perl 6 --> Raku)
(+Dyalog APL)
Line 215:
6.0000
</pre>
 
=={{header|APL}}==
{{works with|Dyalog APL}}
<lang APL>∇ {res}←Trabb;f;S;i;a;y ⍝ define a function Trabb
f←{(0.5*⍨|⍵)+5×⍵*3} ⍝ define a function f
S←,⍎{⍞←⍵ ⋄ (≢⍵)↓⍞}'Please, enter 11 numbers: '
:For i a :InEach (⌽⍳≢S)(⌽S) ⍝ loop through N..1 and reversed S
:If 400<y←f(a)
⎕←'Too large: ',⍕i
:Else
⎕←i,y
:EndIf
:EndFor
∇</lang>
 
=={{header|AutoIt}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.