Related sites: | site map |

# aiju.de Home of aiju

- › about me/
- › b/
- » code/
- - › RatJS
  - › homework/
  - » k/
  - - » cluster
    - › coins
    - › eratothenes
    - › euler phi
    - › feigenbaum
    - › fibonacci
    - › fsm
    - › molecule
    - › pascal
    - › qsort
    - › sierpinski
    - › tictactoe
  - › misc/
  - › pdp11/
- › donate
- › electronics/
- › legal
- › misc/
- › plan 9/

# Finding Clusters

This programs finds clusters as in percolation theory:

    N:5
    X:(1 0 1 0 1; 1 1 1 0 1; 0 1 0 1 0 ; 0 0 1 1 1; 1 0 0 0 1)
    st:(N;N)#1+!N*N
    u:{(1_ x),(1;N)#0}
    l:{+(u(+x))}
    d:{|(u(|x))}
    r:{+(d(+x))}
    s:{X*x|''(l x)|''(r x)|''(u x)|''d x}
    s/(st*X)