[Jprogramming] Monday Morning Wake Up Exercise

Linda A Alvord lindaalvord at verizon.net
Tue Jan 26 16:26:00 UTC 2016


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:programming-bounces at forums.jsoftware.com] 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



More information about the Programming mailing list