On Thu, Apr 8, 2010 at 5:44 PM, Kip Murray <[email protected]> wrote:
> I would like for you to subject your solutions to one more test: try them on
> the
> box with diagonal 4 3 0 ,: _4 _3 _2 .
points=: [: >@,@{ [: <"1@|: +/\
faces=: ] -~/\@,:"1 [ #~ 1 = ] +/@:="1 [
boxr=: ((faces {.), (faces {:))@points
boxo=: 4 : ',/((x ,: x&+) -~/\@,:"1 y&-)"1 y*=i.#y'/
<"2 boxr 4 3 0,:_4 _3 _2
+-------+-------+-------+------+------+------+
|4 3 0| 4 3 0| 4 3 0|0 0 _2|0 0 _2|0 0 _2|
|0 _3 _2|_4 0 _2|_4 _3 0|4 3 0|4 0 2|0 3 2|
+-------+-------+-------+------+------+------+
<"2 boxo 4 3 0,:_4 _3 _2
+--------+-------+--------+-------+-------+--------+
| 4 3 0|0 3 0| 4 3 0| 4 0 0| 4 3 0| 4 3 _2|
|_4 _6 _2|0 _6 _2|_8 _3 _2|_8 0 _2|_8 _6 0|_8 _6 2|
+--------+-------+--------+-------+-------+--------+
I may have broken Oleg's solution?
FYI,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm