Sorry, it should be:
   t=: 70 + +/\ 0.5*_0.5+1000 [EMAIL PROTECTED] 0   NB. simulated daily close
instead of
   t=: 70 +/\ 0.5*_0.5+1000 [EMAIL PROTECTED] 0   NB. simulated daily close



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Wednesday, June 20, 2007 9:39 am
Subject: Re: Array vs. Looping examples [was Re: [Jgeneral] J Primer - naive 
implementation of add 2 lists of numbers]

> > If anyone can provide any other good illustrations of this, I'd 
> be 
> > grateful.
> 
> http://www.jsoftware.com/jwiki/Essays/99_Bottles_of_Beer
> http://www.jsoftware.com/jwiki/Essays/Kakuro
> http://www.jsoftware.com/jwiki/Essays/N_Queens_Problem
> http://www.jsoftware.com/jwiki/Essays/Self-Upgrading_Permutations
> http://www.jsoftware.com/jwiki/Essays/Sudoku
> http://www.jsoftware.com/jwiki/Essays/Triangular_Matrix_Inverse
> etc.
> 
> Also, don't forget the simple examples which we
> take for granted because they are so old hat:
> 
> avg=: +/ % #
> 
> x=: 3 4 5 [EMAIL PROTECTED] 100
> avg   x     NB. average of the planes
> avg"3 x     NB. same as above
> avg"2 x     NB. averages of the rows
> avg"1 x     NB. averages of each row
> 
> t=: 70 +/\ 0.5*_0.5+1000 [EMAIL PROTECTED] 0   NB. simulated daily close
> 30 avg\ t   NB. 30-day moving average
> 200 avg\ t  NB. 200-day moving average
> ((k-1)}.t) I.@:> k avg\t [ k=: 30  NB. indices where daily close 
> is above k-day moving average
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to