Composing a conversion function:
conv=: ((0,#:1 2 4){~[:<.%~),|{~~[:#:[:i.[
t2c=: ([:12&conv{.),[:15&conv"0}.
t2c <.3}.6!:0 ''
0 0 1 1 0 0 0
0 0 0 1 1 1 0
0 0 1 0 0 0 1
By replacing caps with atops I forgot an atop:
conv=: ((0,#:1 2 4){~<[EMAIL PROTECTED]),|{~~[:#:i.[
t2c=: 12&[EMAIL PROTECTED],15&conv"[EMAIL PROTECTED]
causing J602B to crash.
I checked this with J601, which didn't crash but
came up with a neat:
t2c <.3}.6!:0 ''
|index error: conv
| t2c<.3}.6!:0''
My playground is Linux SUSE 10.0, and
9!:14 ''
j602/beta/2007-09-19/23:00
+---+----------+
|@@i|a.{~q:9991|
+---+----------+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm