Joe, Here's what I want to do but I was hoping someone had a simpler way of 
doing it.

Second grade adds 0, and at the end of the year previews of coming attractions 
hints at multiplication.

There are problems that are true in "table" which cause a little difficulty.

I would like to use  i.y  rather than  >:i.y  but that gets worse problems.

rftable has only random functions and you pick x and y.

rtable looks to the future when you can added new functions in later grades and 
remove the functions that they finally know.



   rftable=: 13 :' ".A=:(":x),(F{''+-=<>*''), '' table '',":y[F=:?6'
   3 1 2 rftable 5 3 0 4
┌─┬───────┐
│>│5 3 0 4│
├─┼───────┤
│3│0 0 1 0│
│1│0 0 1 0│
│2│0 0 1 0│
└─┴───────┘
   F
4
   (i.2) rftable i.7
┌─┬─────────────┐
│*│0 1 2 3 4 5 6│
├─┼─────────────┤
│0│0 0 0 0 0 0 0│
│1│0 1 2 3 4 5 6│
└─┴─────────────┘
   F
5
   
   rtable=: 13 :' ".(":i.X),(F{''+-=<>^''), '' table 
'',":i.Y[(X=:?6),(Y=:>:?6),F=:?6'
   rtable 6
┌─┬───────────┐
│<│0 1 2 3 4 5│
├─┼───────────┤
│0│0 1 1 1 1 1│
│1│0 0 1 1 1 1│
│2│0 0 0 1 1 1│
└─┴───────────┘
   F
3
   X
3
   Y
6
   rtable 6
┌─┬───────┐
│-│0  1  2│
├─┼───────┤
│0│0 _1 _2│
│1│1  0 _1│
│2│2  1  0│
└─┴───────┘
   F
1
   X
0
   Y
3
   rtable 6
┌─┬──────────────┐
│+│0             │
├─┼──────────────┤
│0│ 1 2 3 0 1 2 3│
└─┴──────────────┘
   F
0
   X
1
   Y
4
   rtable 6
┌─┬─────────┐
│>│0 1 2 3 4│
├─┼─────────┤
│0│0 0 0 0 0│
│1│1 0 0 0 0│
│2│1 1 0 0 0│
│3│1 1 1 0 0│
└─┴─────────┘
   F
4
   X
4
   Y
5
   
 Linda  


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Joe Bogner
Sent: Wednesday, October 08, 2014 7:46 AM
To: [email protected]
Subject: Re: [Jbeta] Make a randomly selected = into a "real ="

Linda,

Your question is fairly cryptic and it's unclear why it's posted to beta
instead of programming. May I suggest that you take a step back and write a
phrase describing what you are intending to do? It's like a stumped student
who walks up to a teacher with a sheet full of attempted solutions, but
missing the problem statement.

In any case, I'm interpreting your question as: How do evaluate a string
representation of a verb?

There are many options. The most common solutions are ". or 0!:1. You may
also consider building an explicit string or evaluating a gerund. It seems
like a gerund is the right way to go. Lastly, there may be a way with a
conjunction, but I'm not sure about that.

   ". '1',(r 6),'2'
3

(0!:1) '1',(r 6),'2'
   1>2
0

It seems you are seeking 1 (r 6) 2

Something like this might do:

1 (4 : ('x',(r 6),'y')) 3

The gerund approach could look like this:

   rf=:+`-`=`<`>`|
   rf@.(? 6)
-
   4 rf@.(? 6) 3
7


Hope this helps

Joe

On Wed, Oct 8, 2014 at 6:10 AM, Linda Alvord <[email protected]>
wrote:

> ]A=:i.3
>
> 0 1 2
>
>    ]B=:i.5
>
> 0 1 2 3 4
>
>    r=: 13 :'(? y){''+-=<>|'''
>
>    ]C=:r 6
>
> =
>
>    $r 6
>
>    $=
>
> $ =
>
>    A = / B
>
> 1 0 0 0 0
> 0 1 0 0 0
> 0 0 1 0 0
>
>    A = table B
>
> --T---------┐
> │=│0 1 2 3 4│
> +-+---------+
> │0│1 0 0 0 0│
> │1│0 1 0 0 0│
> │2│0 0 1 0 0│
> L-+----------
>
>    A (r 6) / B
>
> |domain error: scriptd
> |   A    (r 6)/B
> |[-12] c:\users\owner\j803-user\temp\36.ijs
>
>
>
> NB.  Here are some additional responses:
>
>    A C /B
>
> |domain error
> |   A     C/B
>
>    A (r 6) table B
>
> |domain error
> |   (((#~LF-.@e.])5!:5<'u');,.y),.({.;}.)":x,y     u/x
>
>    A (r 6)/ B
>
> |domain error
> |   A    (r 6)/B
>
>
>
> 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

Reply via email to