(0:[EMAIL PROTECTED])/\.&.|. 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 2 3 0 0 0 0 1 2 0 0 0 1 2 3 4 5 0 1
R.E. Boss -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Dan Bron Verzonden: maandag 24 april 2006 16:31 Aan: Programming forum Onderwerp: [Jprogramming] Puzzle: Stop and go sums I need running sums that obey traffic lights. sgs 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 2 3 0 0 0 0 1 2 0 0 0 1 2 3 4 5 0 1 What's the most efficient way to express sgs ? So far I've got: db0 =: (~:&0@:[ * +)/\.&.|. db1 =: ;@:(<@:(+/\);.1~ (< _1&(|.!._))) -Dan ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
