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
