trusted
69
edits
(Created page with "Some modern versions of APL include a set of keywords for controlling the flow of control. Such keywords allow programmers to create '''control stru...") |
|||
Line 6: | Line 6: | ||
For example, a function implementing the [[wikipedia:TPK algorithm|Trabb Pardo–Knuth algorithm]] using control structures: | For example, a function implementing the [[wikipedia:TPK algorithm|Trabb Pardo–Knuth algorithm]] using control structures: | ||
<source lang=apl> | <source lang=apl> | ||
∇ {res}←trabb | ∇ {res}←trabb;f;S;i;a;y | ||
f←{(0.5*⍨|⍵)+5×⍵*3} | f←{(0.5*⍨|⍵)+5×⍵*3} | ||
S←,⍎{⍞←⍵ ⋄ (≢⍵)↓⍞}'Please, enter 11 numbers: ' | S←,⍎{⍞←⍵ ⋄ (≢⍵)↓⍞}'Please, enter 11 numbers: ' |