cubes=:0,:"1 ] _1^#:i.8
NB. box is represented with origin and diagonal vector
NB. canonic representation is one with diagonal vector having all
NB. nonnegative components
cr=:(<./ ,:>./)&.(+/\)
NB. list faces
faces=:[: ,/ ((({:@[ * -...@]) ,:"1~ {...@[ ,: {...@[ + {:@[ * ])"2 1
=...@i.@{:@$)
I just wanted to show off my version of cr, which uses my favorite &.(+/\)
faces verb is not different from what others have already posted and included
only since original poster specifically asked for it.
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm