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
a: NB. 5 not used
0 1,:1 0 NB. 5
0 0,:1 0 NB. 6
0 0,:1 0 NB. 6
a: NB. 7
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
a: NB. 10 not used
0 0,:1 1 NB. 10
a: NB. 11 not used
EMPTY NB. 11 0 0,:1 1
a: NB. 12 not used
1 0,:1 1 NB. 12
a: NB. 13 not used
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 1 3 {,(+/~ *&({:$y))i:1
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