Re: [Jprogramming] Tacit hook

2021-08-01 Thread David Lambert
Noting that binary is the base for monadic antibase, h=: ((= +/"1) # ]) ([: #: [: i. 2&^) 3 (0 -.@:e. (Smps -: h)&>) #\i.9 NB. a test 1 And Raul already arrived here. Can we further eliminate ]same? Date: Sat, 31 Jul 2021 15:52:03 + (UTC) From: "'Bo Jacoby' via Programming" To: Pro

Re: [Jprogramming] Tacit hook

2021-08-01 Thread Raul Miller
Alternatively, you could just use comb: require'stats' 2 (i.@] e."1 comb) 6 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 1 1 Or, if you want the previous orderi

Re: [Jprogramming] Tacit hook

2021-08-01 Thread 'Michael Day' via Programming
Thanks,  Bo. This variation on comb works pretty well,  except it doesn't test for the empty case, ie x = 0: NB. these boolean verbs are quicker than multiply and add for this case twice =: 1 & (32 b.) or    =: 23 b. Smpscomb =: 4 : 0  k=. 2^i.>:d=.y-x  z=. <"0 k  for. i.<: x do.    z=. k or &.

Re: [Jprogramming] Tacit hook

2021-08-01 Thread 'Bo Jacoby' via Programming
Thanks to Mike!  comb=: 4 : 0 NB.*comb v combinations of size x from i.y comb=: 3 : 0 comb~ y : k=. i.>:d=. y-x z=. (d$ ,&.>/\. >:&.> z end.    3 comb 6 I need to study in order to make it do what I want. I am aware that my programming is embarassingly inefficient.  Thanks to Raul!    2

Re: [Jprogramming] Tacit hook

2021-08-01 Thread 'Mike Day' via Programming
Nice work, especially persuading 13 : to return a tacit version. I had reached the same solution as Pascal Jasmin’s, so not worth a comment in itself. However, it is just about worth pointing out that the filtering approach gets expensive for larger values of y; eg 3 Smps 20 would entail fi