No, it's not coding style. This is just my 'coding style', due to my level of understanding and knowledge of J. What I'm looking for is how would a J-expert implement the algorithm, e.g. is it possible to avoid 'some' boxing.
Hallo Dan Bron, je schreef op 13-03-10 15:14: > Oh, if you're just looking for feedback on coding style, I'll post this on > RC and start a thread on it in the Talk: page. > > -Dan > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Aai > Sent: Saturday, March 13, 2010 7:29 AM > To: Programming forum > Subject: Re: [Jprogramming] Fast(er) Hofstadter-Conway 10K $ sequence > generation > > Dan, till now no one came up with an improvement for my sequence > generator. So feel free using it to finish your RC contribution. The > reason I asked the forum to improve it was a language matter, not really > a speed matter (though also important). > > HCF=: 1 1,[:(#(2...@#))[:;(,;@(|.@(#;.1)(],~1$~[)&.> > <@:>:;.1)&.>@{:)^:(]`(<@2:)) > > And here is also the 'real' recursive one: > > nthHCT =: (($:@] + $:@-) $:@<:)`1:@.(3>])"0 M. > > argument >: 1 > > nthHCT 1+i.16 > 1 1 2 2 3 4 4 4 5 6 7 7 8 8 8 8 > > > > Hallo Dan Bron, je schreef op 11-03-10 18:21: > >> Aai wrote: >> >> >>> Because of a hidden order it's possible to generate the sequence [1] >>> much faster then e.g. by >>> (, ] (({~<:)+({~-)) {:)^:(_2+2^5) 1 1 >>> >>> >> I posted a naïve solution along these lines yesterday. Feel free to >> > replace it with your faster versions! > >> -Dan >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> >> >> > -- Met vriendelijke groet, =@@i ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
