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