Re: [Jprogramming] Shuffle and deal 4 bridge hands

2018-10-27 Thread Nick S
Many years ago, hmmm, I think it around 1979, I wrote a basic program that could deal bridge hands with constraints. The idea was that you were looking at a known hand, so let's say your partner opens 1 spade and you are bidding 5 card majors. I would take the cards you were looking at, take them

Re: [Jprogramming] Using rank to avoid looping - reference?

2018-10-16 Thread Nick S
Haha. I think / was reduce in APL. On Wed, Sep 5, 2018, 14:52 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > the wikipage mislabels the / operator as map as well (it is in fact a > reduce operator) > > The functional map function replaces a "for each" loop. Rank is very

Re: [Jprogramming] Naming Tacit Verbs

2018-07-07 Thread Nick S
Your example used i rather than i. when you created the verb. If this is a cut and paste, that would be significant. On Sat, Jul 7, 2018, 14:08 Skip Cave wrote: > I have a tacit verb that finds the sum of the factorials of the odd > integers from 1 to 2n - 1: > > +/!>:2*i.1 > > 1 > > +/!>:2*i.2

Re: [Jprogramming] task to ssh interactive

2018-03-05 Thread Nick S
ssh can be run without pty allocation, the remote command can just be run under pipes, for openssh, the option is -T if I read the manual pages correctly. The real question is whether the program you want to run remotely needs a pty (Or the signal processing changes you can get from the pry). Cert

Re: [Jprogramming] J807 beta-a release

2018-03-02 Thread Nick S
I have attempted to install the beta on an android phone that had never before had J installed on it. Then I tried using it and was stymied. I can't load or save anything. For example, I have an ijs file I want to use from downloads. Soon as I do the load and then hit ".." To walk the tree J fail

Re: [Jprogramming] deal duplicates?

2018-03-02 Thread Nick S
> 5 8 2 13 7 > 0 8 11 10 1 > 7 14 11 12 13 > 9 8 10 14 1 > 6 5 3 1 10 > >NB. the sum (1 15 p. i.5) + the matrix >NB. maps items to items, which are >NB. scalars + rows >NB. which is again mapped item to item >NB. because + has rank 0

Re: [Jprogramming] On rank

2018-02-28 Thread Nick S
t; Raul > > > On Wed, Feb 28, 2018 at 6:37 AM, bill lam wrote: > > I suspect ="2 and *."2 are the same as that without rank conjunction > > because = and *. are rank 0 > > > > On Feb 28, 2018 2:18 PM, "Nick S" wrote: > > > > Someone plea

Re: [Jprogramming] How accurate is (o.) for arguments close to 0 or 1?

2018-02-27 Thread Nick S
Maybe the steel straight edge was some hundreds of meters long? An interesting point about this is that back when I worked in a machine shop for a summer we would commonly set keyway cuts by eye and one of the master machinists proved to me that it was possible to do so within 0.001" on 1" cold ro

[Jprogramming] On rank

2018-02-27 Thread Nick S
Someone please tell me if I understand this: If I have a list of 5x5 tables, that is, a thing with a shape of n 5 5 where n is anything from 1 to 30, That is, the shape of the table might be (5 5 or 2 5 5 or 3 5 5 etc.) and I want to compare it against a single 5x5 thing in 5x5 groups, the proper

Re: [Jprogramming] deal duplicates?

2018-02-22 Thread Nick S
Never mind, I see my mistake. I was assembling my square array one way and using it another. Sorry to bother everyone. On Thu, Feb 22, 2018 at 6:24 AM, Nick S wrote: > I am trying to print a bingo card. The expression I am using is simple. > My result is unexpected: > > &

[Jprogramming] deal duplicates?

2018-02-22 Thread Nick S
I am trying to print a bingo card. The expression I am using is simple. My result is unexpected: |:((<' B '),(<' I '),(< ' N '),(<' G '),(<' O ')),. 3&": L:0 <"0(1 16 31 46 61)+(5?15),.(5?15),.(5?15),.(5?15),.(5?15) ┌───┬───┬───┬───┬───┐ │ B │ I │ N │ G │ O │ ├───┼───┼───┼───┼───┤ │ 2│ 16│ 4

Re: [Jprogramming] Explicit to tacit

2018-01-17 Thread Nick S
3{.5*20+i.199-19 100 105 110 _3{.5*20+i.199-19 985 990 995 +/5*20+i.199-19 98550 <.999%5 199 Is where you get 199 from, and 20*5 is 100, so that is how you get the range. It is simpler to just multiply the shortened range by 5 and sum it than to filter it. If you are trying to impress people wi

Re: [Jprogramming] Lists of integers remember their parentage

2018-01-12 Thread Nick S
Hmm, is it better, in general to code that as *./ reply = 'yes' or */ reply = yes or reply -: 'yes' or maybe (<,tolower reply) e. (,'y');'ye';'yes' I know, my actual question is, When I work with booleans I always try to use and and and or to maintain boolean results. I have noticed in o

[Jprogramming] Android and regular expressions

2018-01-09 Thread Nick S
I see that the regular expression support is achieved by calling an external library. I have used J a lot on my Android phone and just installed J on an Amazon Fire, which basically runs Android with a payment system that is slightly different, but since J has no in-app purchases it does not matte

Re: [Jprogramming] argument pairs

2018-01-08 Thread Nick S
x27;) > adbecfagbhciajbkclambncoapbqcrasbtcu > > Did you try two ranks? > > Henry Rich > > > > On 1/8/2018 11:26 AM, Nick S wrote: > >> I want to shuffle arrays, such that I pair them, a member of 1 with a >> member of the next, as: >> >> &#

[Jprogramming] argument pairs

2018-01-08 Thread Nick S
I want to shuffle arrays, such that I pair them, a member of 1 with a member of the next, as: 'abc' ,"_1 'def' ad be cf ,'abc' ,"_1 'def' adbecf But what I want to do is to: so the same sort of pairing with this as a right argument: 6 3 $ 'defghijklmnopqrstu' Now, honestly, I had

Re: [Jprogramming] A normal exit from a deeply embedded function to a terminal prompt, how?

2018-01-05 Thread Nick S
Great suggestion. I actually played with it for quite a while last night, got it all working. The solver can solve any puzzle I throw at it, including those that barely have enough definition to hold together. I can imagine puzzles it can't solve but those would have to be constructed to be unso

Re: [Jprogramming] overwite?

2018-01-03 Thread Nick S
With jqt, I might try to dissect the prompt program to see exactly what it is doing and if it is applicable. With emacs, well, the code for the mode is probably written in lisp, so you can hack on that just like anything else to get it to do what you want. If not, there is source somewhere. On T

Re: [Jprogramming] A normal exit from a deeply embedded function to a terminal prompt, how?

2017-12-30 Thread Nick S
ou want to use a stop-on-error script or adverse to > regain control -- http://www.jsoftware.com/help/dictionary/dx000.htm > or http://www.jsoftware.com/help/dictionary/d312.htm > > Ultimately... what you're talking about is a bit ugly and whatever you > choose is going to have some

[Jprogramming] A normal exit from a deeply embedded function to a terminal prompt, how?

2017-12-30 Thread Nick S
Well, exit'' takes J down completely. I have read through most of the foreigns again, and through doc, and I searched the messages from this forum for a bit. Either I can't find the right search string or it has not been discussed since I have begun following this. I just can't find an answer.

Re: [Jprogramming] Error with select? Maybe someone can explain this to me.

2017-12-25 Thread Nick S
ject: Re: [Jprogramming] Error with select? Maybe someone can > >> explain this to me. > >> > >> 'e' e. ,'e' > >> 1 > >> The character was found in the list. > >> > >> (<'e') e. <,'e' > &g

Re: [Jprogramming] Error with select? Maybe someone can explain this to me.

2017-12-24 Thread Nick S
I worried about that, but the read is completing. I think that "within a script" would mean that if I had immediate code in an ijs file I can't pause the load to read from the keyboard. I understand the point, and the fix worked. But I thought I had tested for rank mismatch when I did this: (

Re: [Jprogramming] Clearing a screen in jqt and the best way to replace a column

2017-12-24 Thread Nick S
The very first thing I wrote in the post that started this thread was: I have a 3d array that is the formatted output of a table. I capture > snapshots of it at different points in my processing, in a rank 3 array. I > want to flip between pages to see how the processing progresses. I thought > I

[Jprogramming] Error with select? Maybe someone can explain this to me.

2017-12-24 Thread Nick S
I am using jqt on windows. Specifically: 9!:12 '' 6 9!:14'' j806/j64avx/windows/beta-3/commercial/www.jsoftware.com/2017-04-10T18:03:23 I stop and start the jqt program. Then I select my project but I do not load any of the programs into the workspace. I highlight and select the seltest

Re: [Jprogramming] Clearing a screen in jqt and the best way to replace a column

2017-12-24 Thread Nick S
"it" is nor what "working" would look like... > > We can guess, and sometimes maybe get it right, but we can also guess > and get it wrong. > > Thanks, > > -- > Raul > > > On Sun, Dec 24, 2017 at 4:09 AM, Nick S wrote: > > OK, so basically

Re: [Jprogramming] Clearing a screen in jqt and the best way to replace a column

2017-12-24 Thread Nick S
Using two transpositions was my first thought. I came to J from years of dabbling with APL (first use was inn 1970ish on the 360/65 at the UofF where they ran APL for two hours at lunch..instead of their homegrown timesharing system, nd then on an 8K IBM 1130. So, in a way I miss the APL syntax.

Re: [Jprogramming] Clearing a screen in jqt and the best way to replace a column

2017-12-24 Thread Nick S
fewer operators. Maybe what I am doing is optimum. On Sat, Dec 23, 2017 at 12:52 PM, Henry Rich wrote: > To modify acolumn: > > 97 98 99 (2})"0 1 i. 3 3 > > 0 1 97 > > 3 4 98 > > 6 7 99 > > > Henry Rich > > > > > On 12/23/2017 12:48 PM, Nick S w

[Jprogramming] Clearing a screen in jqt and the best way to replace a column

2017-12-23 Thread Nick S
I have a 3d array that is the formatted output of a table. I capture snapshots of it at different points in my processing, in a rank 3 array. I want to flip between pages to see how the processing progresses. I thought I would clear the screen, then display the output, that being one of the stacke