List comprehensions: Difference between revisions
Content deleted Content added
mNo edit summary |
|||
Line 2,018: | Line 2,018: | ||
a = grid(n,n) |
a = grid(n,n) |
||
a = a,sqrt(a[.,1]:^2+a[.,2]:^2) |
a = a,sqrt(a[.,1]:^2+a[.,2]:^2) |
||
a[selectindex(floor(a[.,3]):==a[.,3]),]</lang> |
a[selectindex(floor(a[.,3]):==a[.,3] :& a[.,3]:<=n),]</lang> |
||
'''Output''' |
'''Output''' |
||
Line 2,035: | Line 2,035: | ||
10 | 12 16 20 | |
10 | 12 16 20 | |
||
11 | 15 8 17 | |
11 | 15 8 17 | |
||
12 | |
12 | 16 12 20 | |
||
⚫ | |||
13 | 16 12 20 | |
|||
</pre> |
|||
14 | 20 15 25 | |
|||
⚫ | |||
=={{header|SuperCollider}}== |
=={{header|SuperCollider}}== |