I was working on my adventofcode solution earlier today and was stuck and
still can't figure out why this doesn't work.

Take this expression.

(0&= @ |~)/~ 5 9 2 8

1 0 0 0

0 1 0 0

0 0 1 0

0 0 1 1


And this expression


(~:)/~ 5 9 2 8

0 1 1 1

1 0 1 1

1 1 0 1

1 1 1 0


Why can't I combine it into a single fork to AND the two tines?


(~: *. (0&= @ |~))/~ 5 9 2 8

0 0 0 0



Instead I have to do this


(~:/~ *. (0&= @ |~)/~) 5 9 2 8

0 0 0 0

0 0 0 0

0 0 0 0

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

Reply via email to