require 'viewmat'
at2=: 13 :'([:{:"1 *.) j./"1 y'
]P8=: 255* #:i.8
]Q8=:1 0 2{"1 P8
ro=: 13 :'<.0.5+y'
we=: 13 :'+/"1[0.3 0.59 0.11*"1 y'
gray=: 13 :'3#"0 ro we y'
ts=: 6!:2 , 7!:2@]
ts '(gray P8) viewmat (D=:at2"0 /~ i:1000);''Better Gray Clock'''
RM=: (# # +/ % #)"1
grayRM=:RM P8
ts 'RM(3#"0 i.255) viewmat D;''Better Gray Clock Raul Miller'''
Q8=:1 0 2{"1 P8
grayLA=: 13 :'1 0 2{"1 y'
ts '(gray Q8) viewmat D;''Better Gray Clock Linda Alvord'''
Both images look quite good. Is there some way to determine which is the
better image or are they the same?
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Sunday, March 30, 2014 4:17 PM
To: Programming forum
Subject: Re: [Jprogramming] Challenge 14; Colorful Creations
Like this?
(3#"0 i.255) viewmat D;'Grade from white to black, clockwise from North'
Thanks,
--
Raul
On Sun, Mar 30, 2014 at 4:09 PM, Linda Alvord
<[email protected]>wrote:
> Here's another solution:
>
> RM=: (# # +/ % #)"1
> grayRM=:RM P8
> (grayRM) viewmat D;'Gray Clock 1 Raul Miller'
>
> grayDL-:grayRM
>
> Actually both roads lead to the same Rome.
>
> Raul. If you look at your clock, can you make a better clock face that
> grades from white to black going clockwise from North?
>
> Linda
>
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Linda
> Alvord
> Sent: Sunday, March 30, 2014 3:29 PM
> To: [email protected]
> Subject: Re: [Jprogramming] Challenge 14; Colorful Creations
>
> Here's the first entry from David Lambert.
>
> grayDL=: P8 +/ .*3 3$1r3
> (grayDL) viewmat D;'Gray Clock 1 Dave Lambert'
>
> Imagine that his image is the face of a clock. What I am looking for in
> Example 2 is a clock face that will be a better gradient from white to
> black
> if you start at noon and travel around the clock going clockwise all the
> way
> to 12 again.
>
> Linda
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Linda
> Alvord
> Sent: Sunday, March 30, 2014 12:26 PM
> To: [email protected]
> Subject: [Jprogramming] Challenge 14; Colorful Creations
>
> Challenge 13 was posted on 7/2/2012. It must be time for another. Here
> is
> challenge 14:
> Copy the code below into a new temp in jqt. Now run all lines of the
> code.
>
> require 'viewmat'
>
> at2=: 13 :'([:{:"1 *.) j./"1 y'
> viewmat (D=:at2"0 /~ i:300);'Arctan'
> ]P8=: 255* #:i.8
> P8 viewmat D;'Challenge Example 1'
>
> NB. When you run the code above, you will create 2 bmp images.
> NB. D is the numeric array of data and
> NB. P8 is the 8 color palette.
>
> NB. Here is the challenge:
> NB. Design a function called "gray" that will convert Example 1 into a
> grayscale image.
>
> NB. gray=:
>
> (gray P8) viewmat D;'Gray Challenge 1'
>
> Please provide an expression that will when inserted for gray above
will
> produce the grayscale image.
>
> Pasting the bmp as an inserted image works in emails, but will be rejected
> in the forum.
>
> Have fun.
>
> 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm