I guess "we ain't got no bananas today!"

Thanks,  Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Wednesday, November 18, 2015 9:44 AM
To: Programming forum
Subject: Re: [Jprogramming] JTECH Grade 4 Summarry Part 1

Here are some alternatives for blight (bpaint could use similar approaches):

   blight=: 13 :'(3,~2^~#y)$,255<.+"1/~y'

   blight=: 13 :'(3,~*:#y)$,255<.+"1/~y'

   blight=: 13 :'(*:#y)$,/255<.+"1/~y'

   blight=: 13 :',/255<.+"1/~y'

You could also do things like

   blight=: 13 :'(3,~2^~#y)$,(255<.+)"1/~y'

but I don't see any advantage to that.

Thanks,

-- 
Raul


On Tue, Nov 17, 2015 at 5:25 PM, Linda A Alvord <[email protected]>
wrote:
> Here's topic1 of JTECH Grade 4. This dialog blends colors of light in
tables
> similar to the table verb in J. The code produces three tables:
>
>
>
> Table 1 blends colors by adding he three components of two GRB
>
> colors.
>
>
>
> Table 2 removes duplicates.  Green and red light is yellow.
>
>
>
> Table 3 Blends yellow, cyan and magenta as paint. The colors become
darker.
> Yellow and magenta form red. So this explains the colors of printer ink.
>
>
>
> JHS provides a continuous story as the script is run.  Instead jqt
provides
> three separate png's.
>
>
>
> load 'viewmat'
>
> [GRB=:|.255*1 0 2{"1 #:i.8
>
> */table i.5
>
> [GRB1=:3 5 6{GRB   NB. One light
>
> blight=: 13 :'(3,~2^~}:$y)$,255<.+"1/~y'
>
> LPAL=:blight GRB1
>
> [LPALS=:(3#255),LPAL,0 0 0
>
> [T=:(|:(10 0,1 5 9),.5#0)
>
> [B=:((,.1 5 9),.0),.>:i.3 3
>
> LPALS viewmat T,B
>
> t=: 13 :'>:/~>:i.y'
>
> t 3
>
> [TB=:(|:10 0 1 5 9,.0),(1 5 9,.0),"1(t 3)*>:i.3 3
>
> LPALS viewmat TB
>
> [GRB2=:1 2 4{GRB   NB. TWO lights
>
> bpaint=: 13 :'(3,~2^~}:$y)$,0>.255-~+"1/~y'
>
> PPAL=:bpaint GRB2
>
> [PPALS=:(3#255),PPAL,0 0 0
>
> PPALS viewmat TB
>
> t
>
> blight
>
> bpaint
>
>
>
> Linda
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to