Is this (a more general solution of) what you mean?

   CONTIG "."0;._2 '111111 100101 100101 100011 101001 111111 '
1 1 1 1 1 1
1 3 3 1 5 1
1 3 3 1 5 1
1 3 3 3 1 1
1 3 1 3 3 1
1 1 1 1 1 1

See http://www.jsoftware.com/pipermail/general/2005-August/023910.html

R.E. Boss



-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Oleg Kobchenko
Verzonden: dinsdag 1 mei 2007 9:15
Aan: Programming forum
Onderwerp: [Jprogramming] A mazing grace

This is probably a standard path-finding
algorithm, and possibly already implemented in J.

Given a boolean matrix, as shown in the first output, 
and an index with 0, e.g. (<1 1); return 1s for all 0s 
reachable with rectangular paths.

   "."0;._2 '111111 100101 100101 100011 101001 111111 '
1 1 1 1 1 1
1 0 0 1 0 1
1 0 0 1 0 1
1 0 0 0 1 1
1 0 1 0 0 1
1 1 1 1 1 1
   "."0;._2 '000000 011000 011000 011100 010110 000000 '
0 0 0 0 0 0
0 1 1 0 0 0
0 1 1 0 0 0
0 1 1 1 0 0
0 1 0 1 1 0
0 0 0 0 0 0


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to