Marching squares: Difference between revisions
Content added Content deleted
(J: lame partial implementation -- no treatment of saddle points (this version will throw an error for saddle points)) |
m (→{{header|J}}: not quite so lame, but still lame) |
||
Line 20: | Line 20: | ||
0 0,:0 1 NB. 3 |
0 0,:0 1 NB. 3 |
||
0 0,:1 1 NB. 4 |
0 0,:1 1 NB. 4 |
||
0 1,:1 0 NB. 5 |
|||
0 0,:1 0 NB. 6 |
0 0,:1 0 NB. 6 |
||
EMPTY NB. 7 0 1,:1 0 |
|||
1 0,:0 1 NB. 8 |
1 0,:0 1 NB. 8 |
||
1 1,:0 1 NB. 9 |
1 1,:0 1 NB. 9 |
||
0 0,:1 1 NB. 10 |
|||
EMPTY NB. 11 0 0,:1 1 |
|||
1 0,:1 1 NB. 12 |
|||
EMPTY NB. 13 0 1,:1 0 |
|||
EMPTY NB. 14 |
EMPTY NB. 14 0 0,:1 1 |
||
EMPTY NB. 15 |
EMPTY NB. 15 |
||
}} |
}} |
||
unwind=: {{ |
unwind=: {{ |
||
near=. 7 8 5 |
near=. 6 7 8 5 2 3 1 0 {,(+/~ *&({:$y))i:1 |
||
r=., c=. EMPTY |
r=., c=. EMPTY |
||
TODO=. I.(<EMPTY)~:Y=.,y |
TODO=. I.(<EMPTY)~:Y=.,y |