Here's an example:

load 'viewmat'
  ]Y=:3 3$(5#255),4#0
255 255 255
255 255   0
  0   0   0
   
   Y viewmat i.10
   Y viewmat i.1000
   Y viewmat i.1000000
   
Linda

-----Original Message-----
From: Programming [mailto:[email protected]] On Behalf 
Of Linda A Alvord
Sent: Tuesday, January 26, 2016 11:26 AM
To: [email protected]
Subject: Re: [Jprogramming] Monday Morning Wake Up Exercise

I thought a 1 result meant the two images are the same.  The first comparison I 
thougth confirmed that the two images that look alike to me really are the 
same. The colors seem ok but I wasn't sure.

Grade 4 involves large and small numbers. Here are a million shades of yellow.  
However as viewmat get mor complex, comparison is difficult. I'm glad to know 
that result is not true. Maybe the result should be some hint like _ so you 
wouldn't trust the result.

Linda

-----Original Message-----
From: Programming [mailto:[email protected]] On Behalf 
Of Dan Bron
Sent: Tuesday, January 26, 2016 10:28 AM
To: J Programming
Subject: Re: [Jprogramming] Monday Morning Wake Up Exercise

Linda wrote:
> (Y viewmat i.4)-:Y4 viewmat i.4
> (Y4 viewmat i.5)-:Y5 viewmat i.5

> Or maybe this should be:
> (Y viewmat i.5)-:Y5 viewmat i.5

I’m not sure what you’re trying to test with those -:s, but note that in the 
standard J IDEs, the result of viewmat (of any input) is always the same; 
specifically, it’s always i.0 0  (a 0x0 square of integers). 

So, for example,

   (viewmat ?~ 13) -: viewmat #:i.67
1

Note that both the arrays ?~13 and #:i.67 and their respective viewmat 
visualizations are completely different animals. 

The -: is telling you nothing (except that viewmat is defined to always return 
i.0 0).

-Dan


----------------------------------------------------------------------
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