Re: [Jprogramming] Representing trees

2020-07-20 Thread 'Bo Jacoby' via Programming
Devon asked: "how to convert my tree representation to ordinal numbers"? By the way, it is ordinal fractions, not ordinal numbers.  This is how. Take Devon's names: nms =. 'C:';'n0';'n1';'n00';'n01';'n10';'n11';'n12';'n100';'n110';'n111';'n112' Add 1 to each digit, as ordinal fractions use one-or

Re: [Jprogramming] Representing trees

2020-07-20 Thread Devon McCormick
My tree code can be found here: https://github.com/DevonMcC/trees . On Mon, Jul 20, 2020 at 4:20 PM Devon McCormick wrote: > I meant the J essay suggested by Jan-Pieter was the one I used. > > On Mon, Jul 20, 2020 at 4:00 PM Devon McCormick > wrote: > >> It was simple to convert my parent-index

Re: [Jprogramming] Representing trees

2020-07-20 Thread Devon McCormick
I meant the J essay suggested by Jan-Pieter was the one I used. On Mon, Jul 20, 2020 at 4:00 PM Devon McCormick wrote: > It was simple to convert my parent-index form to use with the tree display > function "tree": >nmsb=. > 'C:';'n0';'n1';'n00';'n01';'n10';'n11';'n12';'n100';'n110';'n111';'

Re: [Jprogramming] Representing trees

2020-07-20 Thread Devon McCormick
It was simple to convert my parent-index form to use with the tree display function "tree": nmsb=. 'C:';'n0';'n1';'n00';'n01';'n10';'n11';'n12';'n100';'n110';'n111';'n112' NB. Node names trb=. _1 0 0 1 1 2 2 2 5 6 6 6 NB. Parent-index tree EW=: {: BOXC=: 11{.16}.a. NB. Line-drawing ch

Re: [Jprogramming] Representing trees

2020-07-20 Thread Devon McCormick
Thanks everyone for the responses. I have watched the APL video recently but have not tried to convert Aaron's code to J. However, the essay suggested by Julian does what I want. Bo's response is intriguing but I have not figured out how to convert my tree representation to ordinal numbers. On M

Re: [Jprogramming] Representing trees

2020-07-20 Thread 'Bo Jacoby' via Programming
Minor simplification:       n=.(/:{])12 3$'00010020011012021022023021122123'       (6-~+/"1 n='0')|."0 1 n,"1'00',(4#' '),'§' Thanks.  Bo. Den søndag den 19. juli 2020 23.49.17 CEST skrev 'Bo Jacoby' via Programming : I use ordinal fractions. nms=.'000';'100';'200';'110';'120

Re: [Jprogramming] from vs fetch

2020-07-20 Thread R.E. Boss
Thanks. The second solution (preferably in the simpler form 1 ((<"0@,.~ i.@#) {:: ] ) y ) would be admissible for large y, but probably the performance would be poor. R.E. Boss -Original Message- From: Programming On Behalf Of Igor Zhuravlov Sent: maandag 20 juli 2020 03:51 To: prog

Re: [Jprogramming] from vs fetch

2020-07-20 Thread R.E. Boss
The critical point being "NB. Can't follow more than one selection path" on https://code.jsoftware.com/wiki/Vocabulary/curlylfcoco R.E. Boss -Original Message- From: Programming On Behalf Of Henry Rich Sent: zondag 19 juli 2020 16:21 To: [email protected] Subject: Re: [Jprog