APL Wiki logo: Difference between revisions

Jump to navigation Jump to search
4 bytes added ,  18:44, 7 January 2020
Line 169: Line 169:
<source lang=apl inline>⍴r</source> is the [[shape]] of our array of radii. Now, you remember <source lang=apl inline>⍳</source>, [[#Generating_indices|right]]? As it turns out, it can actually generate of an array of any number of dimensions; two in our case:
<source lang=apl inline>⍴r</source> is the [[shape]] of our array of radii. Now, you remember <source lang=apl inline>⍳</source>, [[#Generating_indices|right]]? As it turns out, it can actually generate of an array of any number of dimensions; two in our case:
<source lang=apl>
<source lang=apl>
       ⊢indices←⍳⍴r
       ⊢indices←⍳⍴sizes
┌───┬───┬───┬───┬───┐
┌───┬───┬───┬───┬───┐
│0 0│0 1│0 2│0 3│0 4│
│0 0│0 1│0 2│0 3│0 4│

Navigation menu